Skip to content

Conversation

@toy
Copy link
Contributor

@toy toy commented Dec 19, 2025

Currently navigating through documentation sometimes leads to duplicate history entries, also when navigating back to documentation page either from another documentation page or from different site, pushState not only add additional entry, but also removes all history in front.

Ensuring that pushState is done only if new url is not equal current resolves this. I see only one quirky downside - it is not possible to create multiple history entries by navigating to same documentation page.

Steps to reproduce:

  1. Goto https://github.com/Authress-Engineering/openapi-explorer
  2. Navigate to the demo using link OpenAPI Explorer Demo
  3. Check history
    • Expected last history entry to be the github page
    • Instead there are 2 entries of demo page after the github page
  4. Navigate back 3 times (until github page)
  5. Navigate forward
    • Same expecation about last history entry to be the github page and instead having 2 entries of demo page
  6. Click Authentication link in the menu
  7. Navigate back
  8. Try to navigate forward
    • Expected to have a history entry in front with Authentication page
    • Instead no history entry, so not possible to navigate forward to it
  9. Navigate outside of documentation either by clicking Sign up for Authress at the bottom or typing a new url (e.g. example.com)
  10. Navigate back
  11. Try to navigate forward

Thank you @cbliard for discovering it opf/openproject#21484 (review)

Currently navigating through documentation sometimes leads to duplicate
history entries, also when navigating back to documentation page either
from another documentation page or from different site, pushState not
only add additional entry, but also removes all history in front.

Ensuring that pushState is done only if new url is not equal current
resolves this. I see only one quirky downside - it is not possible to
create multiple history entries by navigating to same documentation
page.
@wparad wparad merged commit 55a2d81 into Authress-Engineering:release/2.4 Dec 19, 2025
2 checks passed
@toy toy deleted the fix-duplicate-history branch December 19, 2025 20:35
toy added a commit to opf/openproject that referenced this pull request Dec 19, 2025
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.

2 participants