taskflow icon indicating copy to clipboard operation
taskflow copied to clipboard

[feat] Pi approval modal: require explicit y/N confirmation and support collapsible change previews

Open aemonge opened this issue 3 months ago • 0 comments

Problem

The approval screen in Pi becomes difficult to use when the proposed change is large.

The change output takes most of the screen and is barely readable, while the approval action can be triggered with a single key such as a. For an approval gate, that is too easy to activate accidentally.

Proposed behavior

Explicit confirmation

Use a standard Unix-style confirmation prompt:

Approve changes? [y/N]:

Approval should require typing an affirmative response and pressing Enter:

  • y + Enter → approve
  • yes + Enter → approve
  • n + Enter → reject
  • no + Enter → reject
  • Enter with no input → reject
  • Escape or Ctrl-C → cancel/reject

A single keypress such as a or y should not immediately approve the change.

The default must remain N, so accidental Enter presses fail closed.

Collapsible change preview

The proposed change should be independently expandable and collapsible.

For example:

[v] View changes

or, when expanded:

[v] Hide changes

This would allow the user to:

  • keep the approval prompt visible
  • hide very large changes after reviewing them
  • reopen the changes without leaving the approval screen
  • scroll through the changes when expanded
  • approve or reject independently of the preview state

For large changes, collapsing the preview by default may also be preferable.

Expected interaction

Approval required

Changes: 1,247 lines
[v] View changes

Approve changes? [y/N]:

After pressing v:

Approval required

Changes: 1,247 lines
[v] Hide changes

<scrollable change preview>

Approve changes? [y/N]:

Motivation

Approval is a safety boundary and should require a deliberate action.

The current single-key approval behavior is easy to trigger accidentally, while always displaying a large change makes the approval screen difficult to read and navigate.

An explicit y/N confirmation plus a collapsible preview would make the flow safer and more usable without complicating the keyboard-driven interface.

Acceptance criteria

  • [ ] A single keypress cannot immediately approve
  • [ ] y or yes, followed by Enter, approves
  • [ ] Empty input followed by Enter rejects
  • [ ] n or no, followed by Enter, rejects
  • [ ] The default answer is N
  • [ ] The change preview can be expanded and collapsed
  • [ ] Toggling the preview does not approve or reject
  • [ ] Large changes remain scrollable when expanded
  • [ ] The approval prompt remains visible and usable with large changes

aemonge avatar Aug 07 '26 13:08 aemonge