Skip to content

feat(client): the three list pickers adopt the chrome type ramp (UI/UX v3 P4e) - #98

Merged
mizu-jun merged 1 commit into
masterfrom
p4e-picker-ramp
Aug 29, 2026
Merged

feat(client): the three list pickers adopt the chrome type ramp (UI/UX v3 P4e)#98
mizu-jun merged 1 commit into
masterfrom
p4e-picker-ramp

Conversation

@mizu-jun

Copy link
Copy Markdown
Owner

What was deferred, and what measuring found

P4b's §5.2 left the command palette, host manager and macro picker on the cell path as "safe in principle, deferred to keep the diff reviewable". One of them was not safe:

Both list pickers aligned their columns with {:<20} / {:<22} — a count of characters. That lines up only because the chrome borrows the terminal's monospace font, which is precisely the assumption the ramp removes. It was already broken before this PR for any name past the pad width and for CJK names, whose cells are twice as wide.

name_column_width replaces it: the widest measured name plus a gap, clamped so the detail column keeps a floor. A long name shortens nothing but its own column.

Two more defects this closes

  • Nothing truncated. A long palette action or host name simply drew past the panel edge. Every row now goes through draw_picker_run, which truncates and draws from one measurement — the pickers' equivalent of the widget layer's draw_row_run.
  • The selection marker was part of the label. "> " and " " are the same width only in a monospace font, so a prefixed marker would have shifted every selected row's text sideways once rows drew proportionally. It is its own run now, and selected/unselected labels start at the same x.

No hit-region work

Same finding as the dialog buttons in #96: none of the three pickers is mouse-hit-tested at all — mouse.rs never mentions palette, host_manager or macro_picker. They are keyboard- and AccessKit-driven. Panel sizes and row pitch stay in cells, so nothing moves.

Gates

  • name_column_width is pure and tested: widest-plus-gap, the long-name clamp (a 10 000 px name cannot starve the detail column), and never negative on a degenerate panel.
  • A structural test asserts no picker row goes back to a character pad spec — with comments and the test module stripped first, since they quote the old spec.

Verification

  • cargo fmt --check — clean
  • cargo clippy --workspace --all-targets -- -D warnings — no warnings
  • cargo test --workspace — 28 suites pass, 4 new tests
  • Not covered: appearance. All three panels change text size and column alignment on screen; this joins the P4/P5/P6 on-device backlog.

Observed, deliberately not fixed

The host manager and macro picker draw their row fills and every text colour from hard-coded literals ([0.35, 0.15, 0.50, 1.0] and friends) — G11 residue the token migration missed. Those rows do not answer to the colour scheme and were never contrast-corrected in P5. Changing hue and type size in the same PR would make a visual regression impossible to attribute, so it wants its own change, sized as a G11/P5 follow-up.

Still deferred after this: the status bar (cell-aligned by design — the Lua status format is column-oriented), tab-bar labels (N-3), the SFTP file-transfer dialog (cell-derived field geometry), the context menu, and the hand-written parts of ssh_tab.rs / keybindings_tab.rs.

🤖 Generated with Claude Code

…X v3 P4e)

P4b deferred the command palette, host manager and macro picker as "safe in
principle, deferred to keep the diff reviewable". Measuring them found one
thing that was not safe.

Both list pickers aligned their two columns with `{:<20}` / `{:<22}` — a count
of characters, which lines up only because the chrome borrows the terminal's
monospace font. That is the assumption the ramp removes, and it was already
broken for any name past the pad width and for CJK names. `name_column_width`
replaces it: the widest measured name plus a gap, clamped so the detail column
keeps a floor, so a long name shortens nothing but its own column.

Two more defects the migration closes:

- None of the three truncated, so a long palette action or host name drew past
  the panel edge. Every row now goes through `draw_picker_run`, which
  truncates and draws from one measurement — the pickers' `draw_row_run`.
- The selection marker moved out of the label. `"> "` and `"  "` are the same
  width only in a monospace font, so a prefixed marker would have shifted every
  selected row's text sideways; it is its own run now and both states start
  their label at the same x.

No hit-region work, for the same reason the dialog buttons needed none: none of
the three pickers is mouse-hit-tested at all — `mouse.rs` does not mention
`palette`, `host_manager` or `macro_picker`. Panel sizes and row pitch stay in
cells, so nothing moves.

Observed and deliberately not fixed: the host manager and macro picker draw
their row fills and every text colour from hard-coded literals — G11 residue
that the token migration missed, so those rows do not answer to the scheme and
were never contrast-corrected in P5. Changing hue and type size in one PR would
make a visual regression impossible to attribute; it wants its own change.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@github-actions

Copy link
Copy Markdown

Coverage report


Generated by cargo llvm-cov (workspace minus nexterm-client-gpu and nexterm-i18n).

@mizu-jun
mizu-jun merged commit a4812a2 into master Aug 29, 2026
13 checks passed
@mizu-jun
mizu-jun deleted the p4e-picker-ramp branch August 29, 2026 15:00
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