Repository navigation
Action controls: one renderer for footer actions (first slice of #336) - #369
Draft
raiseCatError wants to merge 2 commits into
Draft
raiseCatError wants to merge 2 commits into
raiseCatError wants to merge 2 commits into
Conversation
…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).
4 of 21 tasks
… 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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./worktreesconfirmation (removal is the destructive control; Enter and Esc stay visible).Fixes in 85ab930 (found while validating narrow layouts):
+Nstill printed its reason line, explaining a control that was not drawn; reasons now follow drawn controls (describeActionsstill lists the folded one).>…<(no letter); it now keeps the label's first letter (>C<).Verification:
tests/actionControls.test.ts,tests/worktreeView.test.tspass; 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.