Agent approvals: preview proposed edits on both permission surfaces

Merged
AU
8d ago
+384-11

Approval cards now show proposed file edits before you answer. This covers single ACP requests and grouped Claude Edit/MultiEdit requests whose changes arrive as input fragments.

The single-card adapter discarded diffs, and the grouped card read only explicit ACP content. Both now share a request-scoped parser and the existing transcript diff renderer. Explicit ACP diffs take precedence, edit fragments stay fragments, and long changes remain fully visible. Write requests without old contents do not get an invented overwrite diff.

Part of #16541.

Changelog

Fixed: Preview proposed edits in single and grouped agent approval cards.

Validation

Current head: 2e4545e18f5e6e301be5e11ac1ae9d526b1512c5, rebased without conflicts onto 6ca9f1e2fa8cebde80bf41dd2ae62f09b5d395b2.

  • Regression before the fix: CMUX_WEB_TEST_FILES=test/permission-edit-diff.test.tsx scripts/ci/run-webviews-tests.sh failed with 8 expected missing-preview failures and 6 passes on b170d0090a8ac42989c232c3ad39ae5981ef0369 (fleet job 980920d625563d325f0ad778).
  • Current-head focused approval tests: 7 files passed, 0 failed or timed out, 0 retried, fleet job 3468bd7bced5a479cd116b79 on cmux-austin-mini-0, exit 0. Covers diff rendering, command/prompt approvals, shortcuts, refusals, grouped rows, and receipts. Diff tests inspect actual rendered hunk text, including a cold highlighter, both ACP envelopes, and every MultiEdit fragment.
  • Current-head nightly-next Release compile: pending, fleet job 9a40c60b5a0af6bf349a7fe1. Runs scripts/cmux-next/check-release-compile.sh with Xcode 26.6, arm64 Release, optimization and whole-module compilation, matching the train's Release gate.
  • Current-head gallery evidence: all 12 captures ready, no errors. Inspected single, grouped MultiEdit, and long diff bodies in light/dark states.
  • Full web lint, TypeScript, formatting, protocol checks and pre-push gate pass. Canonical autoreview and policy review are clean. Independent receipt: Review (review_approval_previews): SHIP at 2e4545e18f5e6e301be5e11ac1ae9d526b1512c5.

Observed / Not run

The audit retained existing tests, added assertions on real hunk text, and removed the gallery's custom timeout. A DOM observer waits for renderer writes without sleeps or a longer test deadline. No CI gates, test allowlists, or approval policy were changed. No review threads remain unresolved.

The release/notary guard also fails on the exact base; matching logs and failure details. Remaining CI is still being checked. Gallery captures are Chromium fixture evidence; native launch, signing/notarization, universal packaging, and other-platform execution are not claimed.

Gallery comparison.

Gallery: agent-pane.approval-edits