Skip to content

docs-support: side-nav highlight for extension-suffixed URLs - #790

Merged
NullVoxPopuli merged 4 commits into
universal-ember:mainfrom
NullVoxPopuli-ai-agent:side-nav-md-active
Aug 19, 2026
Merged

docs-support: side-nav highlight for extension-suffixed URLs#790
NullVoxPopuli merged 4 commits into
universal-ember:mainfrom
NullVoxPopuli-ai-agent:side-nav-md-active

Conversation

@NullVoxPopuli-ai-agent

Copy link
Copy Markdown
Contributor

Docs pages are reachable both extension-less (the side-nav's own hrefs) and with .md/.gjs.md suffixes — every prose cross-link produces the suffixed form — plus collection indexes at both /section and /section/index. The link helper's isActive compares URLs exactly, so as soon as a reader follows any cross-link, the nav highlight silently disappears.

This normalizes both sides (.gjs.md/.gjs/.md suffixes, /index, trailing slash, query strings) before comparing, in SectionLink/SubSectionLink.

Verified against the docs-app dev server: visiting /3-ui/switch.md directly now highlights "Switch" in both the desktop and mobile navs; in-app navigation behavior is unchanged. The normalization also passed a table-driven check during development:

/2-usage/data.md      ~ /2-usage/data        ✓
/1-get-started/index  ~ /1-get-started       ✓
/3-ui/switch.gjs.md   ~ /3-ui/switch         ✓
(+ query strings, trailing slashes, non-matches)

Found while building out universal-ember/form's docs (universal-ember/form#23) — this fixes the same behavior for the primitives, table, and form docs sites alike.

🤖 Generated with Claude Code

Docs pages are reachable both extension-less (the nav's own hrefs) and
with .md / .gjs.md suffixes (every prose cross-link produces these), and
collection indexes at both /section and /section/index. The link
helper's isActive compares URLs exactly, so following any cross-link
silently dropped the nav highlight. Normalize both sides before
comparing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor
Project Preview URL
Docs https://0b08492d.ember-primitives.pages.dev

Logs

@NullVoxPopuli NullVoxPopuli added the bug Something isn't working label Jul 20, 2026
NullVoxPopuli-ai-agent and others added 3 commits July 20, 2026 13:31
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@NullVoxPopuli
NullVoxPopuli merged commit db05e32 into universal-ember:main Aug 19, 2026
17 checks passed
@NullVoxPopuli
NullVoxPopuli deleted the side-nav-md-active branch August 19, 2026 23:32
@github-actions github-actions Bot mentioned this pull request Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants