Skip to content

Action controls: one renderer for footer actions (first slice of #336) - #369

Draft
raiseCatError wants to merge 2 commits into
release/v0.18.0from
feature/action-controls
Draft

raiseCatError wants to merge 2 commits into
release/v0.18.0from
feature/action-controls

Conversation

@raiseCatError

@raiseCatError raiseCatError commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

First slice of #336: a shared renderer for footer/context actions, plus one surface using it. Based on #345.

  • src/ui/actionControls.ts: semantic controls ({id, label, state}); states default, focused, selected, disabled, destructive, destructiveFocused are told apart by marks, not color ([ Apply ], [>Apply<], [x Apply ], [- Apply ], [! Apply ], [>!Apply<] in Safe); styles outline/filled/soft/plain and square/rounded geometry are independent; disabled controls list their reason and are not drawn without one; narrow windows keep essential controls and fold the rest into +N; labels are sanitized; regions let the pointer invoke the same semantic action as the key.
  • Adopted by the /worktrees confirmation (removal is the destructive control; Enter and Esc stay visible).

Fixes in 85ab930 (found while validating narrow layouts):

  • A disabled control's reason line could overflow the width (55 cells at 30/16/8 columns): the label now yields first, then the line is cut.
  • A control folded into +N still printed its reason line, explaining a control that was not drawn; reasons now follow drawn controls (describeActions still lists the folded one).
  • The tightest layout drew >…< (no letter); it now keeps the label's first letter (>C<).

Verification: tests/actionControls.test.ts, tests/worktreeView.test.ts pass; full local verify 2117/2119 (Fish type-ahead #356 and a live fuzzy-capture test, both passing in isolation); CI green at 85ab930 (Ubuntu and macOS shards, Node 22, Quality, Verify).

Not in this PR (still open under #336): migrating other footers and the block Copy/Actions controls (workflow-track UI; left alone during its stabilization), a user setting for style/geometry, and physical NO_COLOR/Safe/narrow QA in a real terminal.

…t differ without color

Controls are semantic ({id, label, state}); the renderer draws only what its caller says is available, explains a disabled one, folds non-essential controls into a count on narrow windows, and returns regions so the pointer reaches the same action as the key. States, styles (outline, filled, soft, plain) and geometry (square, rounded) are independent; marks carry every state, so NO_COLOR and Safe/ASCII lose nothing. The worktree confirmation uses it (removal is the destructive control).
… with its control

- The reason line is measured: the label yields first (down to half the
  width), then the whole line is cut, so narrow windows never overflow.
- A reason is listed only for a disabled control that is drawn; a control
  folded into "+N" is explained by describeActions, not an orphan line.
- The tightest layout keeps the label's first letter (">C<") instead of an
  ellipsis that names nothing.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant