safe-global / safe-wallet-web

Safe{Wallet} – smart contract wallet for Ethereum (ex-Gnosis Safe multisig)
https://app.safe.global
GNU General Public License v3.0
311 stars 360 forks source link

Display swap info on sent/receive events [SW-3] #3877

Closed compojoom closed 3 days ago

compojoom commented 1 week ago

What it solves

Displays swap info on sent/receive events

How to test it

sent/receive events that are created in response to a swap order should display additional info about the swap

grafik

Checklist

notion-workspace[bot] commented 1 week ago

Display Order Information on Sent/Receive TXs

github-actions[bot] commented 1 week ago

Branch preview

✅ Deploy successful!

Website: https://sent_receive_swaps--walletweb.review.5afe.dev/home?safe=eth:0xA77DE01e157f9f57C7c4A326eeE9C4874D0598b6

Storybook: https://sent_receive_swaps--walletweb.review.5afe.dev/storybook/

github-actions[bot] commented 1 week ago

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

Report generated by eslint-plus-action

github-actions[bot] commented 1 week ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟡 Statements
78.75% (-0.05% 🔻)
11389/14462
🔴 Branches
58.02% (-0.09% 🔻)
2755/4748
🟡 Functions
65.73% (-0.05% 🔻)
1828/2781
🟢 Lines
80.13% (-0.05% 🔻)
10264/12809
Show files with reduced coverage 🔻
|
St.:grey_question:
| File | Statements | Branches | Functions | Lines | | :-: | :- | :- | :- | :- | :- | | 🟢 |
`...` / transaction-guards.ts
|
78.75% (-0.23% 🔻)
|
53.19% (+2.08% 🔼)
|
78.43% (+0.43% 🔼)
|
80.73% (+0.36% 🔼)
| | 🟢 |
`...` / index.tsx
|
82.35% (-8.82% 🔻)
|
66.67% (-16.67% 🔻)
|
50% (-12.5% 🔻)
|
83.87% (-9.68% 🔻)
| | 🟡 |
`...` / useTransactionType.ts
| 68.42% |
40% (-1.03% 🔻)
| 100% | 69.44% | | 🟡 |
`...` / index.tsx
| 74.55% |
16.13% (-0.54% 🔻)
| 66.67% | 75.47% | | 🔴 |
`...` / index.tsx
|
37.36% (-0.27% 🔻)
| 0% | 0% |
39.53% (-0.24% 🔻)
| | 🔴 |
`...` / index.tsx
|
50% (-8.82% 🔻)
| 0% | 0% |
54.17% (-12.5% 🔻)
|

Test suite run success

1413 tests passing in 195 suites.

Report generated by 🧪jest coverage report action from d6998344abdc6cfe016a85055925ef7de8358466

github-actions[bot] commented 6 days ago

📦 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 1000.17 KB (🟡 +71 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!

Six 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/open 53.43 KB (🟡 +117 B) 1.03 MB
/transactions 73.42 KB (🟡 +117 B) 1.05 MB
/transactions/history 73.39 KB (🟡 +117 B) 1.05 MB
/transactions/messages 37.93 KB (🟡 +117 B) 1.01 MB
/transactions/queue 31.01 KB (🟡 +117 B) 1.01 MB
/transactions/tx 20.77 KB (🟡 +117 B) 1020.94 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.

francovenica commented 6 days ago

For me the "filled" field with the green bar and % is not necesary for the "Parts transactions", since those can be filled 100% or not at all, there is no in between, since if you don't have enough funds to fullfill a part (like you send tokens from your safe to another place, leaving your safe with not enough funds) the system will tell you that the order cannot be filled until you top it up image

image

So in my opinion, that field is irrelevant in the different orders.

It IS relevant tho, in the main TWAP tx (the one with nonce), since that one actually show the % of how many orders have been fullfilled

compojoom commented 3 days ago

Thanks @francovenica ! Yes, Usame and I had the same discussion and we agree with you. I don't want to do this in this PR as we have a lot of other things on our plate. I've made an issue for https://www.notion.so/safe-global/Make-order-components-view-aware-5e1ee21d5ff145c795308524d7ed80bd and we'll tackle this in the next release.