-
Notifications
You must be signed in to change notification settings - Fork 615
fix windows shortcut for waveai focus #2655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request adds platform-specific keyboard shortcuts for focusing AI input. Windows users now use Alt+0 while non-Windows users use Ctrl+Shift+0. Changes include: updating a keyboard component to accept optional platform-specific override props (windows, mac, linux), modifying key binding logic to conditionally apply Windows shortcuts, updating UI text to display the correct shortcut based on platform detection, and updating documentation to reflect the Windows variant. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
docs/src/components/kbd.tsx (1)
47-60: Platform-specific overrides forKbdlook correct; consider a shared props type.The
windows/mac/linuxoverride selection logic matches thePlatformContextplatform values and cleanly falls back tokwhen no override is provided. This will correctly renderAlt:0on Windows while preserving existing behavior elsewhere. To avoid duplication, you could introduce aKbdPropstype and reuse it for bothKbdInternalandKbdinstead of repeating the inline{ k; windows?; mac?; linux? }shape.Also applies to: 72-73
frontend/app/store/keymodel.ts (1)
26-26: Windows-specific Alt+0 binding for Wave AI focus is correctly wired.Using
isWindows()to switch betweenAlt:c{Digit0}/Alt:c{Numpad0}on Windows and the existingCtrl:Shift:c{Digit0}/Ctrl:Shift:c{Numpad0}elsewhere keeps behavior consistent with the docs and UI while avoiding IME conflicts on Windows. If you want to de-duplicate slightly, you could factor a small helper likeconst focusWaveAIInput = () => { WaveAIModel.getInstance().focusInput(); return true; };and reuse it across the fourglobalKeyMap.setcalls.Also applies to: 610-628
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (4)
docs/docs/waveai.mdx(1 hunks)docs/src/components/kbd.tsx(2 hunks)frontend/app/aipanel/aipanel.tsx(2 hunks)frontend/app/store/keymodel.ts(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
frontend/app/aipanel/aipanel.tsx (1)
frontend/util/platformutil.ts (1)
isWindows(16-18)
docs/src/components/kbd.tsx (1)
docs/src/components/platformcontext.tsx (1)
PlatformContext(14-14)
⏰ 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). (3)
- GitHub Check: Analyze (go)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Build for TestDriver.ai
🔇 Additional comments (2)
docs/docs/waveai.mdx (1)
22-22: Docs shortcut now matches platform-specific behavior.Using
windows="Alt:0"here aligns the documentation with the new Windows keybinding while preservingCtrl:Shift:0elsewhere; looks good.frontend/app/aipanel/aipanel.tsx (1)
10-10: AI welcome message shortcut text now matches platform-specific bindings.Conditionally rendering
Alt + 0on Windows andCtrl + Shift + 0elsewhere keeps the in-panel instructions in sync with the new keybindings and the docs; this looks consistent across platforms.Also applies to: 138-151
ctrl-shift-0 doesn't work in windows (eaten by IME system). so need to switch to something else... chose Alt-0 for windows.