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

chore: Bump Snaps packages #29275

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

chore: Bump Snaps packages #29275

wants to merge 6 commits into from

Conversation

FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Dec 17, 2024

Description

Bump Snaps packages and handle any required changes.

Summary of Snaps changes:

  • Allow async initialization logic for Snap bundles
  • Add onSettingsPage export
  • Add Banner component
  • Support size prop on Button
  • Support fontWeight prop on Text
  • Add loading state for Button
  • Use BigInt for processing insight chain IDs

Open in GitHub Codespaces

Related issues

Closes MetaMask/snaps#2939
Closes MetaMask/snaps#2947
Closes MetaMask/snaps#2874
Closes MetaMask/snaps#2694

@metamaskbot metamaskbot added team-snaps-platform Snaps Platform team INVALID-PR-TEMPLATE PR's body doesn't match template labels Dec 17, 2024
FrederikBolding and others added 2 commits December 17, 2024 14:50
## **Description**
Add Snap UI Banner component.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29271?quickstart=1)

## **Related issues**
Fixes: MetaMask/snaps#2939

## **Manual testing steps**
1. Install test Snap from the code example provided and check the
results.

Example Snap code with Banners in the UI:
```typescript
<Container>
  <Box>
    <Banner title="Success banner" severity="success">
      <Text>
        <Icon name="arrow-right" color="primary" size="inherit" />
        &nbsp;Here is the banner content!
      </Text>
      <Bold>Banner bold formatted text</Bold>
      <Italic>Banner italic formatted text</Italic>
      <Text>
        You can click here:&nbsp;
        <Link href="https://snaps.metamask.io/">Banner link</Link>
      </Text>
      <Button type="button">Banner Action Button</Button>
    </Banner>
    <Banner title="Info banner" severity="info">
      <Text>Here is the banner content!</Text>
    </Banner>
    <Banner title="Warning banner" severity="warning">
      <Text>Here is the banner content!</Text>
    </Banner>
    <Banner title="Danger banner" severity="danger">
      <Text>Here is the banner content!</Text>
    </Banner>
  </Box>
</Container>
```

## **Screenshots/Recordings**
### **Before**
Banner in Snap UI was not available before this PR. Nothing to show
here.

### **After**
![Screenshot 2024-12-17 at 12 34
42](https://github.com/user-attachments/assets/bdf291be-b41b-4e0a-964c-218dbd2dae5e)

## **Pre-merge author checklist**
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
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.

@metamaskbot
Copy link
Collaborator

Builds ready [2a0e83e]
Page Load Metrics (1809 ± 100 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14942091181720096
domContentLoaded14442050176620598
load149821091809208100
domInteractive23117342110
backgroundConnect9111472813
firstReactRender15102533215
getState588232110
initialActions01000
loadScripts10681602129618187
setupStore790202512
uiStartup171226672190275132
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 217 Bytes (0.00%)
  • ui: 2.77 KiB (0.03%)
  • common: 3.39 KiB (0.04%)

## **Description**
This PR enables loading button variant for Snaps UI.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28997?quickstart=1)

#### Notes
- Targets Snaps release integration PR:
#29275

## **Related issues**
Fixes: MetaMask/snaps#2694

## **Related PR dependencies**
Snaps monorepo: MetaMask/snaps#2930

## **Manual testing steps**
1. Create some example Snap for testing and add Snap UI Button with
`loading` variant.
Example: 
```TypeScript
<Button variant="loading">Loading button</Button>
```

## **Screenshots/Recordings**
### **Before**
Loading button variant was not available before.

### **After**

https://github.com/user-attachments/assets/5afea22c-1951-4475-a908-aa5b97eafb6b


## **Pre-merge author checklist**
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
@metamaskbot
Copy link
Collaborator

Builds ready [70c7e35]
Page Load Metrics (1615 ± 63 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint22519211497436210
domContentLoaded14381902159412761
load14481909161513163
domInteractive237237189
backgroundConnect67826209
firstReactRender16108483316
getState46316189
initialActions01000
loadScripts9881407115411957
setupStore691162311
uiStartup163627041973281135
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 217 Bytes (0.00%)
  • ui: 3.03 KiB (0.04%)
  • common: 3.39 KiB (0.04%)

## **Description**

This PR adds a settings section for each preinstalled snaps that exposes
a `onSettingsPage` handler

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29234?quickstart=1)

## **Related issues**

Fixes: MetaMask/snaps#2874

## **Manual testing steps**

1. Open MetaMask's settings
2. You should see the preinstalled snaps settings

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**


### **After**


![image](https://github.com/user-attachments/assets/55f4027c-258e-4039-9006-95228cfdca3f)

![image](https://github.com/user-attachments/assets/e05e6964-ac61-49a1-bb28-e8d7d077dadc)

![image](https://github.com/user-attachments/assets/b2db7088-069a-4b83-9740-11f23f36e879)


## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
@FrederikBolding FrederikBolding marked this pull request as ready for review December 18, 2024 09:22
@FrederikBolding FrederikBolding requested review from a team as code owners December 18, 2024 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template team-snaps-platform Snaps Platform team
Projects
None yet
4 participants