Skip to content

BUGFIX: resolve-route-and-navigate! drops params on cross-chart targets#31

Open
awkay wants to merge 1 commit intomainfrom
fix/cross-chart-params-issue-30
Open

BUGFIX: resolve-route-and-navigate! drops params on cross-chart targets#31
awkay wants to merge 1 commit intomainfrom
fix/cross-chart-params-issue-30

Conversation

@awkay
Copy link
Copy Markdown
Member

@awkay awkay commented Apr 5, 2026

Summary

Fixes #30.

  • decode-url in the transit codec now returns {:params ...} even when the leaf segment does not match a local route element (cross-chart targets). Previously the (when leaf-id ...) guard discarded parsed params entirely.
  • resolve-route-and-navigate! now branches on :leaf-id instead of the whole decoded map, and passes decoded params through in the fallback (deep-search) navigation path.
  • No breaking changes for custom URLCodec implementations — codecs that still return nil on no-match work identically because (:leaf-id nil) and (:params nil) are both nil.

Test plan

  • All 297 CLJ tests pass (1413 assertions, 0 failures)
  • Routing codec round-trip tests in simulated_history_spec pass
  • Custom codec test in url_sync_headless_spec unaffected (backwards compatible)
  • Manual: refresh browser on a cross-chart route with URL params, verify params survive

🤖 Generated with Claude Code

…ts (#30)

When decode-url could not match a leaf to a local route element (cross-chart
target), the fallback branch discarded URL query params. Fixed by returning
params from the codec even without a leaf match, and passing them through
in the fallback navigation path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

resolve-route-and-navigate! drops params on cross-chart targets

1 participant