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

UX: Snaps: Only display Notification in Global Menu if enabled snap uses that permission #20913

Merged
merged 6 commits into from
Sep 22, 2023

Conversation

darkwing
Copy link
Contributor

Explanation

The Snaps™ team has asked that we only display the "Notifications" global menu item if the user has a snap™ that uses that permission.

Reference: #20911

Screenshots/Screencaps

With a Snap™ enabled that uses snap_notify permission

SCR-20230915-kmso

With no Snap™ enabled that uses snap_notify permission

SCR-20230915-kmqi

Manual Testing Steps

  1. Open the Global Menu, don't see "Notifications"
  2. Go to https://snaps.metamask.io/ , install the "Push V1" snap™ and/or the WalletChat snap™
  3. See the "Notifications" item in the Global Menu
  4. Go to Settings > Snaps, disable both snaps™
  5. Open the Global menu, don't see "Notifications"

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@darkwing darkwing requested a review from a team as a code owner September 15, 2023 16:54
@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@darkwing darkwing added team-extension-ux DEPRECATED: please use "team-wallet-ux" label instead needs-ux-ds-review labels Sep 15, 2023
@darkwing darkwing force-pushed the global-menu-notifications branch from 14dead7 to a4c4a0b Compare September 15, 2023 20:42
@darkwing darkwing force-pushed the global-menu-notifications branch from a4c4a0b to 5b0fd41 Compare September 15, 2023 22:12
@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Patch coverage: 35.71% and project coverage change: -0.01% ⚠️

Comparison is base (bec1ab0) 68.26% compared to head (3af635d) 68.25%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #20913      +/-   ##
===========================================
- Coverage    68.26%   68.25%   -0.01%     
===========================================
  Files         1002     1002              
  Lines        40133    40140       +7     
  Branches     10742    10744       +2     
===========================================
+ Hits         27395    27397       +2     
- Misses       12738    12743       +5     
Files Changed Coverage Δ
...i/components/multichain/global-menu/global-menu.js 62.07% <20.00%> (-5.20%) ⬇️
ui/selectors/selectors.js 86.37% <75.00%> (-0.07%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Collaborator

Builds ready [3af635d]
Page Load Metrics (1583 ± 36 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint120168139136
domContentLoaded1474182515837536
load1474182515837536
domInteractive1474182515837536
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 285 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

getPermissionSubjects,
(snaps, subjects) => {
return Object.values(snaps).filter(
({ id }) => subjects[id]?.permissions.snap_notify,
Copy link
Contributor

Choose a reason for hiding this comment

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

Haven't seen destructuring in the filter callbackFn args before. Nice

@darkwing darkwing merged commit d59a9fa into develop Sep 22, 2023
9 checks passed
@darkwing darkwing deleted the global-menu-notifications branch September 22, 2023 19:09
@github-actions github-actions bot locked and limited conversation to collaborators Sep 22, 2023
@metamaskbot metamaskbot added the release-11.3.0 Issue or pull request that will be included in release 11.3.0 label Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.3.0 Issue or pull request that will be included in release 11.3.0 team-extension-ux DEPRECATED: please use "team-wallet-ux" label instead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants