Skip to content

RDoc-4147 Allow linking content from switchable sections - #2707

Open
poissoncorp wants to merge 1 commit into
ravendb:mainfrom
poissoncorp:tabs-hash-anchors
Open

poissoncorp wants to merge 1 commit into
ravendb:mainfrom
poissoncorp:tabs-hash-anchors

Conversation

@poissoncorp

@poissoncorp poissoncorp commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Issue link

https://issues.ravendb.net/issue/RDoc-4147/Allow-linking-content-from-switchable-sections

Additional description

A link to an anchor or heading inside a non-selected tab now opens that tab and scrolls to the target. Until now the target sat in a hidden panel, so neither the browser nor Docusaurus could scroll to it and the link did nothing. No content changes needed: an <a id="..."/> or a heading inside a TabItem is enough.

How it works (useOpenTabOfHashTarget in the swizzled Tabs):

  • On navigation it looks up the hash target, finds which of this Tabs' panels holds it, and selects that tab through selectValue, the same call a tab click makes.
  • Scrolls after the render that unhides the panel, once other Tabs sharing the groupId have switched too.
  • Keyed on the whole location, so following the same link again (e.g. a TOC entry) after switching tabs by hand reopens the tab. A search-only change (a queryString tab click) is skipped, the same rule as Docusaurus' scrollAfterNavigation.
  • Like a click, opening a tab from a link stores the choice for its groupId.

New templates/tabs page: basic usage, linking to content inside a tab (with a live example) and the props authors use.

Verified on a production build (build:current) with temporary anchors in a page: page load with #anchor pointing into a hidden tab, in-page links and TOC entries to anchors in other tabs, switching tabs by hand afterwards (also with queryString), following the same link again, and Tabs sharing a groupId. Lint, Prettier and typecheck clean.

Type of change

  • Content - docs
  • Content - cloud
  • Content - Quill
  • Content - guides
  • Content - start pages/other
  • New docs feature (consider updating /templates or readme)
  • Bug fix
  • Optimization
  • Other

Changes in docs URLs

  • No changes in docs URLs
  • Articles are restructured, URLs will change, mapping is required (update /scripts/redirects.json file, set Documents Moved PR label)

Changes in UX/UI

  • No changes in UX/UI
  • Changes in UX/UI (include screenshots and description)

No visual change, so no screenshots: links to anchors inside tabs now open the tab and scroll to the anchor.

@poissoncorp poissoncorp changed the title Open the tab holding a linked anchor RDoc-4147 Allow linking content from switchable sections Oct 22, 2026
@poissoncorp
poissoncorp requested a review from Lwiel October 23, 2026 00:26
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