Skip to content
This repository was archived by the owner on Aug 17, 2026. It is now read-only.
This repository was archived by the owner on Aug 17, 2026. It is now read-only.

design: staged-vs-applied edit/ast_edit preview #123

Description

@joeshull

Child of #135

Needs a design session. Visual badge is not the hard part; staged-vs-applied semantics are.

Problem

ast_edit (and preview-mode edit) can stage a proposal. TUI shows ⟨proposed⟩ and prepends PREVIEW_PENDING_NOTICE ("files NOT modified yet… write xd://resolve / xd://reject"). Dashboard EditToolRenderer paints the same diff as an applied edit.

Apply/discard is a later write xd://resolve|reject, not a button on the edit card. Wrong product pick: making the edit card itself Approve/Reject vs treating resolve/reject as the only action surface.

Design questions

  1. Badge-only (⟨proposed⟩ + notice) vs interactive Apply/Discard on the originating card?
  2. If interactive: how does the card invoke resolve/reject without a second agent turn?
  3. How are stacked previews associated (pending-invoker id / label)?
  4. Does a staged ast_edit stay visually distinct after a later resolve/reject in the same turn?

Out of scope

Pointers

  • PREVIEW_PENDING_NOTICE + queueResolveHandler: @oh-my-pi/pi-coding-agent/src/tools/resolve.ts
  • Staging: src/tools/ast-edit.ts ~432–456, ~524 (⟨proposed⟩ TUI-only)
  • Dashboard: packages/client/src/components/tool-renderers/EditToolRenderer.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions