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

Fix browser back button behavior in jbrowse-web #4052

Merged
merged 2 commits into from
Nov 8, 2023
Merged

Conversation

cmdcolin
Copy link
Collaborator

@cmdcolin cmdcolin commented Nov 8, 2023

The URL manipulations we do in jbrowse-web are based on URL query params, but the default of the query param manipulation effectively used "pushState" (https://developer.mozilla.org/en-US/docs/Web/API/History/pushState) instead of "replaceState" (https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState)

this was managed by the library we used (use-query-params), but this PR changes it to use replace instead now. This allows the browser back button to work more intuitively I think now

Fixes #1128

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Nov 8, 2023
@cmdcolin cmdcolin changed the title Change url parameter manipulation to 'replace' instead of 'push' so browser back button is unaffected in jbrowse-web Fix browser back button behavior in jbrowse-web Nov 8, 2023
@cmdcolin cmdcolin added bug Something isn't working and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Nov 8, 2023
@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Nov 8, 2023

note that the linked issue mentions linking 'browser back button' to actual in-app 'undo/redo' functionality, but this PR is a little unrelated: the current 'browser back button' behavior was more effectively a do-nothing because it was filled by various 'garbage pushState updates'

@cmdcolin cmdcolin merged commit aaed7a9 into main Nov 8, 2023
@cmdcolin cmdcolin deleted the replace_urlparam branch November 8, 2023 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Currently back button changes session URL back but does not update state
1 participant