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

Only suggest inserting masks in text fields #488

Merged
merged 1 commit into from
Apr 13, 2023

Conversation

Vinnl
Copy link
Collaborator

@Vinnl Vinnl commented Apr 6, 2023

The context menu entries to generate/reuse a mask only really make sense if the user is right-clicking an editable field. (Ideally even just email address fields, but we don't have an API that allows us to detect that.) @maxxcrawford let me know if there was a reason you initially had these set to all. See https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/menus/ContextType.

This PR fixes MPP-3014.

How to test: right-click an email input - nothing should have changed. Right-click anything else, e.g. the Relay icon in the toolbar, and you should not have options to generate or reuse a mask.

  • l10n changes have been submitted to the l10n repository, if any.
  • All UI revisions follow the coding standards, and use Protocol tokens where applicable (see /frontend/src/styles/tokens.scss).
  • Commits in this PR are minimal and have descriptive commit messages.

The context menu entries to generate/reuse a mask only really make
sense if the user is right-clicking an editable field. (Ideally
even just email address fields, but we don't have an API that
allows us to detect that.)
@Vinnl Vinnl requested a review from maxxcrawford April 6, 2023 09:24
@Vinnl Vinnl self-assigned this Apr 6, 2023
Copy link
Collaborator

@maxxcrawford maxxcrawford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added two notes, both non-blocking. I do think we should keep the link for managing masks everywhere (especially in the context of clicking on the icon in the toolbar)

image

@@ -35,7 +35,7 @@ const staticMenuData = {
title: browser.i18n.getMessage("pageInputIconInsertPhoneMask"),
enabled: true,
visible: true,
contexts: ["all"],
contexts: ["editable"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (non-blocking): I would recommend leaving this one as is. Having a way to open Relay anywhere can be useful.

Suggested change
contexts: ["editable"],
contexts: ["all"],

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub's diff collapsing makes this looks like this affects the manageAliases entry, but it's actually insertPhoneMask:

Screencast.from.2023-04-13.10-53-26.webm

"Manage aliases" will indeed still be available everywhere.

(I was so confused when I went to make this change 😅

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ughhhh. Sorry! My intentions were pure.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hahaha no worries, I made the exact same mistake until I checked the code out locally.

@@ -55,13 +55,13 @@ const staticMenuData = {
"pageInputIconUseExistingAliasFromTheSite_mask"
),
visible: true,
contexts: ["all"],
contexts: ["editable"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question (non-blocking): Should we leave one as is? Having a way for users to upgrade may be useful? This may also seem like too upgrade-focused. LMK your thoughts.

Suggested change
contexts: ["editable"],
contexts: ["all"],

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here too, this is actually useExistingAliasFromWebsite rather than upgradeToPremium :)

@Vinnl Vinnl requested a review from maxxcrawford April 13, 2023 08:55
@Vinnl
Copy link
Collaborator Author

Vinnl commented Apr 13, 2023

@maxxcrawford requested another review - I'm assuming this is good to merge, but because GH's diff display is confusing, might be good to take another look to be sure.

Copy link
Collaborator

@maxxcrawford maxxcrawford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed! 🚀

Screenshots:

Premium:

image

image

Free:

image

image

@Vinnl Vinnl merged commit 8d020e2 into main Apr 13, 2023
@Vinnl Vinnl deleted the MPP-3014-only-generate-in-editable branch April 13, 2023 15:07
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.

None yet

2 participants