-
Notifications
You must be signed in to change notification settings - Fork 23
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
fix(OpenConsole): Fix open console on MacOS in developer mode #1511
Conversation
WalkthroughWalkthroughThe update involves modifying the webview configuration to include a JavaScript snippet that disables the right-click context menu. Additionally, a configuration method is introduced to control this behavior, which is set to false by default, indicating that the context menu is not disabled initially. Changes
Assessment against linked issues (Beta)
TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: .coderabbit.yaml
Files selected for processing (1)
- ui/src/webview_config.rs (2 hunks)
Additional comments: 4
ui/src/webview_config.rs (4)
12-24: The JavaScript code block added to disable the context menu is a common approach for web applications that want to implement custom context menus or prevent the default browser context menu from appearing. However, it's important to ensure that this behavior is only active in developer mode, as it might confuse end-users if the context menu is disabled in production.
27-29: The drag event logging and handling seem appropriate. However, it's important to ensure that the
DRAG_EVENT
global state is thread-safe if it's being accessed from multiple threads. IfDRAG_EVENT
is a global mutable state, consider using synchronization primitives like mutexes to prevent data races.31-31: The
with_disable_context_menu(false)
method call correctly sets the context menu to be enabled by default. This is a sensible default, but ensure that the methodwith_disable_context_menu
is implemented correctly and that passingfalse
indeed enables the context menu as intended.33-34: This conditional block is checking for the Windows OS and production mode before setting the webview data directory. Ensure that similar handling is in place for MacOS, especially since the pull request is intended to address MacOS functionality.
UI Automated Tests execution is complete! You can find the test results report here |
What this PR does 📖
1. Fix open console on MacOS in developer mode
Screen.Recording.2023-11-13.at.22.59.17.mov
Which issue(s) this PR fixes 🔨
Special notes for reviewers 🗒️
Additional comments 🎤