Krizaka UI
Krizaka UI
Patrons

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 · ✗ à construireBureau · ✓BêtaBlocs
import { ProposalReview, DiffView } from "@krizaka/ui/proposal";

Web uniquement — React, depuis @krizaka/ui/proposal. Bêta : son API peut encore changer à une version mineure.

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

Pourquoi il est là. 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).

Quand l’utiliser

  • 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.

Quand ne pas l’utiliser

Installation

Installer

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

Styles

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

Importer

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

Exemples

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.

PropTypeDéfautDescription
linesrequisreadonly DiffLine[]—The lines of the change, in order.
wordsrequisDiffViewWords—The words, passed translated.

ProposalReview

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

PropTypeDéfautDescription
agentrequisstring—The agent that proposes: its name, with its bird or mark in mark.
confidencerequisProposalConfidence—How sure the agent is: in words, with the figure when known.
onApproverequis() => void—The person approves.
onRejectrequis() => void—The person rejects.
staterequisProposalState—Where the decision stands; the host owns it.
summaryrequisstring—What it proposes, in one sentence.
wordsrequisProposalWords—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.

Accessibilité

  • 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.

Clavier

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

Bonnes pratiques

  • 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.

Générée depuis le code de @krizaka/ui 3.69.0 : son meta.ts, ses exemples et ses types.Modifier cette documentation sur GitHub

Sur cette page