When a user switches the top-left documentation group, the sidebar must only show navigation for the selected group.
- On
/manual/en/*, show only EN manual sidebar group. - On
/manual/ru/*, show only RU manual sidebar group. - On
/manual/zh/*(and zh alias paths), show only ZH manual sidebar group. - On
/developer/*, show only Developer Docs sidebar group. - On non-doc-group routes (for example
/), show only theNavigationgroup.
Mixing all groups in one sidebar after selecting RU/ZH is confusing and inconsistent with EN/Developer behavior. Group selection should define sidebar scope.
Filter by a stable route key derived from Astro.url.pathname.
en->/manual/en/*ru->/manual/ru/*zh->/manual/zh/*and zh alias pathsdeveloper->/developer/*navigation-> all other routes
Then map the key to allowed sidebar group labels.
- This keeps behavior explicit and easy to review.
- It also supports localized labels and temporary compatibility labels.
Current implementation is in:
src/components/overrides/Sidebar.astro
It derives an active group key from Astro.url.pathname, then keeps only groups whose labels are allowed for that key.
Important fallback rule:
- If the expected group is not found, fallback must be
Navigationonly. - Never fallback to full
sidebar(this would reintroduce the "show everything" regression).
When editing sidebar labels, language names, or group titles:
- Verify
Sidebar.astrostill uses route-key filtering and does not fallback to full sidebar. - Run a build and manually check:
/manual/en//manual/ru//manual/zh//developer/
- Confirm each route only shows its own sidebar group.
If a new top-level doc group is added, update root matching in:
src/components/overrides/Sidebar.astrosrc/components/overrides/PageFrame.astro(group switcher list)