Make each tool on /tools linkable via ?tool= - #762
Merged
Conversation
The selected tool lived in React state, so it could not be linked to, a refresh dropped you back on the converter, and Back did not undo a tab switch. The query string is the source of truth now. Tab ids double as the slug, so `payment` is `payment-request` and `decoder` is `address-decoder`. The page renders per request so a shared link serves the right tool instead of swapping to it after hydration.
shadowosx
force-pushed
the
tools-url-state
branch
from
August 30, 2026 00:49
1061d54 to
d92ca40
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Right now the open tool lives in React state, so you cannot link to one. Sharing the Address Decoder means telling someone to open /tools and click the fourth tab, a refresh drops them back on the converter, and Back does not undo a tab switch.
The query string is the source of truth now:
Missing or unknown values fall back to the converter, as today.
Two things to look at in the diff:
Tab ids are the slugs, so
paymentbecamepayment-requestanddecoderbecameaddress-decoder. Internal before, public URLs from here./toolsisforce-dynamic. Prerendered it has no query string to read, so a shared link would render the converter and only swap after hydration. There is no data fetching on the page, so it is only the render. Tab clicks still usehistory.pushStaterather than the router, so switching stays instant and Back/Forward still get real history entries.e2e/tools-url.spec.tscovers deep links, an unknown slug, refresh, Back/Forward through three tabs, and/es/toolskeeping its prefix. Six tests, all green againstyarn build && yarn start. It readsTOOLS_BASE_URLthe wayegress.spec.tsreadsEGRESS_BASE_URL.Also walked it by hand in the browser in English and Spanish, including that clicking the tab you are already on does not pile up history entries.