feat: existing permission banner on permission picker#286
feat: existing permission banner on permission picker#286
Conversation
…existing permissions scenarios
packages/gator-permissions-snap/src/services/existingPermissionsService.ts
Show resolved
Hide resolved
packages/gator-permissions-snap/src/core/permissionRequestLifecycleOrchestrator.ts
Outdated
Show resolved
Hide resolved
packages/gator-permissions-snap/src/services/existingPermissionsService.ts
Show resolved
Hide resolved
packages/gator-permissions-snap/src/core/permissionHandlerContent.tsx
Outdated
Show resolved
Hide resolved
jeffsmale90
left a comment
There was a problem hiding this comment.
This looks super good!
It's definitely less imposing than the full screen display.
packages/gator-permissions-snap/src/core/permissionHandlerContent.tsx
Outdated
Show resolved
Hide resolved
packages/gator-permissions-snap/src/core/permissionRequestLifecycleOrchestrator.ts
Outdated
Show resolved
Hide resolved
packages/gator-permissions-snap/src/services/existingPermissionsService.ts
Show resolved
Hide resolved
packages/gator-permissions-snap/src/services/existingPermissionsService.ts
Outdated
Show resolved
Hide resolved
packages/gator-permissions-snap/src/services/existingPermissionsService.ts
Outdated
Show resolved
Hide resolved
packages/gator-permissions-snap/src/services/existingPermissionsService.ts
Show resolved
Hide resolved
packages/gator-permissions-snap/src/services/existingPermissionsService.ts
Show resolved
Hide resolved
packages/gator-permissions-snap/src/services/existingPermissionsService.ts
Outdated
Show resolved
Hide resolved
packages/gator-permissions-snap/src/services/existingPermissionsService.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
packages/gator-permissions-snap/src/services/existingPermissionsService.ts
Outdated
Show resolved
Hide resolved
jeffsmale90
left a comment
There was a problem hiding this comment.
This is looking great! A huge improvement over the full screen.
| }, | ||
| "existingPermissionsSimilarDescription": { | ||
| "message": "You have granted similar permissions to this site in the past. Review them" | ||
| "existingPermissionsSimilarMessage": { |
There was a problem hiding this comment.
This still requires that the link is the final part of the message, which will be problematic for some languages.
I think we can skip over this, but it might come back to bit us later.
| scanAddressResult: FetchAddressScanResult | null; | ||
| hasExistingPermissions: boolean; | ||
| similarPermissionsExist: boolean; | ||
| existingPermissionsStatus: ExistingPermissionsState; |
There was a problem hiding this comment.
nit: the distinction between "State" and "Status" here is confusing.
|
Due to our decision to use a different approach to display existing permissions #288, we are going to close this PR. |

Description
Implement an existing-permissions banner in the permission picker to surface any permissions the user has already granted to a site for the requested chains/accounts.
This update depends on changes in the extension: MetaMask/metamask-extension#40995
Key Changes:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Screen.Recording.2026-03-19.at.2.17.52.PM.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes the permission-request flow UI/logic by removing the blocking existing-permissions dialog and replacing it with a new banner driven by background permission lookups; this impacts core confirmation rendering and could regress gating/UX if the new status logic or wiring is incorrect.
Overview
Adds an existing-permissions banner to the permission confirmation screen that links out to a MetaMask “gator permissions” page, showing a warning when the user previously granted a similar permission type (stream vs periodic) and an info banner when prior permissions exist but are dissimilar.
Removes the entire
core/existingpermissionsdialog flow (content rendering, token-metadata formatting, UI components, and tests) and replaces it with a newExistingPermissionsService.getExistingPermissionsStatus()inservices/that computes a singleExistingPermissionsStateused during confirmation rendering.Updates the permission lifecycle/orchestrator and handler types to fetch this status in parallel with the intro flow (with a non-rejecting promise) and pass it through to
PermissionHandlerContent; updates i18n strings accordingly and adjusts snapshot tests for the new banner output.Written by Cursor Bugbot for commit d44f14f. This will update automatically on new commits. Configure here.