Skip to content

Feat: existing permissions page#280

Merged
jeffsmale90 merged 13 commits intomainfrom
feat/existing-permissions-page
Mar 11, 2026
Merged

Feat: existing permissions page#280
jeffsmale90 merged 13 commits intomainfrom
feat/existing-permissions-page

Conversation

@mj-kiwi
Copy link
Contributor

@mj-kiwi mj-kiwi commented Mar 10, 2026

Description

This PR implements the existing permissions display and management feature for the Snap 7715 permissions system. The changes include:

  • Existing Permissions Service: Created a new service to manage and display existing permissions with proper formatting
  • Permission Formatter: Added utility functions to format permissions data for UI display, including metadata and token information
  • UI Components: Implemented the existing permissions content component and permission card component for displaying permissions
  • Lifecycle Integration: Integrated the existing permissions display into the permission request lifecycle orchestrator
  • Localization: Added English translations for existing permissions-related strings

The implementation provides a comprehensive solution for displaying and managing existing permissions, with improved descriptions and token metadata formatting.

Related issues

Fixes:

Manual testing steps

  1. Open the permissions snap interface
  2. Navigate to the existing permissions section
  3. Verify that existing permissions are displayed correctly with proper formatting
  4. Check that permission metadata and token information are shown accurately
  5. Test the permission card component rendering

Screenshots/Recordings

Before

After

image

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Adds a new pre-confirmation dialog into the permission request flow and new formatting logic that relies on profile-sync data and token-metadata lookups, which could affect approval UX and edge cases around filtering/formatting. Changes are contained to the permissions Snap but touch the main lifecycle orchestrator and rejection paths.

Overview
Introduces an “Existing permissions” step in the permission-request flow: before showing the final confirmation, the orchestrator now fetches previously granted permissions for the same origin + chainId and, if any exist, shows a dialog that the user must explicitly Proceed past (cancelling rejects the request with a more specific reason).

Adds a new ExistingPermissionsService plus UI builders (buildExistingPermissionsContent, PermissionCard) and a permissionFormatter that groups permissions by CAIP-10 account and formats display fields (including token maxAmount via token metadata, chain labels, and revocation/subscription/stream details). Wires the service in src/index.ts, exports the new module, updates tests for the new dependency, and adds the required i18n strings in en.json.

Written by Cursor Bugbot for commit 69238ea. This will update automatically on new commits. Configure here.

Copy link
Contributor

@jeffsmale90 jeffsmale90 left a comment

Choose a reason for hiding this comment

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

I know this is in progress, so take the comments with a grain of salt!

Looking good so far though :)

@mj-kiwi mj-kiwi marked this pull request as ready for review March 11, 2026 04:49
@mj-kiwi mj-kiwi requested a review from a team as a code owner March 11, 2026 04:49
…dress conversion to handle decimal chain IDs
Copy link
Contributor

@jeffsmale90 jeffsmale90 left a comment

Choose a reason for hiding this comment

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

Looking great!

Would be good to get some more test coverage of this.

Also, I wonder if we can increase the margin between permissions in the permission list? Especially with the block of test (justification) they seem to blend into each other a bit.

@mj-kiwi mj-kiwi requested a review from jeffsmale90 March 11, 2026 09:32
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Copy link
Contributor

@jeffsmale90 jeffsmale90 left a comment

Choose a reason for hiding this comment

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

lgtm

@jeffsmale90 jeffsmale90 merged commit 76b901f into main Mar 11, 2026
16 checks passed
@jeffsmale90 jeffsmale90 deleted the feat/existing-permissions-page branch March 11, 2026 15:23
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.

2 participants