Refactor: unify confirmations in the transaction flow
What it solves
Unify all the Review screens from the tx-flow floder.
How this PR fixes it
It introduces a refactor in the way how we handle the confirmation views on the SignOrExecuteForm component. This PR introduces the first part of the refactor, by creating a central component to handle the presentation of the Review screens. It also makes all modals from the approval owner flow to use the same SettingsChange component (which was part of the ReviewOwner component.
How to test it
1- Go to the add signer flow (in a modal) 2- Go to the confirmation screen.
You will see the new screen shows a loading screen before the confirmation screen, it happens because we had to move some data outside the SignOrExecuteForm component, and these data was asynchronous, so in order to prevent some glitch in the screen, we show the loading component before we have load the necessary data to show in the component.
Screenshots
Checklist
- [x] I've tested the branch on mobile π±
- [ ] I've documented how it affects the analytics (if at all) π
- [x] I've written a unit/e2e test for it (if applicable) π§βπ»
Branch preview
β Deploy successful!
Website: https://chore_refactor_transaction_flow--walletweb.review.5afe.dev/home?safe=eth:0xA77DE01e157f9f57C7c4A326eeE9C4874D0598b6
Storybook: https://chore_refactor_transaction_flow--walletweb.review.5afe.dev/storybook/
ESLint Summary View Full Report
Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.
| Type | Occurrences | Fixable |
|---|---|---|
| Errors | 0 | 0 |
| Warnings | 0 | 0 |
| Ignored | 0 | N/A |
- Result: :white_check_mark: success
- Annotations: 0 total
Report generated by eslint-plus-action
π¦ Next.js Bundle Analysis for safe-wallet-web
This analysis was generated by the Next.js Bundle Analysis action. π€
β οΈ Global Bundle Size Increased
| Page | Size (compressed) |
|---|---|
global |
1011.89Β KB (π‘ +158Β B) |
Details
The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.
Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis
If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!
Four Pages Changed Size
The following pages changed size from the code in this PR compared to its base branch:
| Page | Size (compressed) | First Load |
|---|---|---|
/apps |
48.42Β KB (-1Β B) |
1.04Β MB |
/apps/custom |
40.06Β KB (-1Β B) |
1.03Β MB |
/balances/nfts |
19.2Β KB (-1Β B) |
1.01Β MB |
/stake |
596Β B (π’ -1Β B) |
1012.47Β KB |
Details
Only the gzipped size is provided here based on an expert tip.
First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.
Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis
Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.
Coverage report
St.:grey_question: |
Category | Percentage | Covered / Total |
|---|---|---|---|
| π‘ | Statements | 74.19% (+0.6% πΌ) |
13746/18527 |
| π΄ | Branches | 52.77% (+1.35% πΌ) |
3397/6437 |
| π΄ | Functions | 58.04% (+0.89% πΌ) |
2011/3465 |
| π‘ | Lines | 75.86% (+0.55% πΌ) |
12485/16459 |
Show new covered files π£
St.:grey_question: |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| π’ | ... / SignOrExecuteForm.tsx |
85.54% | 78.75% | 42.86% | 84.81% |
| π’ | ... / index.tsx |
92.31% | 61.9% | 100% | 100% |
| π’ | ... / index.tsx |
95% | 85.71% | 100% | 100% |
| π’ | ... / ChangeSignerSetupWarning.tsx |
100% | 100% | 100% | 100% |
| π’ | ... / useIsMultichainSafe.ts |
90.91% | 100% | 66.67% | 100% |
| π’ | ... / context.ts |
100% | 100% | 100% | 100% |
| π’ | ... / index.tsx |
100% | 100% | 100% | 100% |
| π’ | ... / context.tsx |
100% | 100% | 100% | 100% |
| π’ | ... / index.tsx |
100% | 100% | 100% | 100% |
| π’ | ... / utils.ts |
100% | 100% | 100% | 100% |
| π’ | ... / SignOrExecuteSkeleton.tsx |
100% | 100% | 100% | 100% |
| π‘ | ... / index.tsx |
62.16% | 33.33% | 42.86% | 61.11% |
| π’ | ... / mockData.ts |
100% | 100% | 100% | 100% |
| π’ | ... / mockData.ts |
100% | 100% | 100% | 100% |
Show files with reduced coverage π»
St.:grey_question: |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| π‘ | ... / hooks.ts |
79.26% (-1.78% π») |
68.29% (-4.43% π») |
70% (-0.59% π») |
79.51% (-1.62% π») |
| π΄ | ... / SafeTxProvider.tsx |
27.5% (-1.45% π») |
0% | 36.36% (-3.64% π») |
27.78% (-1.63% π») |
| π‘ | src/pages/_app.tsx | 69.33% (-0.4% π») |
42.86% | 0% | 68.06% (-0.44% π») |
| π΄ | ... / index.tsx |
30.08% (-4.88% π») |
0% (-1.96% π») |
0% (-2.63% π») |
33.04% (-4.46% π») |
Test suite run success
1582 tests passing in 213 suites.
Report generated by π§ͺjest coverage report action from 0c1b25e2aed5092e82e3a733229f1f5de944108f
ESLint Summary View Full Report
Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.
| Type | Occurrences | Fixable |
|---|---|---|
| Errors | 0 | 0 |
| Warnings | 1 | 0 |
| Ignored | 0 | N/A |
-
Result: :white_check_mark: success
-
Annotations: 1 total
[warning] react-hooks/exhaustive-deps
verifies the list of dependencies for Hooks like useEffect and similar
- src/components/tx/SignOrExecuteForm/hooks.ts Line 52 - React Hook useAsync has a missing dependency: 'safe.chainId'. Either include it or remove the dependency array.
Report generated by eslint-plus-action
ESLint Summary View Full Report
Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.
| Type | Occurrences | Fixable |
|---|---|---|
| Errors | 0 | 0 |
| Warnings | 0 | 0 |
| Ignored | 0 | N/A |
- Result: :white_check_mark: success
- Annotations: 0 total
Report generated by eslint-plus-action
ESLint Summary View Full Report
Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.
| Type | Occurrences | Fixable |
|---|---|---|
| Errors | 0 | 0 |
| Warnings | 0 | 0 |
| Ignored | 0 | N/A |
- Result: :white_check_mark: success
- Annotations: 0 total
Report generated by eslint-plus-action
ESLint Summary View Full Report
Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.
| Type | Occurrences | Fixable |
|---|---|---|
| Errors | 0 | 0 |
| Warnings | 0 | 0 |
| Ignored | 0 | N/A |
- Result: :white_check_mark: success
- Annotations: 0 total
Report generated by eslint-plus-action
ESLint Summary View Full Report
Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.
| Type | Occurrences | Fixable |
|---|---|---|
| Errors | 0 | 0 |
| Warnings | 0 | 0 |
| Ignored | 0 | N/A |
- Result: :white_check_mark: success
- Annotations: 0 total
Report generated by eslint-plus-action
any reason we moved approve at the top again ?
We moved approve under main information for the purpose some time ago - https://github.com/safe-global/safe-wallet-web/pull/3855
ESLint Summary View Full Report
Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.
| Type | Occurrences | Fixable |
|---|---|---|
| Errors | 0 | 0 |
| Warnings | 0 | 0 |
| Ignored | 0 | N/A |
- Result: :white_check_mark: success
- Annotations: 0 total
Report generated by eslint-plus-action
waiting for https://github.com/safe-global/safe-client-gateway/pull/1973 to be available on staging before continue the ticket testing
The name of a new owner is not shown in the review step of adding an owner. Same for owner replacement tx
Here's dev for comparison:
The tx I tried worked fine. I still would like for the conflicts to be solved so I can re check it quickly, because I've seen some bugs (like the duplicated parameters in swap) that have been fixed already.
Replace owner:
A new owner name is missing from the previous step
The issue of the owner name in the adding and replacing was fixed.
New issue: "Add signer" form shows the new owner twice Just try to add a new owner and reach the review page
The issue is fixed:
LGTM