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(Queue): add share block to transaction details #4838

Merged
merged 6 commits into from
Jan 30, 2025
Merged

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented Jan 27, 2025

What it solves

Improves transaction sharing

How this PR fixes it

Sharing a transaction can assist in signature requests, but the current share button is not super clear.

This adds a new share block to QUEUED MULTISIG transactions according to the designs

How to test it

Each of the following should emit distinctly labelled tracking events:

  1. Open a QUEUED MULTISIG transaction and observe the new share block, with a functioning copy button. When expanding it, an event should also be emitted.
  2. Ensure the existing copy button works and is present on all transaction types.

Screenshots

image

image

image

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) 🧑‍💻

@iamacook iamacook requested a review from tmjssz January 27, 2025 15:45
@iamacook iamacook self-assigned this Jan 27, 2025
Copy link

github-actions bot commented Jan 27, 2025

Copy link

Copy link

github-actions bot commented Jan 27, 2025

📦 Next.js Bundle Analysis for @safe-global/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 1.06 MB (🟡 +70.63 KB)
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!

Thirty-two Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/ 509 B (🟢 -1 B) 1.06 MB
/address-book 23.21 KB (🟡 +143 B) 1.08 MB
/apps 35.97 KB (🟡 +2.25 KB) 1.09 MB
/apps/custom 34.03 KB (🟡 +2.25 KB) 1.09 MB
/apps/open 55.56 KB (🟡 +1.95 KB) 1.11 MB
/balances 30.02 KB (🟡 +320 B) 1.09 MB
/balances/nfts 9.52 KB (🟢 -23 B) 1.07 MB
/bridge 2.55 KB (🟢 -5 B) 1.06 MB
/cookie 8.77 KB (🟡 +1 B) 1.07 MB
/home 61.54 KB (🟡 +2.28 KB) 1.12 MB
/licenses 2.46 KB (🟢 -1 B) 1.06 MB
/new-safe/advanced-create 26.38 KB (🟢 -75 B) 1.08 MB
/new-safe/create 25.52 KB (🟢 -67 B) 1.08 MB
/privacy 14.57 KB (🟡 +2 B) 1.07 MB
/settings/appearance 2.25 KB (🟡 +1 B) 1.06 MB
/settings/cookies 1.87 KB (🟡 +1 B) 1.06 MB
/settings/modules 4.06 KB (🟡 +3 B) 1.06 MB
/settings/notifications 6.33 KB (🟢 -14.98 KB) 1.06 MB
/settings/safe-apps 20.35 KB (🟡 +2.08 KB) 1.08 MB
/settings/security 2.34 KB (🟡 +2 B) 1.06 MB
/settings/setup 30.97 KB (🟡 +246 B) 1.09 MB
/share/safe-app 7.55 KB (🟢 -8 B) 1.07 MB
/stake 617 B (🟢 -2 B) 1.06 MB
/swap 763 B (🟡 +3 B) 1.06 MB
/terms 12.93 KB (🟡 +1 B) 1.07 MB
/transactions 99.45 KB (🟡 +2.88 KB) 1.15 MB
/transactions/history 99.41 KB (🟡 +2.88 KB) 1.15 MB
/transactions/messages 60.25 KB (🟡 +1.95 KB) 1.12 MB
/transactions/msg 56.5 KB (🟡 +1.95 KB) 1.11 MB
/transactions/queue 49.36 KB (🟡 +1.96 KB) 1.11 MB
/transactions/tx 48.72 KB (🟡 +1.95 KB) 1.11 MB
/welcome/accounts 408 B (🟡 +1 B) 1.06 MB
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 Jan 27, 2025

Coverage report for apps/web

St.
Category Percentage Covered / Total
🟡 Statements
77.47% (-0.02% 🔻)
13875/17911
🔴 Branches
56.8% (-0.03% 🔻)
3492/6148
🟡 Functions
62.76% (-0.06% 🔻)
2086/3324
🟡 Lines
78.89% (-0.02% 🔻)
12519/15869
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / TxShareButton.tsx
80% 100% 0% 80%
🟡
... / TxShareBlock.tsx
60% 0% 0% 60%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟡
... / index.tsx
69.64% (+0.55% 🔼)
10% (-0.26% 🔻)
66.67%
70.37% (+0.56% 🔼)
🟡
... / index.tsx
64.29% (-4.46% 🔻)
0% 0%
69.23% (-4.1% 🔻)
🟢
... / useTxPendingStatuses.ts
77.5% (-0.83% 🔻)
64.06% (-1.56% 🔻)
68.18%
86.41% (-0.97% 🔻)

Test suite run success

1783 tests passing in 240 suites.

Report generated by 🧪jest coverage report action from 20df0b7

<Paper className={css.wrapper}>
<Accordion className={css.accordion}>
<AccordionSummary expandIcon={<ExpandMoreIcon />} className={css.summary}>
<Typography className={css.header}>Share link with other owners</Typography>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<Typography className={css.header}>Share link with other owners</Typography>
<Typography className={css.header}>Share link with other signers</Typography>

We've been calling them signers throughout the UI.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated in fe946dd.

@iamacook iamacook requested a review from katspaugh January 28, 2025 08:03
</AccordionDetails>
</Accordion>
<div className={css.copy}>
<TxShareLink id={txId} event={TX_LIST_EVENTS.COPY_SHARE_LINK}>
Copy link
Member Author

Choose a reason for hiding this comment

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

Should this instead be the same event as the button, using a label to differentiate? cc @katspaugh

Copy link
Member

Choose a reason for hiding this comment

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

I would keep a separate event.

Choose a reason for hiding this comment

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

Actually the way we've been organising events lately is that each action is linked to a single event, and we use labels to differentiate where the action is done. How this would apply in this case is having an event (e.g. "copy share link") with labels to distinguish between "icon" and "button".

No strong feelings though - so leaving this up to you.

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed it to use the same event ("Copy deeplink") in 20df0b7 with different labels: button and share-block. The "Open share block" remains though.

Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

@tmjssz tmjssz left a comment

Choose a reason for hiding this comment

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

LGTM! Just left a small suggestion

Copy link
Collaborator

Choose a reason for hiding this comment

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

This component is only used internally by TxShareBlock/Button right? So maybe as a suggestion we could rename the file to its component name and not be index anymore. Just for consistency, but not blocking

Copy link
Member Author

Choose a reason for hiding this comment

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

TxShareLink is a wrapper for TxShareBlock and TxShareButton. We could separate them into independant components but I think keeping them together with the wrapper makes sense. What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah all good then, lets keep them together

@liliya-soroka
Copy link
Member

liliya-soroka commented Jan 30, 2025

Verified
Checked cases:

  1. Tracking
  2. not executed txs in different states of signing
  3. executed txs
  4. nested safes
  5. Chrome, Firefox
  6. Mobal view
  7. diff themes
  8. queued/history and tx details
  9. proposed txs
    --
    Test cases were created- https://gno.testrail.io/index.php?/suites/view/36&group_by=cases:section_id&group_id=7002&group_order=asc&display_deleted_cases=0

The task to add automation was created - https://github.com/safe-global/safe-test-management/issues/17

@iamacook iamacook merged commit 61db942 into dev Jan 30, 2025
15 checks passed
@iamacook iamacook deleted the share-block branch January 30, 2025 12:59
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2025
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