Skip to content

Add nav tooltips on desktop + settings toggle (#155)#156

Merged
ChristopherRotnes merged 3 commits intomasterfrom
claude/improve-menu-clarity-QCI1N
May 10, 2026
Merged

Add nav tooltips on desktop + settings toggle (#155)#156
ChristopherRotnes merged 3 commits intomasterfrom
claude/improve-menu-clarity-QCI1N

Conversation

@ChristopherRotnes
Copy link
Copy Markdown
Owner

@ChristopherRotnes ChristopherRotnes commented May 10, 2026

$(cat <<'EOF'

Summary

  • Carbon Tooltip on desktop — each nav icon (Camera, RecentlyViewed, Analytics, EventSchedule, Book, Settings) is now wrapped in a Carbon Tooltip align="bottom" on desktop (>500 px). Hovering or focusing any icon shows the full translated label from the existing nav.* i18n keys. Mobile layout is pixel-identical to before.
  • NavBtnforwardRef — required so Carbon Tooltip can inject its event handlers and positioning ref via React.cloneElement. Props are spread with {...rest} before explicit overrides so our aria-label, onClick, and style always win.
  • useNavHints() hook — exported from PageShell.jsx. Reads/writes localStorage key wl-nav-hints (default true). Syncs across all hook instances in the same tab via a wl-nav-hints-change custom event, so toggling in Settings immediately hides tooltips in the nav bar without a page reload.
  • Settings → Utseende — new Carbon Toggle "Vis navigasjonsforklaringer" wired to useNavHints().
  • i18nsettings.navHints added to nb, en, fa locale files.

Test plan

  • On desktop: hover each nav icon — Carbon tooltip appears with the correct label
  • On mobile (≤500 px DevTools emulation): no layout change vs. main
  • Settings → Utseende: toggle "Vis navigasjonsforklaringer" off — tooltips disappear immediately
  • Reload page — toggle preference persists (tooltips still hidden)
  • Switch locale to English and Persian — tooltip text changes correctly
  • npm test — all 82 tests pass

Closes #155

https://claude.ai/code/session_015LGACMKdTtRyAMCXnbUgrZ
EOF
)


Generated by Claude Code

- NavBtn converted to forwardRef so Carbon Tooltip can inject its event
  handlers and positioning ref
- Carbon Tooltip wraps each nav icon on desktop (>500 px), showing the
  translated nav.* label on hover/focus; mobile layout unchanged
- NavTooltip helper component (outside PageShell) conditionally renders
  the wrapper to avoid re-mounting on every render
- useNavHints() hook exported from PageShell.jsx: reads/writes
  wl-nav-hints in localStorage (default true), syncs across all hook
  instances in the same tab via a wl-nav-hints-change custom event
- Settings → Utseende: new Carbon Toggle "Vis navigasjonsforklaringer"
  wired to useNavHints(); change takes effect immediately
- i18n: settings.navHints added to nb, en, fa locale files
- Docs: CHANGELOG 1.2.1, CLAUDE.md, README.md updated

https://claude.ai/code/session_015LGACMKdTtRyAMCXnbUgrZ
@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-island-090dfd003-156.westeurope.7.azurestaticapps.net

@ChristopherRotnes ChristopherRotnes marked this pull request as ready for review May 10, 2026 07:53
Reduce tooltip transition duration from Carbon's default (200-300ms) to 100ms to avoid overlapping text when tooltips fade out. Uses !important to override Carbon's built-in transition timing.

https://claude.ai/code/session_015LGACMKdTtRyAMCXnbUgrZ
@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-island-090dfd003-156.westeurope.7.azurestaticapps.net

Replace Carbon Tooltip wrapper with a CSS ::after pseudo-element on
NavBtn. CSS :hover is mutually exclusive — hovering a new button
immediately ends the previous button's hover state, so only one tooltip
is ever visible at a time. Removes the dependency on Carbon Tooltip's
internal fade timing entirely.

- Drop Tooltip import from @carbon/react and NavTooltip wrapper component
- Add optional tooltip prop to NavBtn; set data-tooltip attribute when
  truthy (undefined when hints disabled or on mobile, so attribute is
  not rendered)
- Simplify nav render loop: tt(key) helper returns translated label or
  undefined based on showTooltip state
- app.css: replace broken .bx--tooltip rule (Carbon v10 class, no-op in
  v11) with [data-tooltip]::after CSS tooltip; 120ms fade-in,
  instant close on mouse-leave, prefers-reduced-motion safe

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-island-090dfd003-156.westeurope.7.azurestaticapps.net

@ChristopherRotnes ChristopherRotnes merged commit b9c9eec into master May 10, 2026
4 checks passed
@ChristopherRotnes ChristopherRotnes deleted the claude/improve-menu-clarity-QCI1N branch May 10, 2026 08:12
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.

As a user I want the navigation icons to show labels on hover so I can find features without guessing

2 participants