-
Notifications
You must be signed in to change notification settings - Fork 160
allow to disable DevMenu using new method isSecondaryClickToShowDevMenuEnabled #528
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
|
Hi @Simek : Just FYI I've been on vacation and will be on vacation for another week. Thanks for the contribution. This is great, but I do think it should have its own DevSetting instead of reusing isShakeToShowDevMenuEnabled. Perhaps isSecondaryClickToShowDevMenuEnabled. |
|
@tom-un Thank you for the review Tom, I have updated the PR according to the request - there is an macOS exclusive method named Let me know if it's okay or should I update or change anything else. 🙂 |
|
@tom-un For my understanding, why would it be preferable to add another setting instead of perhaps renaming the existing one, or adding a new generic one and deprecate the existing ‘shake’ one? |
I just feel its cleaner to have prop names that mean what they say. Also there could be shake gesture on mac in the future (there already is via Catalyst) or there could be a secondary click gesture in a future iOS. |
React/DevSupport/RCTDevMenu.m
Outdated
| desc = NSStringFromClass([_bridge class]); | ||
| } | ||
| NSString *title = [NSString stringWithFormat:@"React Native: Development\n(%@)", desc]; | ||
| RCTDevSettings *devSettings = _bridge.devSettings; // TODO(OSS Candidate ISS#2710739) |
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.
nit: this comment is not necessary: this whole block of code is already enclosed in #if TARGET_OS_OSX // [TODO(macOS ISS#2323203) ... #else // ]TODO(macOS ISS#2323203)
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.
This comment refers to other issue than macOS fork comment, the line has been copied from showOnShake:
| RCTDevSettings *devSettings = _bridge.devSettings; // TODO(OSS Candidate ISS#2710739) |
Totally agreed, but I also like to have less API surface for ease of discovery. However…
…I didn’t consider the real possibility of having multiple ways to to open the menu. Although that thinking also makes me wonder if it shouldn’t be an enum? Anyways, something to consider longer term, I don’t feel strong about it for this PR. |
|
Should I update this PR to 0.62 files structure or should I target the |
|
Update to the 0.62 structure, which is now in |
Not a problem @alloy, I will work on the changes this week 🙂 |
5639653 to
cc44550
Compare
|
@alloy Should I force push the branch again to rerun the |
I tried forcing it to re-run and it failed again. I'm not sure why. As a branch of the upstream react-native we get these circleci tests too. They're mostly redundant as we do all the same jest, lint, flow and format-check tests in Azure DevOps. I'll force merge this PR and watch for failures in other PRs. Thanks! |
Late here but they're really flaky. I wouldn't go off of the circle CI tests at all as long as our ADO tests pass. |
|
@Simek Thanks again for your work! 🙌 |
Please select one of the following
Summary
This change allows developers to disable the DevMenu (context menu in macOS case) by
reusing currently exportedaddding newisShakeToShowDevMenuEnabledavailable on iOSsetIsSecondaryClickToShowDevMenuEnabledmethod to the DevSettings:This also improves quite a bit the development process when using Contextual Menus (aka
ActionSheetIOS).Of course I can implement separate, exclusive for macOS, flag if you think it's a better approach.
Also adding
[devSettings isDevModeEnabled]like inshowOnShakefixed for me DevMenu appearing on the Release build.Changelog
[macOS] [Added] - add ability to disable DevMenu based on new
setIsSecondaryClickToShowDevMenuEnabledmethod in DevSettings[macOS] [Fixed] - disable DevMenu when
isDevModeEnabledreturnsfalseTest Plan
I have tested the change inside my workbench/sample app, which source code is available here.
Microsoft Reviewers: Open in CodeFlow