You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ai-triagedIssue received an initial assessment through AI-powered current code and architecture checks.ai:ux-questionAI triage raised a UX / frontend question for a human to decide.enhancementlow hanging fruit
I guess this is more of a request than a bug report.
@kilfoyle came up with the idea for Expand all | Collapse all buttons to simplify the side navigation. Since all the H1s are expanded, navigating through the website could be overwhelming for users.
Expected behavior
We should provide Expand all | Collapse all buttons in the sidenav so that users can view just the top-level sections or all their children as they wish.
💡I wonder if the left-hand nav should have state. For example, say I specifically make 2 or 3 sections open, it would be nice to not lose this if I change pages.
Also, when you are in a page, and you collapse the section that page is in on the left nav menu, the nav menu will not have any indication of which page you're on. I think it would be beneficial if the section you're in went bold when you are on a page in that section.
Automated investigation against the current codebase. A human still needs to confirm before any code change.
Original concern
Add Expand all | Collapse all controls to the left side-navigation so readers can toggle between just the top-level sections and the full tree.
Findings
src/Elastic.Documentation.Site/Navigation/_TocTreeNav.cshtml:48-89 — every folder renders a hidden <input type="checkbox" id="@folder.Id"> plus a <label>; expand/collapse is a pure CSS checkbox toggle. There is no "expand all / collapse all" markup anywhere, and no aggregate control.
src/Elastic.Documentation.Site/Assets/styles.css:173-179 — .nav-subtree is hidden and revealed only when its sibling .peer contains a :checked box, so each folder toggles independently with no global state to drive from.
src/Elastic.Documentation.Site/Navigation/_TocTree.cshtml:9-13 — there is a sticky top-0 header (search + section dropdown) above #nav-tree (_TocTree.cshtml:65-75); that's the natural home for an Expand/Collapse-all control, but nothing is rendered there today.
src/Elastic.Documentation.Site/Assets/pages-nav.ts:33-42 — expandAllParents() only expands the ancestors of the current page; there is no "expand everything" routine that a button could reuse.
(re: @leemthompo's "keep my open sections across pages")src/Elastic.Documentation.Site/Assets/pages-nav.ts:10-31,154-159 — expansion state is already persisted to sessionStorage (NAV_STATE_KEY = 'nav-expanded') via saveNavState/restoreNavState, but only when isDevMode() is true (pages-nav.ts:6-8,125-127). So the groundwork exists but is gated to local docs-builder serve, not production readers. Added in PR #2982 (commit 5c04bd64, 2026-03-30).
(re: @benironside's "show which section I'm in") the current page is highlighted via .current (styles.css:428-430 → text-blue-elastic font-semibold), ancestor folder links pick up color through group-[.current]/li (styles.css:151-156), and the subtree connector line darkens when it contains .current (styles.css:188-191). However a collapsed ancestor folder whose child is the current page is not itself bolded unless the folder link is the current page, so this part of the thread is only partly addressed.
Verdict
Needs stakeholder input
The requested buttons do not exist — the side-nav is a CSS-only, per-folder checkbox toggle with no aggregate control (_TocTreeNav.cshtml:48-89, styles.css:173-179). Wiring up "Expand all / Collapse all" is mechanically small (a couple of buttons in the sticky header that check/uncheck all #nav-tree input[type=checkbox]), but it adds reader-visible chrome to every page and overlaps with several adjacent nav decisions raised in the thread (persisting state across pages, active-section indication) and in sibling issues. Those are UX/frontend calls, so they should get a design sign-off before implementation rather than being shipped as a silent tweak.
Proposal
Mechanically the change is contained, but the design questions need an owner:
For UX / frontend:
Where do the controls live — in the sticky _TocTree.cshtml header, inline near the section dropdown, or per-section? One combined toggle or two separate buttons?
Should "Expand all / Collapse all" operate on the whole tree or only within the current top-level section?
Should the chosen state persist across page loads? saveNavState/restoreNavState already implement sessionStorage persistence but are gated to isDevMode() — do we ungate that for all readers (addresses @leemthompo), and is sessionStorage (per-tab) the right scope vs localStorage?
Accessibility/mobile: keyboard focus and aria state for the new control, and behavior inside the mobile hamburger panel.
Should we also bold/highlight a collapsed ancestor folder when one of its descendants is the current page (addresses @benironside)?
If UX agrees on placement + scope, the implementation is roughly: add the control(s) to _TocTree.cshtml, add a handler in pages-nav.ts that toggles all #nav-tree input[type="checkbox"], and (optionally) reuse the existing saveNavState logic outside dev mode.
Related issues
This sits in a cluster around side-nav expand/collapse behavior:
Open: #1150 (collapse the left nav entirely) — adjacent control on the same surface.
Closed precedents on controlling expand/collapse state: #456, #899, #863 (default/initial collapsed state), and #524 (expand/collapse mis-wired for similar titles).
Worth confirming whether #456/#899/#863 were resolved by a design decision that also covers this request.
Notes
Partial groundwork already merged: per-folder state persistence via sessionStorage, dev-mode only — PR #2982 (commit 5c04bd64).
The issue carries a low hanging fruit label; that's accurate for the code, but the bundled UX decisions (placement, persistence scope, active-section indication) are what make it stakeholder-gated rather than a drop-in quick fix.
ai-triagedIssue received an initial assessment through AI-powered current code and architecture checks.ai:ux-questionAI triage raised a UX / frontend question for a human to decide.enhancementlow hanging fruit
Activity
leemthompo commentedon Jan 22, 2025
💡I wonder if the left-hand nav should have state. For example, say I specifically make 2 or 3 sections open, it would be nice to not lose this if I change pages.
benironside commentedon Jan 22, 2025
Also, when you are in a page, and you collapse the section that page is in on the left nav menu, the nav menu will not have any indication of which page you're on. I think it would be beneficial if the section you're in went bold when you are on a page in that section.
cotti commentedon Jun 3, 2026
AI triage
Automated investigation against the current codebase. A human still needs to confirm before any code change.
Original concern
Add
Expand all | Collapse allcontrols to the left side-navigation so readers can toggle between just the top-level sections and the full tree.Findings
src/Elastic.Documentation.Site/Navigation/_TocTreeNav.cshtml:48-89— every folder renders a hidden<input type="checkbox" id="@folder.Id">plus a<label>; expand/collapse is a pure CSS checkbox toggle. There is no "expand all / collapse all" markup anywhere, and no aggregate control.src/Elastic.Documentation.Site/Assets/styles.css:173-179—.nav-subtreeis hidden and revealed only when its sibling.peercontains a:checkedbox, so each folder toggles independently with no global state to drive from.src/Elastic.Documentation.Site/Navigation/_TocTree.cshtml:9-13— there is asticky top-0header (search + section dropdown) above#nav-tree(_TocTree.cshtml:65-75); that's the natural home for an Expand/Collapse-all control, but nothing is rendered there today.src/Elastic.Documentation.Site/Assets/pages-nav.ts:33-42—expandAllParents()only expands the ancestors of the current page; there is no "expand everything" routine that a button could reuse.src/Elastic.Documentation.Site/Assets/pages-nav.ts:10-31,154-159— expansion state is already persisted tosessionStorage(NAV_STATE_KEY = 'nav-expanded') viasaveNavState/restoreNavState, but only whenisDevMode()is true (pages-nav.ts:6-8,125-127). So the groundwork exists but is gated to localdocs-builder serve, not production readers. Added in PR #2982 (commit5c04bd64, 2026-03-30)..current(styles.css:428-430→text-blue-elastic font-semibold), ancestor folder links pick up color throughgroup-[.current]/li(styles.css:151-156), and the subtree connector line darkens when it contains.current(styles.css:188-191). However a collapsed ancestor folder whose child is the current page is not itself bolded unless the folder link is the current page, so this part of the thread is only partly addressed.Verdict
Needs stakeholder input
The requested buttons do not exist — the side-nav is a CSS-only, per-folder checkbox toggle with no aggregate control (
_TocTreeNav.cshtml:48-89,styles.css:173-179). Wiring up "Expand all / Collapse all" is mechanically small (a couple of buttons in the sticky header that check/uncheck all#nav-tree input[type=checkbox]), but it adds reader-visible chrome to every page and overlaps with several adjacent nav decisions raised in the thread (persisting state across pages, active-section indication) and in sibling issues. Those are UX/frontend calls, so they should get a design sign-off before implementation rather than being shipped as a silent tweak.Proposal
Mechanically the change is contained, but the design questions need an owner:
For UX / frontend:
_TocTree.cshtmlheader, inline near the section dropdown, or per-section? One combined toggle or two separate buttons?saveNavState/restoreNavStatealready implementsessionStoragepersistence but are gated toisDevMode()— do we ungate that for all readers (addresses @leemthompo), and issessionStorage(per-tab) the right scope vslocalStorage?ariastate for the new control, and behavior inside the mobile hamburger panel.If UX agrees on placement + scope, the implementation is roughly: add the control(s) to
_TocTree.cshtml, add a handler inpages-nav.tsthat toggles all#nav-tree input[type="checkbox"], and (optionally) reuse the existingsaveNavStatelogic outside dev mode.Related issues
This sits in a cluster around side-nav expand/collapse behavior:
Worth confirming whether #456/#899/#863 were resolved by a design decision that also covers this request.
Notes
sessionStorage, dev-mode only — PR #2982 (commit5c04bd64).low hanging fruitlabel; that's accurate for the code, but the bundled UX decisions (placement, persistence scope, active-section indication) are what make it stakeholder-gated rather than a drop-in quick fix.