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

feat: Add full screen Snap Home and Dialog #25670

Merged
merged 15 commits into from
Jul 18, 2024
Merged

Conversation

david0xd
Copy link
Contributor

@david0xd david0xd commented Jul 3, 2024

Description

This PR adds redesigned UI and new UX to the Snap home page and Snap dialog. Snap Authorship header is also updated and its new UX/UI reflected across the related pages.

Open in GitHub Codespaces

Related issues

Fixes: #25068

Manual testing steps

  1. Try installing or updating a Snap, check the new authorship header UI and functionality.
  2. Try account Snap features and verify the new header.
  3. Try Snap-related permission requests and verify the new header.
  4. Install a Snap with Home permission and verify the UI/UX (new header, menu, removed delineator, etc.)
  5. Verify new menu and header functionality on Snap home.
  6. Verify new UX/UI on Snap dialog.

Screenshots/Recordings

Before

Screenshot 2024-07-11 at 15 50 08
Screenshot 2024-07-11 at 15 48 47
Screenshot 2024-07-11 at 15 50 17
Screenshot 2024-07-11 at 15 50 41
Screenshot 2024-07-11 at 15 51 04
Screenshot 2024-07-11 at 15 52 27
Screenshot 2024-07-11 at 15 52 42

After

Screenshot 2024-07-11 at 15 40 01
Screenshot 2024-07-11 at 15 40 34
Screenshot 2024-07-11 at 15 39 20
Screenshot 2024-07-11 at 15 39 07
Screenshot 2024-07-11 at 15 38 38
Screenshot 2024-07-11 at 15 38 50
Screenshot 2024-07-11 at 15 37 42
Screenshot 2024-07-11 at 15 37 55
Screenshot 2024-07-11 at 15 40 24
Screenshot 2024-07-11 at 15 35 39
Screenshot 2024-07-11 at 15 35 55
Screenshot 2024-07-11 at 15 36 07
Screenshot 2024-07-11 at 15 37 23
Screenshot 2024-07-11 at 15 42 56
Screenshot 2024-07-11 at 15 45 15

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.

@david0xd david0xd added the team-snaps-platform Snaps Platform team label Jul 3, 2024
@david0xd david0xd self-assigned this Jul 3, 2024
Copy link
Contributor

github-actions bot commented Jul 3, 2024

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.

@david0xd david0xd force-pushed the dd/full-screen-snap-home branch 4 times, most recently from 117bcd1 to 7bd3b9a Compare July 5, 2024 10:51
@GuillaumeRx
Copy link
Contributor

The info icon on the header seems to be the wrong color

image

@GuillaumeRx
Copy link
Contributor

Shouldn't we always keep the fade at the bottom. It seems to create a "jump" when it's removed

image
image

@david0xd
Copy link
Contributor Author

david0xd commented Jul 5, 2024

Shouldn't we always keep the fade at the bottom. It seems to create a "jump" when it's removed

image image

If this refers to the bottom fade behind the scroll arrow, this is done in the separate PR that is waiting to be merged (still in review, needs some refactoring).

@david0xd david0xd force-pushed the dd/full-screen-snap-home branch 4 times, most recently from ba61c9c to 6cbd3d7 Compare July 9, 2024 20:06
@metamaskbot
Copy link
Collaborator

Builds ready [369a1ff]
Page Load Metrics (392 ± 367 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint662701245125
domContentLoaded105731157
load402577392765367
domInteractive105731157
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 5.93 KiB (0.08%)
  • common: 70 Bytes (0.00%)

Copy link

codecov bot commented Jul 10, 2024

Codecov Report

Attention: Patch coverage is 16.66667% with 10 lines in your changes missing coverage. Please review.

Project coverage is 69.74%. Comparing base (3c100bc) to head (1084cc0).
Report is 2 commits behind head on develop.

Files Patch % Lines
...i/pages/confirmations/confirmation/confirmation.js 0.00% 5 Missing ⚠️
...rmissions-connect/permissions-connect.component.js 0.00% 4 Missing ⚠️
ui/pages/routes/routes.component.js 66.67% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #25670      +/-   ##
===========================================
- Coverage    69.75%   69.74%   -0.01%     
===========================================
  Files         1400     1400              
  Lines        49419    49428       +9     
  Branches     13668    13673       +5     
===========================================
+ Hits         34470    34472       +2     
- Misses       14949    14956       +7     

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

@david0xd david0xd force-pushed the dd/full-screen-snap-home branch from 369a1ff to 0073e3f Compare July 11, 2024 10:36
@metamaskbot
Copy link
Collaborator

Builds ready [0073e3f]
Page Load Metrics (242 ± 238 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint80135103136
domContentLoaded106627136
load461807242495238
domInteractive106626136
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 5.93 KiB (0.08%)
  • common: 70 Bytes (0.00%)

@david0xd david0xd marked this pull request as ready for review July 11, 2024 13:53
@david0xd david0xd requested review from a team as code owners July 11, 2024 13:53
@metamaskbot
Copy link
Collaborator

Builds ready [1ba09e8]
Page Load Metrics (65 ± 9 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6813095189
domContentLoaded95624147
load4110165199
domInteractive95624147
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 6.19 KiB (0.08%)
  • common: 70 Bytes (0.00%)

GuillaumeRx
GuillaumeRx previously approved these changes Jul 17, 2024
@david0xd david0xd force-pushed the dd/full-screen-snap-home branch from 1ba09e8 to d1d76a2 Compare July 17, 2024 12:50
@metamaskbot
Copy link
Collaborator

Builds ready [d1d76a2]
Page Load Metrics (416 ± 314 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint832931304622
domContentLoaded98337199
load561798416654314
domInteractive98337199
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 6.19 KiB (0.08%)
  • common: 70 Bytes (0.00%)

hmalik88
hmalik88 previously approved these changes Jul 17, 2024
Copy link
Contributor

@hmalik88 hmalik88 left a comment

Choose a reason for hiding this comment

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

LGTM

@david0xd david0xd requested a review from jpuri July 18, 2024 09:53
@david0xd david0xd dismissed stale reviews from hmalik88 and GuillaumeRx via 8b31e04 July 18, 2024 10:06
@david0xd david0xd force-pushed the dd/full-screen-snap-home branch from 8b31e04 to 1084cc0 Compare July 18, 2024 10:06
Copy link

@metamaskbot
Copy link
Collaborator

Builds ready [1084cc0]
Page Load Metrics (147 ± 169 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6713494199
domContentLoaded105225136
load431677147352169
domInteractive105225136
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 5.93 KiB (0.08%)
  • common: 70 Bytes (0.00%)

onCancel={
templatedValues.onCancel ||
// /!\ Treat cancel as submit only if approval type is appropriate /!\
(pendingConfirmation?.type === ApprovalType.SnapDialogAlert
Copy link
Member

@matthewwalsh0 matthewwalsh0 Jul 18, 2024

Choose a reason for hiding this comment

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

Rather than adding further coupling to specific types in this generic component, could we instead just specify a suitable onReject in the relevant templates such as ui/pages/confirmations/confirmation/templates/snaps/snap-alert/snap-alert.js?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem with this is when onCancel is added to the snap-alert.js, the confirmation popup renders an extra button. Alert needs to have only one button by design. We just want to have the possibility to close popup from header everywhere (in all Snaps dialogs) and this case was somehow exception because there is no reason to have two buttons on alert screen.

Do you see quick fix for this maybe?

Screenshot 2024-07-18 at 14 45 21

Copy link
Member

@matthewwalsh0 matthewwalsh0 Jul 18, 2024

Choose a reason for hiding this comment

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

Might be too much extra scope for now, but we could add a hideCancelButton property to the template to match hideSubmitButton so you could still define an onCancel but explicitly hide the button so it's only used for this header exit behaviour.

onCancel={
templatedValues.onCancel ||
// /!\ Treat cancel as submit only if approval type is appropriate /!\
(pendingConfirmation?.type === ApprovalType.SnapDialogAlert
Copy link
Member

@matthewwalsh0 matthewwalsh0 Jul 18, 2024

Choose a reason for hiding this comment

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

Might be too much extra scope for now, but we could add a hideCancelButton property to the template to match hideSubmitButton so you could still define an onCancel but explicitly hide the button so it's only used for this header exit behaviour.

@david0xd david0xd merged commit 3da665c into develop Jul 18, 2024
79 checks passed
@david0xd david0xd deleted the dd/full-screen-snap-home branch July 18, 2024 13:34
@github-actions github-actions bot locked and limited conversation to collaborators Jul 18, 2024
@metamaskbot metamaskbot added the release-12.3.0 Issue or pull request that will be included in release 12.3.0 label Jul 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.3.0 Issue or pull request that will be included in release 12.3.0 team-snaps-platform Snaps Platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Full-screen home page & dialog
6 participants