Skip to content

fix: docs nav 404 on browser back/forward - #30

Closed
spacecadetDan wants to merge 2 commits into
mainfrom
fix/docs-tab-path-404
Closed

spacecadetDan wants to merge 2 commits into
mainfrom
fix/docs-tab-path-404

Conversation

@spacecadetDan

@spacecadetDan spacecadetDan commented Mar 11, 2026 •

Copy link
Copy Markdown

Summary

  • Card components in MDX files used Mintlify-style relative hrefs (e.g. `href="/tutorials/rql-basics"`)
  • devdoc's `resolveLink()` resolves these using the current `activeTab`, causing two bugs:
    1. Tab-only links (`href="/tutorials"`) navigate to a URL with no page, showing a blank state — the initial auto-navigation guard fires only once and won't re-run
    2. Cross-tab links (`href="/tutorials/legal-search"` from a Documentation page) resolve with wrong tab context, showing the wrong sidebar

Changes

  • Updated all Card `href` attributes in MDX files to devdoc's absolute URL format (`/tutorials/page/tutorials/X`)
    • `resolveLink()` returns these unchanged when the path contains `/page/`, bypassing the `activeTab`-based resolution entirely
  • Restored `docs.json` page paths to include full path from docs root (e.g. `tutorials/index`) so devdoc check can locate `.mdx` files correctly

Files changed

  • `docs/index.mdx` — `/tutorials` → `/tutorials/page/tutorials/index`
  • `docs/quickstart.mdx` — `/tutorials` → `/tutorials/page/tutorials/index`
  • `docs/guides/search.mdx` — cross-tab Card href fixed
  • `docs/tutorials/index.mdx` — all 8 Card hrefs updated
  • `docs/tutorials/rql-basics.mdx` — next-step Card href fixed
  • `docs/tutorials/legal-search.mdx` — next-step Card href fixed
  • `docs/tutorials/research-papers.mdx` — next-step Card href fixed
  • `docs/tutorials/knowledge-base.mdx` — next-step Card href fixed
  • `docs/docs.json` — restored `tutorials/` prefix on page paths (reverts bad prior attempt)

When a tab has a `path` field (e.g. "/tutorials"), devdoc uses that
as both the URL prefix and directory prefix when resolving pages.
Pages must be listed relative to the tab path, not from the docs root.

Before: tab path="/tutorials" + page "tutorials/index"
  → URL: /tutorials/tutorials/index → 404 on browser back/forward

After: tab path="/tutorials" + page "index"
  → URL: /tutorials/index → correct

Same fix applied to the API Reference tab pages.
@spacecadetDan
spacecadetDan force-pushed the fix/docs-tab-path-404 branch from af73f06 to 8145f65 Compare March 11, 2026 03:54
….json

Card components in MDX files used Mintlify-style relative hrefs (e.g.
href="/tutorials/rql-basics"). With devdoc's resolveLink(), these get
resolved using the current activeTab context, causing two bugs:

1. Tab-only links (href="/tutorials") navigate to /tutorials URL with no
   page context, showing a blank "Select an endpoint" state after the
   initial auto-navigation guard fires only once.

2. Cross-tab links (e.g. href="/tutorials/legal-search" from a
   Documentation page) resolve to /documentation/page/tutorials/legal-search
   — wrong tab, wrong sidebar.

Fix: use devdoc's absolute URL format (href="/tutorials/page/tutorials/X")
which bypasses the activeTab resolution entirely (resolveLink returns these
unchanged when the path contains /page/).

Also restore docs.json to correct state: pages must include the full path
relative to docs root (e.g. "tutorials/index") so devdoc check can find the
.mdx files. Reverts a bad prior attempt that stripped the prefix.

Files changed:
- docs/index.mdx: /tutorials → /tutorials/page/tutorials/index
- docs/quickstart.mdx: /tutorials → /tutorials/page/tutorials/index
- docs/guides/search.mdx: /tutorials/legal-search → absolute URL
- docs/tutorials/index.mdx: all 8 Card hrefs → absolute URLs
- docs/tutorials/rql-basics.mdx: /tutorials/legal-search → absolute URL
- docs/tutorials/legal-search.mdx: /tutorials/knowledge-base → absolute URL
- docs/tutorials/research-papers.mdx: /tutorials/rql-basics → absolute URL
- docs/tutorials/knowledge-base.mdx: /tutorials/research-papers → absolute URL
- docs/docs.json: restore tutorials/ prefix on page paths
@spacecadetDan
spacecadetDan deleted the fix/docs-tab-path-404 branch March 11, 2026 16:31
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.

1 participant