Skip to content
This repository was archived by the owner on Dec 11, 2019. It is now read-only.

Prevent duplicate separators for all context menu items. #5846

Merged
merged 1 commit into from
Nov 26, 2016
Merged

Prevent duplicate separators for all context menu items. #5846

merged 1 commit into from
Nov 26, 2016

Conversation

bsclifton
Copy link
Member

@bsclifton bsclifton commented Nov 25, 2016

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

This update will ensure we will never have double separators going forward on Windows or Linux.
Fixes #5765

Auditor: @bbondy, @cezaraugusto

Includes these changes:

  • Added new sanitizeTemplateItems method to filter out bad entries
  • Moved menuUtil from app/browser => app/common
  • Moved some tests to match the new directory structure (ex: test/unit/app, instead of test/unit/lib)
  • Rename template functions in menuUtil and items in contextMenu.js to reinforce distinction between template items and electron menu items (the compiled template)
  • The new sanitize method is called in each method which builds a context menu

Test plan

  • Launch Brave on Windows or Linux
  • Right click on each of the about pages and ensure there are no double separators (might be easy to go to about:about to launch each)
  • Try other context menus
    • Right clicking on a tab
    • right clicking on page
    • right clicking a bookmark / bookmark folder in the bookmarks toolbar
    • right clicking inside the downloads bar (shown after downloading an item)

Sorry, something went wrong.

Fixes #5765

Auditor: @bbondy, @cezaraugusto

Includes these changes:
- Added new `sanitizeTemplateItems` method to filter out bad entries
- Moved menuUtil from browser => common
- Moved some tests to match the new directory structure
- Rename template functions and items in contextMenu.js to reinforce distinction between template and electron  menu item (the compiled template)
- The new sanitize method is called in each method which builds a context menu
@bbondy
Copy link
Member

bbondy commented Nov 26, 2016

++ great stuff, I thought about doing this before as well.

@bbondy bbondy merged commit 41ff8e8 into brave:master Nov 26, 2016
@bsclifton bsclifton deleted the fix-context-menu branch November 26, 2016 17:39
@bsclifton bsclifton removed this from the 0.13.0 milestone Nov 28, 2016
@bsclifton
Copy link
Member Author

removed milestone

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants