Skip to content

chat-ui write-approval preview #20

Description

@philiparxist

write_file / run_shell_command stage a .pending-actions/<id>.json record and return needs_approval with pendingActionKind. The CLI and desktop resolve it; packages/chat-ui's ApprovalCard shows the request but not what will be written — so file tools are CLI/desktop-only for now (see the package README, "File access via tools").

Task: add a diff/content preview to ApprovalCard for pendingActionKind: 'write' (and the command + resolved cwd for 'shell'), sourced from the staged record, so a browser user can approve a staged write with the same information the CLI prints. App.tsx already threads pendingActionId through handleApprove / handleDeny.

Done when: a browser user sees the pending file content (or a diff against the current file) / the shell command + cwd before approving, with a test.

Comment here with your approach before starting.

Activity

  1. added
    enhancementNew feature or request
    chat-ui@buildaharness/chat-ui browser build — approval UI, settings, /try
    on Sep 3, 2026
  2. philiparxist commented on Oct 9, 2026

    @philiparxist
    CollaboratorAuthor

    Done. ApprovalCard (packages/chat-ui/src/components/ApprovalCard.tsx) now shows what will actually happen before you approve: a new file's exact text or a numbered diff against the current file for writes, the command plus its working directory for shell actions, and the fields for an email. Covered by ApprovalCard.test.tsx (new-file block, added/removed diff rows, shell command + cwd). Shipped in 6fd87ac (2026-10-06), now on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    chat-ui@buildaharness/chat-ui browser build — approval UI, settings, /tryenhancementNew feature or requestgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions