ReviewableDiff

The same diff, but each hunk is a decision: keep it, discard it, apply what survived.

Install it:

npx shadcn add @ambientui/reviewable-diff

Live

composer.tsx0s

nothing applied

Behavior

  • ·The difference from CodeDiff is CONSEQUENCE, not appearance: here the assistant is asking permission, per hunk.
  • ·Three states per hunk — kept, discarded, undecided — because defaulting undecided to either one decides for the user.
  • ·It counts what is left to review and disables Apply at zero kept, so "apply" can never quietly mean "apply nothing".
  • ·A discarded hunk dims rather than disappearing; you can still see what you turned down.

When to use

  • ·Any change the assistant proposes to files the user owns.
  • ·Wherever partial acceptance is genuinely possible.

When not to

  • ·For changes already applied — showing decisions for a fait accompli is theatre.
  • ·When the hunks are not independent; offering per-hunk choice on a change that only works whole invites a broken state.