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: redesign send rpc transfer flow #6000

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

alter-eggo
Copy link
Contributor

@alter-eggo alter-eggo commented Dec 9, 2024

Try out Leather build 699bf7dExtension build, Test report, Storybook, Chromatic

redesign rpc send transfer using approver ux

Copy link
Collaborator

@kyranjamie kyranjamie left a comment

Choose a reason for hiding this comment

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

Great work @alter-eggo, leaving some comments.

I'll merge my PR now, which has some of the changes to focusTab helper you can use here

src/app/common/focus-tab.ts Outdated Show resolved Hide resolved
Comment on lines 119 to 120
titleLeft: capitalize(type),
captionLeft: time,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't these presentation/formatting concerns be directly in component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we will use it in other bitcoin flows as well, so prefer keep in this file, though took it out of fees hook

src/app/components/error/form-error.tsx Outdated Show resolved Hide resolved
src/app/components/fees/fee-item-icon.tsx Outdated Show resolved Hide resolved
src/app/pages/rpc-send-transfer/rpc-send-transfer.tsx Outdated Show resolved Hide resolved
src/app/pages/rpc-send-transfer/rpc-send-transfer.tsx Outdated Show resolved Hide resolved
@alter-eggo alter-eggo force-pushed the feat/redesign-send-transfer branch from b4cd122 to 7489cae Compare December 11, 2024 12:31
@alter-eggo alter-eggo marked this pull request as ready for review December 11, 2024 12:52
@@ -1,34 +1,245 @@
import { useMemo, useState } from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you can use a .layout file to help split this up between logic and presentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

don't understand how to split tbh and why need? what should be in .layout?

Copy link
Collaborator

@kyranjamie kyranjamie Dec 12, 2024

Choose a reason for hiding this comment

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

There are components with many style props, can't they be in a layout component?

In getAddresses the entire Approver component is in the layout, such that the root RPC compoent can be focused on business logic/event passing behaviours, and not layout and styles.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looking at this file I believe main problem here is with huge approve logic. I will try to move this to sep file.
actually we'll need this in other bitcoin related flows as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same with selected fee

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and prob then will be way easier to move it to layout file. will try

Copy link
Contributor

@pete-watters pete-watters left a comment

Choose a reason for hiding this comment

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

Great work here @alter-eggo 🚀 huge PR!

I added a few suggestions but looking good to me overall

@alter-eggo alter-eggo force-pushed the feat/redesign-send-transfer branch 2 times, most recently from 0703d98 to b1af26d Compare December 11, 2024 23:08
Copy link
Contributor

@fbwoolf fbwoolf left a comment

Choose a reason for hiding this comment

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

Nice work @alter-eggo! I migrated some of the bitcoin fees code to the mono repo for mobile. I have an issue open to install it back into the extension to make sure it is shared, but that can come later.

feeType: type,
feeRate: feeRate ?? 0,
baseUnitsValue: baseUnitsFeeValue ?? 0,
titleLeft: capitalize(type),
Copy link
Collaborator

@kyranjamie kyranjamie Dec 12, 2024

Choose a reason for hiding this comment

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

Building on earlier comment, why don't we do the capitalize in the view too? How we format/present data is a concern of the UI so better lives where it's set to a component.

My thinking is that if I as a dev need to go and make visual changes, they can be mostly scoped to a set of .layout components. But in this file, we have a mix of mathematics and formatting, that I can't help but feel should live separately.

e.g. <style.span>{capitalize(type)}</styled.span>

Then, the utils file knows nothing about where (titleLeft), or how (capitalised), the data needs to be displayed, focusing on accurate data only.

What's your thinking for putting it here, and are there reasons I'm missing why it's beneficial to group it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to do FeeItem as dumb as possible, so general idea here was to gen and pass ready to use parts of the fee component, title/caption left/right

yeah, maybe better to capitalize in component itself, and so remove titleLeft, I just thought it would be better to keep all these parts in one place.

so in stx I can do the same - get raw fee => then gen ready to use parts of fee component

Then, the utils file knows nothing about where (titleLeft), or how (capitalised), the data needs to be displayed, focusing on accurate data only.

if not utils so what's the best place to keep it? other way btw - create bitcoin fee wrapper for shared fee item and keep this logic there

@markmhendrickson
Copy link
Collaborator

markmhendrickson commented Dec 12, 2024

Looking good! Some QA feedback:

  • App favicon isn't showing up in the header
  • "Total spend" doesn't include the fee amount
  • Guide URL takes user to https://leather.io/guides/connect-dapps instead of a relevant guide for sending BTC via an app
  • Do we want to say "Send bitcoin" instead of "Send BTC"? cc @fabric-8 @mica000
  • I'd suggest some additional design QA (by a designer) to double check text styling / sizes, padding, etc.
  • Header for edit fee screen has unexpected top and bottom padding in beige

image
image

@alter-eggo alter-eggo force-pushed the feat/redesign-send-transfer branch from b1af26d to 699bf7d Compare December 13, 2024 13:51
@fabric-8
Copy link
Contributor

Looking great, only some minor feedback:

CleanShot 2024-12-13 at 15 56 38@2x

  • animal icon stroke width are too thin, should generally be same as for the other icons. Maybe they are getting scaled because there's a mismatch of height/width it needs (32x32) vs. actual size after some... padding is applied? If I can help by adjusting the asset lmk, the animation icons are 32x32 vs. 24x24, if turning them into 24x24 fixes this issue I can do it

CleanShot 2024-12-13 at 15 54 43@2x

  • Since were are using the > to indicate that the user can interact with the item (like for account on top), I think we should also add the > to fee settings for consistency cc @mica000

CleanShot 2024-12-13 at 16 01 53@2x

  • Realising that "cancel" in fee settings might get misinterpreted to "cancel the whole approval thing" - Maybe using the word "back" would be better here? cc @markmhendrickson

  • Let's add border-top: 1px solid ink.border-default to the footer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants