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

chore: stop increase fee being cutoff when long contract name #5197

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

pete-watters
Copy link
Contributor

@pete-watters pete-watters commented Apr 10, 2024

Try out Leather build 8a11d05Extension build, Test report, Storybook, Chromatic

This PR adds ellipsis to the contract name caption to stop it moving the Increase Fee button out of view for long contract names

#5173

@pete-watters pete-watters self-assigned this Apr 10, 2024
@pete-watters pete-watters added the bug-p3 Non-critical functionality broken for many users, or there are clear workarounds label Apr 10, 2024
@pete-watters pete-watters linked an issue Apr 10, 2024 that may be closed by this pull request
@pete-watters pete-watters force-pushed the fix/5173/increase-fee-cut-off branch from 57c417f to e3a6529 Compare April 10, 2024 15:38
@pete-watters pete-watters requested a review from fbwoolf April 10, 2024 15:38
@pete-watters
Copy link
Contributor Author

@fbwoolf - I pushed one more commit to solve this issue

I also switched from a styled.button to a styled.div to try and fix a run time error about invalid nesting. I did fix it but it's still throwing the runtime error, I think as we are using tooltip inside of interactive item. The tooltip trigger is a button so I'm not sure if we can do much there (writing so I don't forget)

Screenshot 2024-04-10 at 15 19 23

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.

Think this is the wrong solution. It is an interactive element so it should be a button.

Why not just overlay the button on top, by absolutely positioning it on top the TransactionItemLayout element, instead of using the rightElement prop?

@fbwoolf
Copy link
Contributor

fbwoolf commented Apr 10, 2024

Yeah, this was the issue with doing the Pressable component as an actual button, but we did decide to go with it and will need to use positioning to remove the warning.

@pete-watters
Copy link
Contributor Author

I tried doing this but it sent me down a rabbit hole changing lots of things. I can move the Increase Fee button but using absolute position moves it outside of the main container.

Adding more divs with flex and we end up losing the onHover style of the full pressable row which I tried to cobble together but it looks awful:
Screenshot 2024-04-11 at 06 43 46

Even if I do get that looking OK, I will still need to fix two more things as we have fields inside of <Pressable that are using Radix.Tooltip which inherently uses a button as it's trigger, even if you pass asChild to it.

To get rid of this warning I'll need to refactor the TransactionTitle + BitcoinTransactionStatus both of which use BasicTooltip here.

The structure is something like this:

<button // Pressable
    rightElement={<button> // Increase fee}
    ...
    txStatus={<button> // Tooltip}
    txTitle{<button> // Tooltip}
/>   

Even if I do that, I also noticed that the tooltips don't fire at all when inside of Pressable as the pressable CSS prevents them from showing:

Area.mp4

TLDR
I'll roll back my change to styled.button and merge this to fix the visual bug and open another issue for the runtime error

@pete-watters pete-watters force-pushed the fix/5173/increase-fee-cut-off branch from e3a6529 to 8a11d05 Compare April 11, 2024 06:02
@pete-watters
Copy link
Contributor Author

Created this issue for problem with tooltips and to fix the nested button runtime error

@pete-watters pete-watters added this pull request to the merge queue Apr 11, 2024
Merged via the queue into dev with commit dc8c8e4 Apr 11, 2024
28 checks passed
@pete-watters pete-watters deleted the fix/5173/increase-fee-cut-off branch April 11, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-p3 Non-critical functionality broken for many users, or there are clear workarounds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Increase Fee gets cut off
3 participants