fix(ui): render tooltip shortcut hints as plain sans glyphs#955
Conversation
The shortcut suffix in icon tooltips (新建会话 ⇧⌘S etc.) rendered in --font-family-mono, whose fixed cell width crammed the modifier glyphs (⇧⌘) into one squished blob. This affected every TooltipKeybind site (titlebar, sidebar, composer, session tabs, right-panel review) because they all share [data-slot="tooltip-keybind-key"]. Switch that slot to the sans stack at 12/500 — the macOS-menu convention (plain glyphs, no keycap). A .kbd keycap was considered but rejected as too heavy for a tertiary hover hint; the keycap stays for dense scannable surfaces (popover, command palette item-tail). Add e2e/snap/keybind-tooltip: asserts the suffix uses the sans stack (never mono) and renders the light/dark grid for visual review. Verified red (mono) -> green (sans) on the real renderer.
|
Warning Review limit reached
More reviews will be available in 19 minutes and 6 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request changes the keybind tooltip font family from monospace to sans-serif to prevent modifier glyphs from being squished together. It also introduces a Playwright E2E test to verify this font family constraint and capture visual regression snapshots in both light and dark modes. The reviewer recommends using a semantic design system variable (--font-weight-emphasis) instead of a hardcoded font-weight value in tooltip.css to maintain UI consistency.
The chrome ships bilingual; the keybind suffix font is the regression we guard, but the grid only showed the zh label. Render zh + en tooltips stacked (light + dark) and assert the sans-not-mono lock on every suffix, not just the first.
Perf delta summaryComparator: pass
|
Address review: the tooltip container two rules below already uses var(--font-weight-emphasis) (= 500); the keybind suffix should reuse the same semantic token instead of a hardcoded 500.
…ystem 12px sans has no 12px size token (theme.css: 12px is mono-only); the smallest sans is 13px. Use the tooltip's own 13px sans at caption weight (400) — one step lighter than the label's 500 emphasis, so the shortcut reads as secondary. Express only the two intentional properties (sans-not-mono + caption weight); size/line-height/color inherit the tooltip container.
The no-dead-tokens guardrail scans all of packages/ (comments included) for retired typography custom properties. The keybind comment named the old keycap token to explain the anti-mono choice; reword without it.
Bump PawWork desktop release version to 2026.5.28. Changes since v2026.5.27: - feat(ui): fold reasoning into trow block (#948) - feat: align outbound HTTP headers with canonical OpenCode desktop (#940) - feat(app): collapse notification settings to single tri-state control (#938) - fix(ui): track List header surface via --list-surface (#954) - fix(ui): render tooltip shortcut hints as plain sans glyphs (#955) - fix(watcher): isolate macOS workspace roots - fix(session): terminalize stale question blockers - fix(session): unify transport error classification for stream disconnect recovery (#941) - test: add route inventory guardrails - ci: repair electron desktop build + install
Summary
Tooltip shortcut hints (e.g.
新建会话 ⇧⌘S) rendered the shortcut suffix in--font-family-mono. The monospace cell width crammed the modifier glyphs (⇧⌘) into one squished blob. Switch[data-slot="tooltip-keybind-key"]to the sans stack at 12/500 — the macOS-menu convention (plain glyphs, no keycap). One CSS rule fixes everyTooltipKeybindsite (titlebar, sidebar, composer, session tabs, right-panel review) since they all share the slot.No linked issue — reported directly from a screenshot of the titlebar tooltip.
Why
The squish came from forcing a monospace font on the suffix, not from missing spacing or a missing keycap. macOS native menus render shortcuts as bare sans glyphs with no box; that is the user's muscle memory and the lightest treatment for a tertiary hover hint. A
.kbdkeycap was considered (it is the existing design spec) but rejected here as too heavy for a hover hint; the keycap stays for dense scannable surfaces (popover, command palette item-tail). Decision made against real side-by-side variants in the inverse tooltip surface.Related Issue
None.
Human Review Status
Pending
Review Focus
[data-slot="tooltip-keybind-key"](mono → sans, 12/500). This is the whole behavior change..kbdkeycap box on purpose (separate surface, separate design rule) — see Risk Notes for the deferred consistency question.Risk Notes
platform.*/window.apibranch.system-uiresolves to SF on macOS and Segoe on Windows; both render the glyphs cleanly. (macOS/Windows checklist item left unticked for that reason.)docs/DESIGN.mdTooltip + Kbd sections updated to match (plain sans glyphs, keycap reserved for scannable surfaces).docs/is local-only in this repo, so it is not part of this diff..kbdkeycap boxes. Whether to also drop those to plain glyphs is a separate design decision and was not part of the approved scope.How To Verify
Screenshots or Recordings
Checklist
bug.ui.P3.Pending.dev, and my PR title and commit messages use Conventional Commits in English.