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

Refactor: unify confirmations in the transaction flow #4177

Merged
merged 46 commits into from
Nov 1, 2024

Conversation

clovisdasilvaneto
Copy link
Contributor

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

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻

@clovisdasilvaneto clovisdasilvaneto marked this pull request as ready for review September 16, 2024 08:44
Copy link

github-actions bot commented Sep 16, 2024

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: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

github-actions bot commented Sep 16, 2024

📦 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.

Copy link

github-actions bot commented Sep 16, 2024

Coverage report

St.
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.
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.
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 0c1b25e

@katspaugh katspaugh changed the title Chore: Refactor confirmation transactions flow Refactor: unify confirmations in the transaction flow Sep 16, 2024
Copy link

github-actions bot commented Sep 16, 2024

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: ✅ success

  • Annotations: 1 total


[warning] react-hooks/exhaustive-deps

verifies the list of dependencies for Hooks like useEffect and similar


Report generated by eslint-plus-action

Copy link

github-actions bot commented Sep 17, 2024

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: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@clovisdasilvaneto clovisdasilvaneto requested review from usame-algan and removed request for usame-algan September 17, 2024 12:52
src/components/tx/SignOrExecuteForm/index.tsx Outdated Show resolved Hide resolved
src/components/tx/SignOrExecuteForm/hooks.ts Outdated Show resolved Hide resolved
Comment on lines +79 to +86
const proposeTx: TxActions['proposeTx'] = async (safeTx, txId, origin) => {
assertTx(safeTx)
return _propose(wallet?.address || safe.owners[0].value, safeTx, txId, origin)
}
Copy link
Member

Choose a reason for hiding this comment

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

Does this need to be a separate function just for the assertTx?

src/components/tx/DecodedTx/index.tsx Show resolved Hide resolved
Copy link

github-actions bot commented Sep 18, 2024

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: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

github-actions bot commented Sep 19, 2024

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: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

github-actions bot commented Sep 19, 2024

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: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@liliya-soroka
Copy link
Member

liliya-soroka commented Sep 19, 2024

any reason we moved approve at the top again ?
We moved approve under main information for the purpose some time ago - #3855
image

Copy link

github-actions bot commented Sep 20, 2024

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: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

@liliya-soroka
Copy link
Member

liliya-soroka commented Oct 25, 2024

Replace owner:
A new owner name is missing from the previous step
image

@francovenica
Copy link
Contributor

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

image

@francovenica
Copy link
Contributor

The issue is fixed:
image

LGTM

@clovisdasilvaneto clovisdasilvaneto merged commit aad2bb5 into dev Nov 1, 2024
15 checks passed
@clovisdasilvaneto clovisdasilvaneto deleted the chore/refactor-transaction-flow branch November 1, 2024 10:04
@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants