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

ENG-3797 ENG-3736 fix(portal): lists and claims back button and hook #805

Merged
merged 9 commits into from
Aug 30, 2024

Conversation

jonathanprozzi
Copy link
Member

@jonathanprozzi jonathanprozzi commented Aug 27, 2024

Affected Packages

Apps

  • portal

Packages

  • 1ui
  • api
  • protocol
  • sdk

Tools

  • tools

Overview

  • Refines the back button approach to go backwards through the history stack, including query params in the URL
  • Handles case where a user navigates via a fresh link to the route (no history) and navigates to a fallback. This is a bit slower due to the way we need to handle this -- if we don't care about this (default is goes back to a blank tab) we can remove this part of the hook. However, this allows us to keep users within the app when they click back on a fresh route
  • Creates a useGoBack hook to manage this logic

Screen Captures

In app navigation with query params:
in-app-nav-back-button

Landing on a page for the first time, such a from a link:
from-link-back-button

Declaration

  • I hereby declare that I have abided by the rules and regulations as outlined in the CONTRIBUTING.md

PR Summary by Typo

Summary:

  • New constant EXPLORE_CLAIMS added to paths.ts and new hooks useGoBack and state atoms addIdentitiesListModalAtom, imageModalAtom imported and used.
  • handleGoBack function added to ClaimDetails.tsx using useGoBack hook, and NavigationButton component modified to use handleGoBack and an onClick event listener.

Key Points:

  • In paths.ts, a new constant EXPLORE_CLAIMS is added.
  • In useGoBack.tsx, a new custom hook useGoBack is created, and in ClaimDetails.tsx, the handleGoBack function is added using this hook.
  • In ListDetails.tsx, useGoBack, useLiveLoader, addIdentitiesListModalAtom, and imageModalAtom hooks are imported and used. The NavigationButton component is modified to use the handleGoBack function and an onClick event listener.

Categories:

  • Constants: paths.ts
  • Hooks: useGoBack.tsx, useLiveLoader.tsx
  • State Management: addIdentitiesListModalAtom.ts, imageModalAtom.ts
  • Components: ClaimDetails.tsx, ListDetails.tsx
  • Files: apps/portal/app/consts/paths.ts, apps/portal/app/lib/hooks/useGoBack.tsx, apps/portal/app/lib/hooks/useLiveLoader.tsx, apps/portal/app/routes/app+/claim+/$id.tsx, apps/portal/app/components/ListDetails.tsx
To turn off PR summary, please visit Notification settings.

Copy link

linear bot commented Aug 27, 2024

ENG-3797 Back button from lists routes back to home, not the page I came from

When I click "View identities" on a list in the list view, I get taken to the list of identities (as I should), but when I click the back button from this list, I do not go back to where I was looking through all the lists, I get routed back to the homepage. If I was trying to search through lists to see what's interesting, this would be very very annoying. I just stopped looking through the lists after the second time.

image.png

ENG-3736 [Claims] Back Button Causes Crash

Description:
-Hitting the back button from a claims page takes me back to tutorial screen then infinite crash util I clear cache (this part only sometimes).

Attachments:

Screen Recording 2024-08-23 at 09.45.42.mov


// Test Lead Notes //

@github-actions github-actions bot added the fix Fix label Aug 27, 2024
@jonathanprozzi
Copy link
Member Author

@Vitalsine85 thanks for the approval on this the other day. I missed merging it in -- as long as this still works after any other changes the last few days we can get it in!

@jonathanprozzi
Copy link
Member Author

I think we can merge if it looked good for you!

@Vitalsine85 Vitalsine85 merged commit e0e2366 into main Aug 30, 2024
4 checks passed
@Vitalsine85 Vitalsine85 deleted the eng-3797-lists-back-button branch August 30, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants