Skip to content

Keep documentation fragment links in the current page. - #36

Merged
WaylandYang merged 3 commits into
deeplethe:devfrom
Maya-Kid:codex/fix-docs-fragment-navigation
Oct 15, 2026
Merged

WaylandYang merged 3 commits into
deeplethe:devfrom
Maya-Kid:codex/fix-docs-fragment-navigation

Conversation

@Maya-Kid

@Maya-Kid Maya-Kid commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Why

Clicking a documentation reference such as “nested” in Button Group opens a second copy of the page instead of moving to its heading in the current tab. Fragment navigation also needs to work when the same reference is clicked again after scrolling, and malformed URL escapes must not crash the documentation page.

What changes

Resolve fragment links as local router destinations and preserve the current query string, including ?theme=light. Scroll to the heading on every router navigation, including a repeated click to the same fragment, while retaining the heading's existing scroll margin. Decode fragment IDs safely so an invalid percent escape leaves the documentation usable.

How it was checked

  • npm run docs, npm run typecheck, and npm run build pass; production was also built with /design/ as the base path.
  • In both themes, all seven in-document fragment references were activated with the keyboard and clicked again after scrolling, on the root development site and the production /design/ deployment. Each retains the query string, keeps one tab, and brings the heading into view.
  • Back and forward navigation, encoded fragments, malformed escapes (#% and incomplete UTF-8), and missing headings were checked. Malformed fragments no longer raise a page error or blank the page.
  • Cmd-click still opens the expected document fragment in a new tab; external links retain their existing new-tab behavior.
  • /dev/examples mounts 389 of 389 examples with 0 failed in dark and light themes, with no page errors.

Before review

  • Every commit is signed off (git commit -s)
  • npm run typecheck and npm run build pass
  • /dev/examples reports 0 failed
  • What the change touches was looked at in both themes

Maya-Kid and others added 3 commits October 15, 2026 18:49
Signed-off-by: Maya Kid <29959320+Maya-Kid@users.noreply.github.com>
Signed-off-by: Maya Kid <29959320+Maya-Kid@users.noreply.github.com>
@WaylandYang
WaylandYang merged commit 75a1b34 into deeplethe:dev Oct 15, 2026
1 check passed
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.

2 participants