Skip to content

fix(tui): keep every approval choice on screen under a tall body - #1566

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-11362-long-approval-prompts-hide-accept-once-leaving-only-reject
Oct 25, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-11362-long-approval-prompts-hide-accept-once-leaving-only-reject

Conversation

@bwachman

Copy link
Copy Markdown
Contributor

Summary

  • A permission or operator prompt trims its body until every choice fits, instead of until one choice fits. With a long multi-line command, the prompt previously drew only Reject at 80x24 and 100x30, leaving Reject and stop and Accept once scrolled out of view.
  • The command's first lines stay visible above the choices; the full text is still available in the transcript.

Verification

  • bun run check passes (lint, typecheck, dead exports, build, 9452 tests)
  • New tests in approval-prompt-visibility.test.ts render a long run_shell approval at 80x24 and 100x30 and assert all three choices are drawn; both fail without the fix

Fixes CL-11362

@linear-code

linear-code Bot commented Oct 24, 2026

Copy link
Copy Markdown

CL-11362

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fleet review verdict: APPROVE (with nits)

PR: #1566 — fix(tui): keep every approval choice on screen under a tall body (CL-11362)

Convergence: swarm → defect / quality / solve convergence → all three converged approve (quality: approve with nits).

Outcome

Blocking defect confirmed fixed and regression-verified (pre-fix: Reject-only paint at 80x24 / 100x30; post-fix: all choices painted; new tests fail pre-fix / pass post-fix).

Nits (non-blocking)

  • Stale doc comment in fitOverlayListToHost.
  • Operator-overlay coverage gap in new tests.
  • Verification gaps noted (check script does not run tests; no manual smoke).

Required changes

None blocking. Flagged for operator disposition.

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fleet review verdict: REQUEST CHANGES

PR: #1566 — fix(tui): keep every approval choice on screen under a tall body (CL-11362)

Operator disposition update: the prior "approve" posture is withdrawn; this PR is converted to REQUEST CHANGES.

Outcome

Blocking defect confirmed fixed and regression-verified (pre-fix: Reject-only paint at 80x24 / 100x30; post-fix: all choices painted; new tests fail pre-fix / pass post-fix).

Requested changes

  • N1 (nit): stale doc comment in fitOverlayListToHost.
  • N2 (nit): operator-overlay coverage gap in new tests.
  • N3 (nit): verification gaps (check script does not run tests; no manual smoke).

Required changes to merge

Address the requested changes above (or explicitly close each) before merge.

Why it matters

Non-blocking items remain; operator opted for a stricter review posture.

@bwachman
bwachman force-pushed the cl-11362-long-approval-prompts-hide-accept-once-leaving-only-reject branch from ea0b3ce to 285642e Compare October 24, 2026 20:49
@bwachman

Copy link
Copy Markdown
Contributor Author

Stale doc comment on fitOverlayListToHost: Fixed. The comment now says context is dropped before choices. A decision overlay keeps every choice on screen, any other overlay keeps one, and a host too short to hold every choice still keeps at least one.

Operator overlay coverage: Fixed. src/tui/approval-prompt-visibility.test.ts now has an operator (ask) case next to the permission case, at 80x24 and 100x30. It emits an operator.gate through wireGates with a 31-line question and four choices, then asserts that every choice label is painted. When I temporarily put back the old one-choice reservation, both sizes fail: only the first choice is painted and "Use the release branch" is missing.

Check script and smoke test: bun run check does run the full test suite. Its last step is check:projects-dir-guard (scripts/guard-real-projects-dir.ts), which calls bun run test and fails the gate if any test fails. On this branch it passed 9454 tests with 0 failures and exited 0. Manual render: the fix was also rendered in the test renderer with the real 31-line command from the session that hit this, at 80x24, 100x30 and 120x40: before the fix only Reject was drawn at the first two sizes, and after it all three choices are drawn at every size, with the first lines of the command still visible above them.

@bwachman

Copy link
Copy Markdown
Contributor Author

Resolved findings at 285642e6, with line citations

Finding Status Where
N1: stale doc comment on fitOverlayListToHost Resolved The doc comment (src/tui/shell/chrome.ts:833-835) now matches the choiceWant logic (:844-851).
N2: operator-overlay coverage gap Resolved New operator.gate case with a tall question and four caller-supplied choices, asserting every choice is painted (src/tui/approval-prompt-visibility.test.ts:255-286).
N3: check does not run tests Resolved (premise corrected) check ends in check:projects-dir-guard (package.json:41, :39), which runs the full bun run test (scripts/guard-real-projects-dir.ts:51-54, package.json:35).

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed at 285642e. Every approval choice stays on screen under a tall body, and the operator-overlay coverage is in place. Approving.

@corbits-triage

Copy link
Copy Markdown
Contributor

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

@TheGreatAxios
TheGreatAxios merged commit c3a8cb6 into main Oct 25, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants