Skip to content

Fix the command palette's overflow, width, chrome, and selection colour - #360

Merged
TheGreatAxios merged 4 commits into
mainfrom
cl-5581-palette-pass
Aug 7, 2026
Merged

Fix the command palette's overflow, width, chrome, and selection colour#360
TheGreatAxios merged 4 commits into
mainfrom
cl-5581-palette-pass

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Overlay geometry now guarantees a list overlay's border/title/filter rows fit within the rows it's assigned, collapsing other chrome (even past the transcript floor) before starving it — the ~30-command palette no longer paints past its box or pushes the prompt off screen on short terminals.
  • The floating palette host takes its left inset and width from the same layout.sideMargin / layout.contentWidth the prompt box resolves through, so the two boxes share one width and align on both edges.
  • The palette drops its per-row category column and its title rule row; rows reflow into the reclaimed width and the shortcut column still lines up.
  • Palette row selection is marked by upgrading the label to full-emphasis text instead of a filled grey background, matching how every other list overlay already marks its active row.

Verification

  • bun run typecheck, bun run build, and bun run test (bun test ./src ./tests ./evals) all pass: 3969 pass, 0 fail.
  • Added failing-first regression tests: geometry.test.ts (overlay height never exceeds terminal rows across 4–12 row terminals with a 48-row overlay request; overlay honors an explicit minBodyRows), palette-paint.test.ts (shared box edges while floating, no title rule, no marker/category column, selection reads via fg not bg).
  • Captured frames at 80×24, 80×12, and 80×6 with ~44 palette entries confirm: the box and its rows stay within the terminal at every height (including one row of content fitting at 6 rows), the palette and prompt box share identical left/right border columns, and rows show no leading marker, no kind column, and no title rule — only the label and right-aligned shortcut.

Closes CL-5581
Closes CL-5582
Closes CL-5583
Closes CL-5584

@linear-code

linear-code Bot commented Aug 7, 2026

Copy link
Copy Markdown

CL-5581

CL-5582

CL-5583

CL-5584

A list overlay's border, title, and filter rows are unavoidable, but
the geometry resolver could still hand it fewer rows than that when
the transcript floor and prompt claimed the rest first. With ~30
palette commands on a short terminal, this squeezed the overlay host
below its own render minimum: the box painted more rows than it was
assigned, spilling into and past the prompt box below it.

The resolver now treats an open overlay's chrome as a second floor
alongside the transcript's, collapsing other chrome further (down to
relaxing the transcript floor) before it will starve the overlay below
what its own border and first content row need. Callers report that
minimum explicitly rather than the resolver guessing it from an
opaque row count.
The palette host floats with absolute left/right insets over the
landing screen, which escape root's padding — so it spanned the full
terminal width while the prompt box below it, sized in normal flow,
stayed inset by the shared side margin. The two stacked boxes visibly
misaligned on both edges.

The float now takes its left inset and width from the same
layout.sideMargin / layout.contentWidth the prompt box already
resolves through, rather than assuming the padding edge sits at column
zero.
Two pieces of palette chrome duplicated information already on
screen: a per-row category column (command/config/session/...) when
the command name already says what it is, and a title rule
(- command palette -) repeating what the box border and filter row
already establish. Both are gone; rows reflow into the reclaimed
width so descriptions truncate later, and the shortcut column still
lines up.

Every other list overlay keeps its title rule — only the palette,
which is unambiguous from context and reads its own filter query as a
second header, drops it.
The active row painted a filled grey background across its full
width, the one list overlay in the shell that did — every other
picker already marks its active row by upgrading the text colour and
nothing else. Selection now works the same way here: the active
label goes full-emphasis text, the rest stay dimmed, and the cursor
reads unmistakably while arrowing through the list without a
background fill competing with the accent colours already in the
box.
@TheGreatAxios
TheGreatAxios merged commit f73e1da into main Aug 7, 2026
2 checks passed
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