Skip to content
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

Merged
merged 6 commits into from
Nov 16, 2023

Conversation

lgmarchi
Copy link
Contributor

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 🎤

@lgmarchi lgmarchi self-assigned this Nov 14, 2023
Copy link

coderabbitai bot commented Nov 14, 2023

Walkthrough

Walkthrough

The 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

File Change Summary
ui/src/webview_config.rs Added JavaScript to disable right-click context menu; added with_disable_context_menu(false) method.

Assessment against linked issues (Beta)

Objective Addressed Explanation
1505: Ensure "Open Console" works on MacOS The changes do not directly reference the "Open Console" feature or MacOS-specific behavior, so it's unclear if the issue is addressed.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

@github-actions github-actions bot added Don't merge yet DO NOT MERGE Missing dev review Still needs to be reviewed by a dev labels Nov 14, 2023
Copy link

@coderabbitai coderabbitai bot left a 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

Commits Files that changed from the base of the PR and between f14407a and 38ac308.
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. If DRAG_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 method with_disable_context_menu is implemented correctly and that passing false 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.

@lgmarchi lgmarchi changed the title update(OpenConsole): Fix open console on MacOS in developer mode fix(OpenConsole): Fix open console on MacOS in developer mode Nov 14, 2023
@github-actions github-actions bot added the Failed Automated Test This PR is failing Luis's Appium test and needs revised label Nov 14, 2023
Copy link
Contributor

github-actions bot commented Nov 14, 2023

UI Automated Test Results Summary for MacOS/Windows

477 tests   364 ✔️  2h 54m 42s ⏱️
  41 suites  113 💤
    3 files        0

Results for commit 4f8ac30.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Nov 14, 2023

UI Automated Tests execution is complete! You can find the test results report here

@github-actions github-actions bot removed the Failed Automated Test This PR is failing Luis's Appium test and needs revised label Nov 14, 2023
@phillsatellite phillsatellite added the Waiting for CI Waiting for at least one CI job to complete before merging label Nov 14, 2023
@github-actions github-actions bot added the Failed Automated Test This PR is failing Luis's Appium test and needs revised label Nov 14, 2023
@phillsatellite phillsatellite added QA Tested QA has tested and approved and removed Failed Automated Test This PR is failing Luis's Appium test and needs revised Waiting for CI Waiting for at least one CI job to complete before merging labels Nov 14, 2023
@sdwoodbury sdwoodbury removed the Missing dev review Still needs to be reviewed by a dev label Nov 16, 2023
@lgmarchi lgmarchi merged commit 3f66591 into dev Nov 16, 2023
5 checks passed
@lgmarchi lgmarchi deleted the fix-open-console-on-macos branch November 16, 2023 20:45
@github-actions github-actions bot added Failed Automated Test This PR is failing Luis's Appium test and needs revised and removed QA Tested QA has tested and approved Don't merge yet DO NOT MERGE labels Nov 16, 2023
@stavares843 stavares843 removed the Failed Automated Test This PR is failing Luis's Appium test and needs revised label Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(DeveloperMode): Open Console not working in MacOS
5 participants