feat: allow clicking keyboard hints throughout #266
Reference in New Issue
Block a user
Delete Branch "worktree-harmonic-purring-fox"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #186
Summary by CodeRabbit
New Features
Style
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID:
e0523d50-f395-4995-bba9-b64c341a2f72📥 Commits
Reviewing files that changed from the base of the PR and between
dd850d28d1and1cf144bce3.📒 Files selected for processing (2)
js/desktop/src/features/particles/stream-view.tsxjs/desktop/src/hooks/use-stream-navigation-keys.ts📝 Walkthrough
Walkthrough
Adds Kbd primitives and a reusable KeyHint component, then replaces inline hint markup across overlays, compose flows, stream view, and other UI with KeyHint instances that optionally handle clicks and preserve focus.
Changes
KeyHint Foundation and Keyboard Shortcut Consolidation
js/desktop/src/components/ui/kbd.tsx,js/desktop/src/components/key-hint.tsxKbdandKbdGroupprimitives andKeyHintcomponent render key chips, supportprefix/separator/children, and render as a non-interactivespanor clickablebuttonwith focus-preservingonMouseDownhandling.js/desktop/src/components/confirm-destructive-overlay.tsx,js/desktop/src/components/keybindings-overlay.tsx,js/desktop/src/features/particles/rename-stream-overlay.tsx,js/desktop/src/features/particles/stream-members-overlay.tsx<kbd>close/navigation hints withKeyHintelements wired toonCloseor equivalent handlers and updated title/aria text.js/desktop/src/features/compose/text-editor.tsx,js/desktop/src/features/compose/recording-overlay.tsx,js/desktop/src/features/compose/compose-overlay.tsx,js/desktop/src/features/compose/configure-stream-step.tsxKeyHintfor Esc, Enter, Meta+Enter, Meta+M, and other hints, preserving conditional rendering and existing click/keyboard handlers.js/desktop/src/components/video-audio-toggle.tsx,js/desktop/src/features/attachments/attachment-lightbox.tsx,js/desktop/src/components/keybindings-overlay.tsx,js/desktop/src/features/network-root.tsx<kbd>/button markup toKeyHint, delegating click behavior to existing handlers and adding title/aria attributes where applicable.js/desktop/src/features/particles/stream-view.tsx,js/desktop/src/hooks/use-stream-navigation-keys.tsStreamViewControlsrefactored to useKeyHintfor in-stream actions and receivesonOpenHuddleandonExitcallbacks;useStreamNavigationKeysnow acceptsonExitand calls it on Escape.🎯 3 (Moderate) | ⏱️ ~22 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
#186by implementing clickable keyboard shortcut hints via the new KeyHint component, allowing mouse-click alternatives throughout the UI.✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
📝 Generate docstrings
🧪 Generate unit tests (beta)
worktree-harmonic-purring-foxComment
@coderabbitai helpto get the list of available commands and usage tips.Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID:
390544c3-d236-4d15-982a-436bf62b136b📥 Commits
Reviewing files that changed from the base of the PR and between
9fd7e611f3and023e332e01.📒 Files selected for processing (14)
js/desktop/src/components/confirm-destructive-overlay.tsxjs/desktop/src/components/key-hint.tsxjs/desktop/src/components/keybindings-overlay.tsxjs/desktop/src/components/ui/kbd.tsxjs/desktop/src/components/video-audio-toggle.tsxjs/desktop/src/features/attachments/attachment-lightbox.tsxjs/desktop/src/features/compose/compose-overlay.tsxjs/desktop/src/features/compose/configure-stream-step.tsxjs/desktop/src/features/compose/recording-overlay.tsxjs/desktop/src/features/compose/text-editor.tsxjs/desktop/src/features/network-root.tsxjs/desktop/src/features/particles/rename-stream-overlay.tsxjs/desktop/src/features/particles/stream-members-overlay.tsxjs/desktop/src/features/particles/stream-view.tsx@@ -0,0 +46,4 @@<Fragment key={`${k}-${i}`}>{i > 0 && (separator != null ? <> {separator} </> : ' ')}<Kbd className={chipClass}>{k}</Kbd></Fragment>⚠️ Potential issue | 🟡 Minor
Prevent React key collisions for repeated labels in
KeyHint.<Fragment key={k}>uses the label as the React key; ifkeyListcontains duplicate labels (e.g."Shift"twice), reconciliation can be incorrect. Use a composite key with the index.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents
✅ Addressed in commit
dd850d2@@ -0,0 +20,4 @@className={cn('inline-flex items-center gap-1', className)}{...props}/>);⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 235
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 240
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 240
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 1101
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 174
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 128
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 174
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 128
Fix
KbdGroupelement/prop-type mismatchKbdGroupis typed asReact.ComponentProps<'div'>but renders a<kbd>, creating an API contract mismatch for consumers. Render a<div>(or change the props typing to'kbd'if<kbd>is intentional).Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents
⚠️ Potential issue | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 42
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 160
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 6669
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 512
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 9501
Fix “Esc / Back to network” navigation to go to the network root
KeyHintforEsccallsnavigate(-1)(js/desktop/src/features/particles/stream-view.tsx around 610-616), and theuseStreamNavigationKeysEscape handler also usesnavigate(-1)(js/desktop/src/hooks/use-stream-navigation-keys.ts around case'Escape').navigate(\/${networkId}`)(js/desktop/src/features/particles/stream-view.tsx around thehandleExitNavigate`).Escmay take the user to the wrong place.Change the Escape click/keyboard handler to
navigate(\/${networkId}`)` for consistency with the exit flow, or update the UI copy/title to match “history back”.🤖 Prompt for AI Agents
✅ Addressed in commit
1cf144b