Skip to content

feat(client): one source for the footer links, and dialog buttons on the type ramp (UI/UX v3 P4c) - #96

Merged
mizu-jun merged 1 commit into
masterfrom
p4c-footer-and-dialog-runs
Aug 29, 2026
Merged

feat(client): one source for the footer links, and dialog buttons on the type ramp (UI/UX v3 P4c)#96
mizu-jun merged 1 commit into
masterfrom
p4c-footer-and-dialog-runs

Conversation

@mizu-jun

Copy link
Copy Markdown
Owner

What this closes

The P4 design spec's §8 deferred two surfaces — the settings footer's ↗ Open config.toml / ↺ Reset category links and the dialog button labels — and gave one reason for both: "they are sized from their label widths and those widths reach click targets, so they need hit-region work."

Measuring first shows that reason holds for one of them.

The footer links — the real hit-region work

Their geometry existed twice, label formatting included:

  • overlay/settings/mod.rs:708,734visual_width(&label) as f32 * cell_w
  • event_handler/settings_panel_hit.rs:145,155 — a copy of the same expression

A proportional label's width is not a multiple of cell_w, so moving these to the P4b ramp with the formula mirrored would have drifted the click target away from the glyphs silently.

New overlay/settings/footer.rs owns the labels, the ramp step, the measurement and the rects. footer_links is the single call the builder draws from and the hit-test tests against; the pure place_links underneath takes measured widths, the shape place_tooltip established in P4b. hit_test_settings_panel becomes &mut self so it measures through the same FontManager — one cached run per mouse event over an open panel.

The dialog buttons — the premise was wrong

mouse.rs never references pending_consent or close_window_dialog. Both dialogs are driven by the keyboard (input_handler/mod.rs:46,58) and by AccessKit (accessibility.rs:213,224 write selected / selected_button). A button label's width reaches its own box and nothing else.

So this half is plain typography: box widths come from measure_run at the ramp's Body step, padding (1.5 / 3 cells) and gaps (0.5 / 0.8) unchanged, labels centred from the measured run. One fix falls out — the row reserved n gaps instead of n - 1, leaving it half a gap off centre.

Gates

  • Structural: neither the builder nor the hit-test may reconstruct a footer label or call footer_links more than once, and no dialog button may be sized from visual_width again.
  • Placement: right-alignment, the inter-link gap, non-overlap, equal padding, a fractional (non-cell) width carried through unrounded, and no phantom reset rect for a non-resettable category — all pure, no device.
  • The now-stale #[allow(dead_code)] markers on measure_run / truncate_run_to_width / add_run_verts are removed with their last non-adopting caller.

Verification

  • cargo fmt --check — clean
  • cargo clippy --workspace --all-targets -- -D warnings — no warnings
  • cargo test --workspace — 28 suites pass, 7 new tests
  • Not covered: appearance. The links and both dialogs' button rows change size on screen; this joins the P4/P5/P6 on-device backlog.

Noted, deliberately not fixed

The footer links have no AccessKit node at allaccessibility.rs never mentions them, so a screen-reader user cannot reach "Open config.toml" or "Reset category". That is a P6c-shaped accessibility gap rather than a P4 typography one and belongs in its own change; it is recorded in the spec's new §8.1.

🤖 Generated with Claude Code

…the ramp (UI/UX v3 P4c)

P4b left two surfaces on the cell path and the spec's §8 gave one reason for
both. Measuring first shows the reason holds for one of them.

The footer links were the real hit-region work. Their geometry existed twice —
`visual_width * cell_w` in the builder and a copy of the same expression, label
formatting included, in `settings_panel_hit.rs`. A proportional label's width
is not a multiple of `cell_w`, so moving them to the ramp with the formula
mirrored would have drifted the click target away from the glyphs silently.
`overlay/settings/footer.rs` now owns the labels, the ramp step, the
measurement and the rects: `footer_links` is the single call the builder draws
from and the hit-test tests against, with a pure `place_links` underneath in
the shape `place_tooltip` established. `hit_test_settings_panel` takes `&mut
self` so it measures through the same `FontManager` — one cached run per mouse
event over an open panel.

The dialog buttons did not need it. §8 claims their widths reach click targets;
`mouse.rs` never mentions `pending_consent` or `close_window_dialog`, and both
dialogs are driven by the keyboard and by AccessKit. A label's width reaches
its own box and nothing else, so this is plain typography: box widths come from
`measure_run`, padding and gaps unchanged, labels centred from the measured
run. The row now reserves `n - 1` gaps instead of `n`, which had left it half a
gap off centre.

Gate: a structural test asserts neither file reconstructs a footer label or
calls `footer_links` twice, and that no dialog button is sized from
`visual_width` again. The now-stale `#![allow(dead_code)]` markers on
`measure_run` / `truncate_run_to_width` / `add_run_verts` are removed with
their last non-adopting caller.

Observed while measuring and deliberately not fixed here: the footer links have
no AccessKit node at all, so a screen reader cannot reach either of them. That
is a P6c-shaped accessibility gap, not a typography one.

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 a77397f into master Aug 29, 2026
13 checks passed
@mizu-jun
mizu-jun deleted the p4c-footer-and-dialog-runs branch August 29, 2026 14:27
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