Skip to content

Conversation

@Viterbo
Copy link
Contributor

@Viterbo Viterbo commented Jan 26, 2023

Fixes #293

Description

When you find a special transaction from the table and you follow the link and then come back to the table, the pagination is lost and you must start from the first page again which leads to a terrible user experience.

This PR makes the table save in local storage the last pagination state and recovers it every time the table is used again.

Test scenarios

To recreate this new behavior you must:

  • go to the home page
  • change the current page and the page size
  • follow the link of any of the listed transaction
  • press the Back button of your browser.
  • the table should recover the last pagination state

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have cleaned up the code in the areas my change touches
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings
  • I have removed any unnecessary console messages

@Viterbo Viterbo linked an issue Jan 26, 2023 that may be closed by this pull request
@netlify
Copy link

netlify bot commented Jan 26, 2023

Deploy Preview for dev-mainnet-teloscan ready!

Name Link
🔨 Latest commit d26b1bc
🔍 Latest deploy log https://app.netlify.com/sites/dev-mainnet-teloscan/deploys/63d7b6c7728101000883bbf4
😎 Deploy Preview https://deploy-preview-336--dev-mainnet-teloscan.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Jan 26, 2023

Deploy Preview for teloscan-stage ready!

Name Link
🔨 Latest commit d26b1bc
🔍 Latest deploy log https://app.netlify.com/sites/teloscan-stage/deploys/63d7b6c74bb01700098ad456
😎 Deploy Preview https://deploy-preview-336--teloscan-stage.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@Viterbo Viterbo self-assigned this Jan 26, 2023
@Viterbo Viterbo added the 🎯 Feature New feature label Jan 26, 2023
Copy link
Contributor

@donnyquixotic donnyquixotic left a comment

Choose a reason for hiding this comment

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

We should handle this in the router by incorporating query/filter params as part of routing (e.g. /<address>?page=3 ) to track pagination instead of using state. This allows history tracking and avoids unintended behavior. For instance, If you navigate to a different page and click on an address in the table, the page state is applied where it shouldn't be.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 30, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: d26b1bc
Status: ✅  Deploy successful!
Preview URL: https://00fc1722.teloscan.pages.dev
Branch Preview URL: https://293-facilitate-user-navigati-7ao3.teloscan.pages.dev

View logs

Copy link
Contributor

@ezra-sg ezra-sg left a comment

Choose a reason for hiding this comment

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

nice, this works great

@donnyquixotic donnyquixotic merged commit de0cffa into dev Jan 30, 2023
@donnyquixotic donnyquixotic deleted the 293-facilitate-user-navigation-by-keeping-track-of-where-they-were-1 branch January 30, 2023 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎯 Feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Facilitate user navigation by keeping track of where they were

4 participants