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: split ConfirmPage storybook pages by transaction type #25283

Merged
merged 12 commits into from
Jun 20, 2024

Conversation

digiwand
Copy link
Contributor

@digiwand digiwand commented Jun 13, 2024

Description

  • Separate ConfirmPage stories by signature type
  • Fix issue that caused 404 bug in storybook

Open in GitHub Codespaces

Related issues

Fixes: #25052 (continuation)
Related: #25054

Manual testing steps

  1. yarn storybook
  2. Go to http://localhost:6006/?path=/docs/pages-confirmation-confirmpage-signatures-permit--docs
  3. View other stories in relevant signatures directory

Screenshots/Recordings

Before

After

CleanShot 2024-06-18 at 22 38 56@2x

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.

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.

history.replace. To avoid history.replace, we can provide a param id. */}
<MemoryRouter initialEntries={['/confirmation/:0']}>
<Route path="/confirmation/:id" render={() => <ConfirmPage />} />
</MemoryRouter>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without the Router workaround, we would receive an error like this one
CleanShot 2024-06-12 at 23 49 33@2x which broke the bundler for subsequent storybook loads

@digiwand digiwand added the team-confirmations Push issues to confirmations team label Jun 14, 2024
@digiwand digiwand marked this pull request as ready for review June 18, 2024 14:00
@digiwand digiwand requested review from a team as code owners June 18, 2024 14:00
matthewwalsh0
matthewwalsh0 previously approved these changes Jun 18, 2024
* The `<ConfirmPage>` that's displayed when the current confirmation is a version "V1" `eth_signTypedData` signature.
*/
export default {
title: 'Pages/Confirmation/ConfirmPage/Signatures/SignTypedDataV1',
Copy link
Member

Choose a reason for hiding this comment

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

Splitting these into separate files makes total sense, but is there a limit to how far we should go?

Arguably Permit could go into V3 and V4 for example since it's a subset of that, and the same with SIWE and personal sign but I assume the argument here is we present them as distinct confirmations hence the separate file.

This makes sense to me, just confirming the logic.

Copy link
Contributor Author

@digiwand digiwand Jun 19, 2024

Choose a reason for hiding this comment

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

By distinct confirmations was the initial idea, though with this second thought, distinct confirmations might be tricky to pin since we have layers of distinctions.

Great callout! updated b19224b merging subtypes. We could revert this if we do find it more helpful to later

{/* Adding the MemoryRouter and Route is a workaround to bypass a 404 error in storybook that
is caused when the 'ui/pages/confirmations/hooks/syncConfirmPath.ts' hook calls
history.replace. To avoid history.replace, we can provide a param id. */}
<MemoryRouter initialEntries={['/confirmation/:0']}>
Copy link
Member

Choose a reason for hiding this comment

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

❤️

Copy link

codecov bot commented Jun 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.39%. Comparing base (2115516) to head (ab6f248).
Report is 3 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #25283   +/-   ##
========================================
  Coverage    65.39%   65.39%           
========================================
  Files         1382     1382           
  Lines        54764    54764           
  Branches     14369    14369           
========================================
  Hits         35809    35809           
  Misses       18955    18955           

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

@metamaskbot
Copy link
Collaborator

Builds ready [ab6f248]
Page Load Metrics (51 ± 3 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint73968463
domContentLoaded9221131
load40645173
domInteractive9221131
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@jpuri jpuri left a comment

Choose a reason for hiding this comment

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

LGTM

@digiwand digiwand merged commit 03741c9 into develop Jun 20, 2024
74 checks passed
@digiwand digiwand deleted the feat-separate-confirm-page-storybook-pages branch June 20, 2024 17:30
@github-actions github-actions bot locked and limited conversation to collaborators Jun 20, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.1.0 Issue or pull request that will be included in release 12.1.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support various redesign signatures in ConfirmPage Storybook
4 participants