This PR adds route-level support for shared Split Calculator links in the StellarSplit frontend. It introduces a dedicated /calculator page and a shared-state parser so exported calculator links can round-trip through the router and restore state when valid payloads are present.
- #493 Split Calculator Deep-Link Route Support
frontend/src/components/SplitCalculator/SplitCalculator.tsxcurrently exports share links under/calculator?data=...- The React router did not mount a real
/calculatorroute - There was no hydration path for shared calculator state on page reload or incoming links
-
frontend/src/pages/SplitCalculatorPage.tsx- New routed calculator page
- Reads
datafrom URL search parameters - Decodes shared calculator payloads
- Displays fallback messaging for invalid or malformed payloads
- Passes hydrated state into
SplitCalculator
-
frontend/src/utils/calculatorShare.ts- Isolated shared-state encoding and decoding logic
- Builds URL-safe share links
- Handles invalid payloads gracefully
-
frontend/src/main.tsx- Added a real
/calculatorroute for the routed calculator page
- Added a real
-
frontend/src/components/SplitCalculator/SplitCalculator.tsx- Added support for
initialState - Uses shared-state URL builder/decoder flow
- Added support for
- Added tests in
frontend/src/utils/calculatorShare.spec.ts - Added tests in
frontend/src/pages/SplitCalculatorPage.spec.tsx - Verified:
- valid share links hydrate calculator state
- invalid payloads render fallback messaging
- route hydration works after reload
- Shared calculator links resolve to a real
/calculatorroute - Valid
?data=...payloads restore calculator state - Invalid or malformed payloads fall back to default state with a warning
This change makes calculator sharing more reliable and maintainable by isolating payload logic from UI and routing concerns.