Repository navigation
Fix duplicate menu separators - #10533
Merged
Merged
Conversation
added 2 commits
February 8, 2022 14:56
gtritchie
approved these changes
Feb 8, 2022
gtritchie
left a comment
Member
There was a problem hiding this comment.
LGTM! Please modify the PR comment to reword "fixes ####" to "addresses ####" before merging so the issue isn't auto-closed by github.
Contributor
Author
|
Good to know about the fixes/addresses |
matheustavaresdev
added a commit
that referenced
this pull request
Feb 9, 2022
…on-test * 'main' of github.com:rstudio/rstudio: Fix duplicate menu separators (#10533) use RSTUDIO_CLI_HYPERLIKNS env var Mention issue number in NEWS. stamp version into Electron app (macOS) fix NEWS fix NEWS year produce separate UTF-8 rsession binary for ucrt builds (#10524) Check if load from base is masked before calling load workspace alternate mechanism for R_ResetConsole on Windows (#10510) rotate news files (#10528) Move old NEWS versions in version/news subdirectory Change name back to NEWS.md Add RSW section Add version numbering to NEWS file to avoid further conflicts/overwrites Remove GO NEWS files NEWS for Spotted Wakerobin only Support ansi hyperlinks (#10416) Update to Quarto v0.3.114
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Addresses #9948
Change the eslint config to address the errors about prettier at the top of every file.
Approach
This uses similar logic to how Electron handles menu separators. The difference is that Electron only removes separators if they are at the beginning/end or the previous item is also a separator. Our menus have many hidden items so check doesn't work for us. Even not adding the hidden items still means the separators have to be marked as hidden.
I've added in a check to not add hidden items to menus. The caveat is shortcuts won't work for that command. Although, I don't see that as an issue since the item is likely hidden for a reason. The second part of the fix is using the same logic as Electron to filter out unnecessary separators.
This also runs on MacOS but has no difference since it already hides unnecessary separators. I think it's fine to leave in just in case that ever changes and to maintain the same code across all platforms.
Automated Tests
Added unit tests:
Unit tests pass on all platforms
QA Notes
The Build menu was most noticeable with this bug. Using Configure Build Tools to change the type will update the Build menu.
Checklist
NEWS.md