Krizaka UI
Krizaka UI
Patterns

Proposal review

An agent proposes, a person approves, rejects or edits: who proposes, what, how sure it is (in words and figures), the evidence as a signed diff, and the decision announced.

Web · ✓Mobile · ✗ to buildDesktop · ✓BetaBlocks
import { ProposalReview, DiffView } from "@krizaka/ui/proposal";

Web only — React, from @krizaka/ui/proposal. Beta: its API may still change in a minor version.

  • Mobile · ✗ to build. The Orazaka Mac app renders the web block (orazaka#109); a phone twin follows with the first phone approval screen. issue #673

Why it is here. Orazaka's runs: approvals in the run timeline and the review queue (orazaka-web-client#270, #275) and the Mac app's diffs (orazaka#109; krizaka-ui#673, B09).

When to use

  • A run needs a human to approve what an agent proposes (a timeline step, a review queue, a diff with approval).
  • Any proposal whose approval must be explicit, keyboard-reachable and announced.

When not to use

Installation

Install

npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcss

Styles

@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";

Import

import { ProposalReview, DiffView } from "@krizaka/ui/proposal";

Examples

Approve a change

A planner agent proposes a reminder change; the diff shows the lines; Approve, Reject and Edit.

Props

DiffView

The lines of a change, signed and labelled; colour only reinforces.

PropTypeDefaultDescription
linesrequiredreadonly DiffLine[]—The lines of the change, in order.
wordsrequiredDiffViewWords—The words, passed translated.

ProposalReview

One proposal of an agent, its evidence, and the person's decision.

PropTypeDefaultDescription
agentrequiredstring—The agent that proposes: its name, with its bird or mark in mark.
confidencerequiredProposalConfidence—How sure the agent is: in words, with the figure when known.
onApproverequired() => void—The person approves.
onRejectrequired() => void—The person rejects.
staterequiredProposalState—Where the decision stands; the host owns it.
summaryrequiredstring—What it proposes, in one sentence.
wordsrequiredProposalWords—The words, passed translated.
busybooleanfalseBlocks the actions while the host saves the decision.
childrenReactNode—The evidence: a DiffView, a list, a quote.
irreversiblebooleanfalseThe approval cannot be undone: it takes two presses.
localestring—BCP 47 language for the percentage.
markReactNode—The agent's bird or mark, drawn small beside its name.
onEdit(() => void)—The person edits the proposal first; the button shows only when given.

Accessibility

  • There is no slide-to-approve: a drag has no keyboard or screen-reader path (ADR-006).
  • DiffView prefixes every line with a sign and a hidden word (Added, Removed, Unchanged); the colour is never the only signal.
  • The state is an output region: it is read when it changes.
  • At 360 px the buttons wrap and the diff lines wrap; nothing scrolls sideways.

Keyboard

KeysAction
TabApprove, Reject, then Edit, in that order.
Enter / SpacePresses the focused button; an irreversible approval needs a second press.

Best practices

  • The host owns the state: pass waiting until the decision is saved, then approved, rejected or expired; the new state is announced.
  • Set irreversible when approving cannot be undone: the primary button takes two presses.
  • Say the confidence in words (label) and add the figure (percent); the chip's tone only reinforces.
  • Examples use a fictitious run with round demo amounts, never a ledger line.

Generated from the code of @krizaka/ui 3.69.0: its meta.ts, its examples and its types.Edit this documentation on GitHub

On this page