Add tooltips with keyboard shortcuts to topbar buttons#231
Conversation
Add tooltips to the settings and sidebar toggle buttons in the topbar, displaying the action name alongside the keyboard shortcut using styled Kbd components. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThe PR adds tooltip UI components with keyboard shortcut displays to two TopBar buttons. Settings button tooltips show the hotkey to open settings, and sidebar toggle button tooltips display the keyboard shortcut for toggling the sidebar sidebar, using shared hotkey configuration and formatting utilities. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ 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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/desktop/src/renderer/screens/main/components/TopBar/SidebarControl.tsx (1)
2-39: Tooltip + hotkey display for sidebar looks solidUsing
HOTKEYS.TOGGLE_SIDEBAR.keyswithformatKeysForDisplaymatches the control’s behavior and label, and wrapping the existingButtonwithTooltipTrigger asChildkeeps semantics intact. Looks good; if more topbar buttons gain the same pattern, consider a tiny shared “IconButtonWithHotkeyTooltip” helper later to avoid repetition.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/desktop/src/renderer/screens/main/components/TopBar/SettingsButton/SettingsButton.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/TopBar/SidebarControl.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
apps/desktop/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
For Electron interprocess communication, ALWAYS use tRPC as defined in
src/lib/trpc
Files:
apps/desktop/src/renderer/screens/main/components/TopBar/SettingsButton/SettingsButton.tsxapps/desktop/src/renderer/screens/main/components/TopBar/SidebarControl.tsx
apps/desktop/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
apps/desktop/**/*.{ts,tsx}: Please use alias as defined intsconfig.jsonwhen possible
Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary
Files:
apps/desktop/src/renderer/screens/main/components/TopBar/SettingsButton/SettingsButton.tsxapps/desktop/src/renderer/screens/main/components/TopBar/SidebarControl.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Avoid usinganytype - use explicit types instead for type safety
Use camelCase for variable and function names following existing codebase patterns
Keep diffs minimal with targeted edits only - avoid unnecessary changes when making modifications
Follow existing patterns and match the codebase style when writing new code
Files:
apps/desktop/src/renderer/screens/main/components/TopBar/SettingsButton/SettingsButton.tsxapps/desktop/src/renderer/screens/main/components/TopBar/SidebarControl.tsx
**/components/**/*.tsx
📄 CodeRabbit inference engine (AGENTS.md)
**/components/**/*.tsx: Create one folder per component with structure:ComponentName/ComponentName.tsx+index.tsfor barrel export
Co-locate tests next to the component file they test (e.g.,ComponentName.test.tsx)
Co-locate dependencies (utils, hooks, constants, config, stories) next to the file using them
Use nestedcomponents/subdirectory within a parent component only if a sub-component is used 2+ times within that parent; otherwise keep it in the parent'scomponents/folder
One component per file - avoid multi-component files
Files:
apps/desktop/src/renderer/screens/main/components/TopBar/SettingsButton/SettingsButton.tsxapps/desktop/src/renderer/screens/main/components/TopBar/SidebarControl.tsx
apps/desktop/src/renderer/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Never import Node.js modules (fs, path, os, net, etc.) in renderer process code - browser environment only
Files:
apps/desktop/src/renderer/screens/main/components/TopBar/SettingsButton/SettingsButton.tsxapps/desktop/src/renderer/screens/main/components/TopBar/SidebarControl.tsx
apps/desktop/src/renderer/**/*.tsx
📄 CodeRabbit inference engine (AGENTS.md)
Call IPC methods using
window.ipcRenderer.invoke()with object parameters - TypeScript will infer the exact response type automatically
Files:
apps/desktop/src/renderer/screens/main/components/TopBar/SettingsButton/SettingsButton.tsxapps/desktop/src/renderer/screens/main/components/TopBar/SidebarControl.tsx
🧬 Code graph analysis (2)
apps/desktop/src/renderer/screens/main/components/TopBar/SettingsButton/SettingsButton.tsx (4)
apps/desktop/src/renderer/stores/app-state.ts (1)
useOpenSettings(61-61)apps/desktop/src/shared/hotkeys.ts (2)
formatKeysForDisplay(185-208)HOTKEYS(28-156)packages/ui/src/components/tooltip.tsx (3)
Tooltip(74-74)TooltipTrigger(74-74)TooltipContent(74-74)packages/ui/src/components/kbd.tsx (2)
KbdGroup(28-28)Kbd(28-28)
apps/desktop/src/renderer/screens/main/components/TopBar/SidebarControl.tsx (2)
apps/desktop/src/renderer/stores/sidebar-state.ts (1)
useSidebarStore(17-37)apps/desktop/src/shared/hotkeys.ts (1)
formatKeysForDisplay(185-208)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build
🔇 Additional comments (1)
apps/desktop/src/renderer/screens/main/components/TopBar/SettingsButton/SettingsButton.tsx (1)
1-33: Verify the HOTKEYS entry used for the Settings tooltipThe tooltip label says “Settings”, but the shortcut source is
HOTKEYS.SHOW_HOTKEYS.keys. The name suggests a “show hotkeys” action rather than “open settings”, so this may surface the wrong shortcut in the UI. Please double-check that this is the intended entry (and switch to a settings‑specific hotkey if one exists).
Add tooltips to the settings and sidebar toggle buttons in the topbar, displaying the action name alongside the keyboard shortcut using styled Kbd components.
🤖 Generated with Claude Code
Description
Related Issues
Type of Change
Testing
Screenshots (if applicable)
Additional Notes
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.