style: tooltips#1880
Merged
Merged
Conversation
5c43255 to
2368c5f
Compare
- e2e/week-view-switch: assert uppercased view shortcut hints (d/w -> D/W, "Dayd"/"Weekw" -> "DayD"/"WeekW") to match the per-key chip rendering. - MenuItem: render the bare button (no empty tooltip surface) when tooltipContent is omitted, honoring the documented "tooltip disabled" contract. - ShortcutKeys: return null for combos with no keys instead of an empty chip row; add focused tests for per-key split, uppercasing, the cmd alias, and the empty-combo guard. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the `combo: string` prop (parsed by splitting on "+") with an
explicit `keys: string[]`, and push the array to every boundary so the
"+" delimiter disappears rather than relocating:
- ShortcutKeys: `keys: string[]`; export `toKeyArray` (a lone string is
one key, never split) for the wrappers to reuse.
- Shortcut data type `k: string` -> `keys: string[]`; update getShortcuts
and the inline Shortcut[] builders in WeekView.
- Wrapper props (TooltipWrapper.shortcut, MenuItem.tooltipContent,
ShortcutTip.shortcut) accept `string | string[]` via toKeyArray;
ShortcutTip drops its join("+")/re-split round trip.
- Call sites: single-key hints stay strings ("?", "Delete"); multi-key
combos become arrays (["Mod","K"], ["Control","Meta","ArrowUp"]).
Tests updated for the new prop/data shapes. No behavior change — the
rendered keycap chips are identical.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Callers no longer need a helper or a single-element array: ShortcutKeys
takes `keys: string | string[]` and normalizes internally, so a one-key
hint is just `keys="?"` and a combo is `keys={["Mod", "K"]}`.
- toKeyArray is now private to ShortcutKeys (un-exported).
- TooltipWrapper / MenuItem / ShortcutTip pass their `string | string[]`
shortcut straight through — no toKeyArray call at the call site.
- SelectView passes `keys={option.key}` instead of `keys={[option.key]}`.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Redesigns the app's tooltips and keyboard-shortcut hints so they're consistent, legible, and well-layered. The work is split into three reviewable commits:
1. Tooltip surface —
style: tooltips(2368c5f)One shared tooltip look, smaller text, and a z-index fix.
c-tooltip@utility(index.css) promoted from the app's own (previously orphaned)menu-tooltiptokens: near-black surface, white text, subtle border + shadow.TooltipContentapplies it by default;TooltipWrapperandLifeDotTooltipnow share it (was a light beige pill vs a dark navy pill — two different looks).text-m(13px) →text-s(11px).gridMax + LAYER_3, which could land below the floating event form (21) / actions menu (22) / modal (24). NowMath.max(gridMax + LAYER_3, Z_INDEX_TOOLTIP)(new constant = modal + 1), so a tooltip always floats above those layers.useTransitionStyles(fade + 4px rise, the app'scubic-bezier(0.16, 1, 0.3, 1)curve).2. Keycap contrast & consistency —
style: standardize color contrast w/ shortcuts(e373ec8)c-keycap@utility— one high-contrast chip (border-border-primary+bg-panel-bg+ full-opacitytext-text-light, 11px). Replaces four divergent, low-contrast keycap styles (translucentbg-gray-700, gray-on-graybg-gray-400, a bespokeShortcutListoverride).SelectView) recolored for the dark-only UI: the light-beige selected row →text-accent-primaryover a cleanbg-white/10hover/active.3. Per-key shortcut chips —
feat: split keys in shortcut combos(c2ff868)Multi-key combos rendered as one chip with a literal
"+"(⌘ +k); now each key is its own chip ([⌘] [K]), withCmd/Modshown as the ⌘ icon.ShortcutKeyscomponent: splits a"+"-joined combo and renders onec-keycapper key (no"+"); uppercases single letters ([W]), resolvescmd/ctrlaliases, and renders ⌘/⌃/arrow icons via the existingShortCutLabel.shortcut.util.tsx: added arrow icons tokeyIconMap, madeMetaplatform-aware (⌘ on mac, Windows logo elsewhere), and let text keys inherit the chip's font size.MigrationShortcutHintand the now-deadgetModifierKeyIcon/getMetaKeyIconhelpers, and fold the undo/migration toasts' bespoke box onto the shared chip. TouchesShortcutList,SelectView,ShortcutTip,TooltipWrapper,MenuItem(+ Duplicate/Delete/Move/Migrate buttons),SaveSection,PlannerSidebarActions, and both toasts.Why
The tooltips were three different surfaces, oversized, sometimes hidden behind floating UI, and their shortcut chips were low-contrast and inconsistent (and combos were visually mushy). The fix centralizes everything into two shared Tailwind
@utilityrecipes (c-tooltip,c-keycap) plus oneShortcutKeyscomponent, so there's a single source of truth and the styles can't drift again.Notes for reviewers
text-*size utilities don't resolve inside@apply(they live under--font-size-*, not--text-*), soc-tooltip/c-keycapsetfont-size: var(--font-size-s)directly — mirroring the existingc-recurrence-togglepattern.ShortcutListnow asserts per-key chips (Shift+W),SelectViewkeys are uppercased (D/W), toasts assertZ+ the modifier icon,TooltipWrapper/SelectViewhighlight markers updated.Cmd+Dshortcut also firing the globaldview-nav) is a behavioral bug, intentionally left for a separate PR — this PR is styling-only.Verification
test:web✅ 1043 pass / 0 failtype-check✅ ·lint✅ (13 pre-existinga11ywarnings, none in touched files) ·build:web✅ (confirms the new phosphor arrow icons import cleanly and no Tailwind@applyregressions)Not covered
/lifetooltip was verified via computed styles. Worth a glance when logged in.test:backend/test:scriptsnot run — unrelated to this web styling change and require local config/env; they run in CI.🤖 Generated with Claude Code