Page MenuHomePhabricator

[Cashtab] Tx Hisotry collapse
AbandonedPublic

Authored by kieran709 on Feb 16 2022, 19:41.

Details

Reviewers
bytesofman
emack
johnkuney
Group Reviewers
Restricted Project
Summary

Tapping a tx in tx history extends a collapse which reveals: a link to the tx that opens the block explorer in a new tab and a copy txid button which fires a notification when the txid has been copied to the user's clipboard. Related to task T1774.

Test Plan

cd web/cashtab
npm start
on the main wallet tab, click on a transaction
onClick, the tx card should expand, revealing a link to the tx on the block explorer>
click on the link, it should open the block explorer in a new tab
click on the Copy Txid button, it should fire a success notification
paste the txid somewhere to ensure it was copied to the clipboard.
send XEC, check that the new transaction panel expands on click
receive XEC, check that the new transaction panel expands on click

Diff Detail

Repository
rABC Bitcoin ABC
Branch
tx-history-dropdown
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 18366
Build 36534: Build Diffcashtab-tests
Build 36533: arc lint + arc unit

Event Timeline

kieran709 updated this revision to Diff 32410.

updated snapshots

emack requested changes to this revision.Feb 17 2022, 11:34
emack added a subscriber: emack.

image.png (244×476 px, 12 KB)

From an UX perspective, the copy tx ID button isn't obvious enough that it's copying the Tx ID and not other fields until the user clicks on it. Once we start adding other copy to clipboard buttons for things like the OP_RETURN message then this will be even more confusing. Perhaps change the icon to something like the below?
image.png (43×48 px, 726 B)

And then going forward when we add the copy msg button it can be a similar copy icon but with 'msg' on it.

web/cashtab/src/components/Home/Tx.js
325 ↗(On Diff #32410)

Move this to '@components/Common/Notifications.js' and rename this to GeneralNotification that takes in (data, msgStr), where msgStr is the message to be displayed in the notification, e.g. 'Tx ID copied to Clipboard', 'Message copied to Clipboard'...etc.
This way it can be reused everywhere else in Cashtab and serve multiple purposes.

327 ↗(On Diff #32410)

message: 'Tx ID copied to Clipboard',

This revision now requires changes to proceed.Feb 17 2022, 11:34

Responded to review feedback, rebased and updated snapshots.

emack requested changes to this revision.Feb 19 2022, 02:44
emack added inline comments.
web/cashtab/src/components/Common/Notifications.js
174 ↗(On Diff #32436)

Notifications need to be dynamically styled for margin depending on device. Similar to other notifications, add in:

const notificationStyle = getDeviceNotificationStyle();

and then use ' style: notificationStyle, ' within notification.success

web/cashtab/src/components/Home/Tx.js
294–316 ↗(On Diff #32436)

Since this diff will be introducing this contextual collapse UI for the first time, we'll want this to be reusable by other components to ensure UI/UX consistency across future diffs.

Can you move this (and any relevant styling) into the StyledCollapse component and insert 'context' into the name (e.g. AntdContextCollapseWrapper) to differentiate it from the existing dropdown collapse UI for seed phrase reveal, saved wallets... etc.

This revision now requires changes to proceed.Feb 19 2022, 02:44

responded to review feedback, rebased & updated snapshots

First level review is green, just wait for @bytesofman input before landing.

This revision is now accepted and ready to land.Feb 22 2022, 03:02
johnkuney requested changes to this revision.EditedFeb 22 2022, 21:55
johnkuney added a subscriber: johnkuney.

Overall looks good, but looks like there is some extra space now on the rows when collapsed

space.jpg (2×2 px, 929 KB)

And I would suggest adding some text too, moving to the right, and make icons smaller. Same font size as the gray font in the transaction info

And maybe have the copy transaction link blue on hover, and the explorer link be.cash pink #f84970 on hover

design-suggestion.jpg (2×2 px, 845 KB)

This revision now requires changes to proceed.Feb 22 2022, 21:55

Responding to review feedback.

image.png (99×467 px, 9 KB)

  1. Please make the :hover colors the same for each link
  2. See if you can get the :hover effect to also apply to the icons
  3. Play with the line height / padding to get a better aesthetic alignment between the text and the icons. The copy paste icon looks much lower than the "Copy Tx ID" text.

image.png (24×222 px, 3 KB)

This revision now requires changes to proceed.Feb 25 2022, 19:13

Responding to review feedback.

bytesofman added inline comments.
web/cashtab/src/components/Home/Tx.js
346

in React, must use className="antd-collapse"

701

in React, must use className=

716

in React, must use className=

web/cashtab/src/components/Home/TxHistory.js
10

You need a unique key prop in react; preserve key={tx.txid} from before

This revision now requires changes to proceed.Feb 25 2022, 21:54