Skip to content

fix(routing): resolve direct/path-based deep links to hash routes#676

Open
Zhekinmaksim wants to merge 1 commit into
genlayer-foundation:devfrom
Zhekinmaksim:fix/614-hash-routing-deep-links
Open

fix(routing): resolve direct/path-based deep links to hash routes#676
Zhekinmaksim wants to merge 1 commit into
genlayer-foundation:devfrom
Zhekinmaksim:fix/614-hash-routing-deep-links

Conversation

@Zhekinmaksim
Copy link
Copy Markdown

Closes #614.

The portal uses hash-based routing (svelte-spa-router), but several sidebar links render as plain path URLs (/testnets, /metrics, ...). When opened in a new tab, copied/shared, refreshed, or indexed, these arrive without a hash and resolve to a 404/NotFound.

Changes:

  • Add src/lib/normalizePath.js: route-agnostic path-to-hash normalization. Unknown paths fall through to the router's own NotFound; static assets and server-handled prefixes (/api, /oauth, ...) are left untouched. Replaces the previous hardcoded two-prefix block in App.svelte.
  • Sidebar.svelte: convert internal hrefs to hash form so copied/new-tab/indexed links are valid at the source.
  • src/tests/normalizePath.test.js: unit coverage (11 tests).

Verified: new tests pass, npm run build succeeds, no new regressions in the existing suite.

@Zhekinmaksim Zhekinmaksim force-pushed the fix/614-hash-routing-deep-links branch from e872ee4 to 145c501 Compare June 3, 2026 16:30
Copy link
Copy Markdown
Author

Hi, following up on this PR. I refreshed the branch against current dev, so it is now back to a clean one-commit diff and mergeable again. The routing issue is still present on current dev from what I checked, so this should still be relevant if you want to take another look.

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.

Portal sidebar deep links return 404 when opened directly

1 participant