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

Open UserHub on pending button click #2867

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

chmanie
Copy link
Member

@chmanie chmanie commented Aug 5, 2024

Description

This PR tries to solve the UserHub opening/closing issues by just using a single state for the visibility of the UserHub. This sadly makes things a little more complicated but there are ambitions to try to solve these issues on the UX side of things (using an improved Modal flow).

For now this should do it. We got rid of the dual state and of the ominous data-openhubifclicked attribute by adding some state management wizardry. We basically set the tab that should open in the UserHub from outside and then reset it once it's visible.

Testing

  1. Try to have a pending TX (e.g. use MetaMask and don't confirm)
  2. Click the pending TX button and hope that the UserHub opens, showing the transactions list
  3. Click outside the UserHub, it should close
  4. Also click some other buttons within the UserHub (e.g. Activate tokens) and check if it behaves like it does on master.

Diffs

Changes 🏗

  • Fix UserHub open state

Resolves #2834

@chmanie chmanie requested review from a team as code owners August 5, 2024 15:39
iamsamgibbs
iamsamgibbs previously approved these changes Aug 6, 2024
Copy link
Contributor

@iamsamgibbs iamsamgibbs left a comment

Choose a reason for hiding this comment

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

Nicely done Chris! This is much nicer to work with than before.

Tested the pending transaction:

Screen.Recording.2024-08-06.at.10.41.26.mov

Also tested it on mobile and if a failed transaction still automatically opens the userhub which is working great:

Screen.Recording.2024-08-06.at.10.46.56.mov

This is the only issue that stood out to me, it is very slow closing the userhub after the activate / withdraw modal is opened:

Screen.Recording.2024-08-06.at.10.42.35.mov

But I just checked this on QA and it is behaving the same there - not sure if there is anything simple that can be done here to improve this, but can leave it for another time as it already exists on master.

Unrelated to this PR, but I also noticed this issue when closing the userhub on mobile if you have the action sidebar open:

Screen.Recording.2024-08-06.at.10.46.38.mov

@@ -5,13 +5,15 @@ import React, {
type PropsWithChildren,
useCallback,
useEffect,
useState,
// useState,
Copy link
Contributor

@iamsamgibbs iamsamgibbs Aug 6, 2024

Choose a reason for hiding this comment

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

This comment can go

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed the comment and rebased, maybe you could re-approve?

@chmanie chmanie force-pushed the fix/2834-pending-button-opens-tx branch from 893b04e to 033ff17 Compare August 6, 2024 10:33
iamsamgibbs
iamsamgibbs previously approved these changes Aug 6, 2024
Copy link
Collaborator

@jakubcolony jakubcolony left a comment

Choose a reason for hiding this comment

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

Thanks for bringing some sanity to the UserHub @chmanie!

The pending button now works flawlessly - I can click on any element of the button and it opens the transactions tab:

Screen.Recording.2024-08-06.at.20.54.58.mov

I noticed however the Completed button no longer triggers the UserHub, which is different to production:

Screen.Recording.2024-08-06.at.21.06.26.mov

If you consider this a separate issue, ping me and I'll re-approve the pending button fix.

@chmanie
Copy link
Member Author

chmanie commented Aug 7, 2024

I noticed however the Completed button no longer triggers the UserHub, which is different to production

Ah no worries, I'll fix this!

@chmanie chmanie force-pushed the fix/2834-pending-button-opens-tx branch from 033ff17 to 653c3a6 Compare August 7, 2024 08:15
@chmanie
Copy link
Member Author

chmanie commented Aug 7, 2024

@jakubcolony sorted.

Copy link
Contributor

@iamsamgibbs iamsamgibbs left a comment

Choose a reason for hiding this comment

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

Tested the fix, all good!

Copy link
Member

@rdig rdig left a comment

Choose a reason for hiding this comment

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

Works as advertised. Clicking on the pending pill brings up the correct transactions. Nicely done Chris!

Screencast.from.2024-08-07.23-52-19.webm

However I found two edge cases (although they should be considered separatedly)

  • cancelling a action and not cancelling metamask will keep a pill active, and if clicking on it will redirect you to an action that doesn't exist / 404 (this is really edgy, I really don't think this will show up in a live environment ever)
  • cancelling metamask, or failing a transaction in some other way will add a failed transaction to the list. Clicking that failed transaction will bring you to a 404 page again. I think this can be easily replicated so I definitely think this needs to be fixed
Screencast.from.2024-08-07.23-53-33.webm

@chmanie
Copy link
Member Author

chmanie commented Aug 7, 2024

@rdig The 404 thing is tracked by @arrenv somewhere I just couldn't find it. Feel free to open an issue for the first bug, that sounds like a bit of an explorational task

Copy link
Collaborator

@jakubcolony jakubcolony left a comment

Choose a reason for hiding this comment

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

The Completed button triggers the user hub now, nice one @chmanie 💯

@chmanie chmanie merged commit dc1f3a1 into master Aug 8, 2024
4 of 6 checks passed
@chmanie chmanie deleted the fix/2834-pending-button-opens-tx branch August 8, 2024 10:20
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.

Pending button no longer opens transaction tab
4 participants