-
Notifications
You must be signed in to change notification settings - Fork 343
ctrl-shift state fix + add new keybindings to docs #1792
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
Conversation
WalkthroughThe pull request introduces enhancements to keybindings and keyboard/mouse event handling across multiple files in the Wave application. Documentation for keybindings has been updated to include new keyboard shortcuts for terminal multi-input mode, finding text in webpages, and finding text in terminals. In the implementation, changes were made to track and manage the state of Control and Shift keys more effectively. A new These modifications aim to improve user interaction by providing more granular control over keyboard and mouse events, ensuring a more responsive and intuitive application interface. The changes are primarily focused on event handling and documentation updates. ✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 2
🧹 Nitpick comments (2)
emain/emain-util.ts (1)
37-41
: Consider optimizing the condition block.The condition block can be simplified by combining conditions.
- if (lastCtrlShiftSate) { - if (!waveEvent.control || !waveEvent.shift) { - setCtrlShift(sender, false); - } - } + if (lastCtrlShiftState && (!waveEvent.control || !waveEvent.shift)) { + setCtrlShift(sender, false); + }frontend/app/store/keymodel.ts (1)
29-33
: Add type annotations and documentation.The function would benefit from proper TypeScript types and documentation.
+/** + * Handles mouse down events by checking the ctrl+shift state. + * If either key is not pressed, it resets the control shift state. + * @param e - The mouse event to handle + */ -export function keyboardMouseDownHandler(e: MouseEvent) { +export function keyboardMouseDownHandler(e: globalThis.MouseEvent): void { if (!e.ctrlKey || !e.shiftKey) { unsetControlShift(); } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
docs/docs/keybindings.mdx
(3 hunks)emain/emain-util.ts
(2 hunks)frontend/app/app.tsx
(2 hunks)frontend/app/store/keymodel.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Build for TestDriver.ai
- GitHub Check: Analyze (go)
🔇 Additional comments (2)
frontend/app/app.tsx (1)
15-15
: LGTM!The changes correctly implement the mouse event handling with proper cleanup in the useEffect hook.
Also applies to: 196-196, 200-200
docs/docs/keybindings.mdx (1)
41-41
: LGTM!The new keybindings are well-documented and follow the existing documentation format.
Also applies to: 68-68, 78-83
export function delay(ms): Promise<void> { | ||
return new Promise((resolve) => setTimeout(resolve, ms)); | ||
} | ||
|
||
function setCtrlShift(wc: Electron.WebContents, state: boolean) { | ||
lastCtrlShiftSate = state; |
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.
Fix typo in variable usage.
The same typo appears in the variable usage.
- lastCtrlShiftSate = state;
+ lastCtrlShiftState = state;
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
lastCtrlShiftSate = state; | |
lastCtrlShiftState = state; |
@@ -6,11 +6,15 @@ | |||
|
|||
export const WaveAppPathVarName = "WAVETERM_APP_PATH"; | |||
|
|||
// not necessarily exact, but we use this to help get us unstuck in certain cases | |||
let lastCtrlShiftSate: boolean = false; |
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.
Fix typo in variable name.
The variable name contains a typo: lastCtrlShiftSate
should be lastCtrlShiftState
.
-let lastCtrlShiftSate: boolean = false;
+let lastCtrlShiftState: boolean = false;
Committable suggestion skipped: line range outside the PR's diff.
No description provided.