Skip to content

Add ability to collapse left nav #1150

Open

Description

@KOTungseth

To expand the width of Docs pages, add the ability to collapse the entire left navigation.

The Kibana UI provides this ability for the main menu:

Image

Activity

  1. bmorelli25 commented on Jul 14, 2025

    @bmorelli25
    Member

    Are we still doing this?

  2. theletterf commented on Oct 8, 2025

    @theletterf
    Member

    We might to focus first on a unified navbar? +CC @georgewallace

  3. georgewallace commented on Oct 8, 2025

    @georgewallace
    Contributor

    For this issue would love to see it be a focus mode instead of just collapsing the nav bar. Would love to see a unified nav first though. I agree with Fabri.

  4. cotti commented on Jun 3, 2026

    @cotti
    Contributor

    AI triage

    Automated investigation against the current codebase. A human still needs to confirm before any code change.

    Original concern

    Add a control to collapse/hide the entire left navigation sidebar so the content column can use the full page width — distinct from the existing per-folder expand/collapse toggles.

    Findings

    • src/Elastic.Markdown/_Layout.cshtml:37 — the desktop layout is a fixed two-column grid (md:grid-cols-[var(--max-sidebar-width)_1fr]). The sidebar column is always allocated --max-sidebar-width; there is no state that removes the column to widen the content.
    • src/Elastic.Documentation.Site/Layout/_PagesNav.cshtml:2 — the sidebar <aside> is fixed md:sticky; its slide-in/out is gated entirely on #pages-nav-hamburger:checked (group-has-[#pages-nav-hamburger:checked]/body:left-0), and #pages-nav-hamburger is the checkbox defined in src/Elastic.Markdown/_Layout.cshtml:46.
    • src/Elastic.Documentation.Site/Layout/_PagesNav.cshtml:9-13 — the only toggle control (the hamburger <label>) is md:hidden, so the open/close affordance exists only on mobile as an overlay drawer. On desktop the sidebar is permanently visible with no collapse control.
    • src/Elastic.Documentation.Site/Assets/pages-nav.ts:10-31 — the nav's persisted state is purely the set of checked per-folder expand checkboxes (nav-expanded in sessionStorage). There is no concept of a collapsed-whole-sidebar state.
    • No focus-mode, sidebar-collapsed, or desktop collapse-toggle code exists anywhere under src/ (grep returned nothing), confirming the gap rather than a partial implementation.

    Verdict

    Needs stakeholder input

    The requested behavior does not exist today: the desktop sidebar is a fixed grid column with no collapse affordance, and the only show/hide control is the mobile-only hamburger drawer. While wiring a desktop collapse toggle is mechanically feasible (a toggle + a persisted state + collapsing the grid column), the thread shows this is not an uncontentious quick fix. @theletterf and @georgewallace want a unified navbar tackled first, and @georgewallace asked for this to be reframed as a "focus mode" rather than a plain nav collapse. Those are reader-visible chrome and interaction decisions (focus mode vs. simple collapse, where the toggle lives, persistence across pages, responsive behavior, and sequencing relative to the unified-nav work) that need a design/UX call before implementation.

    Proposal

    Open questions for UX / design:

    • Scope: a plain "hide the sidebar to widen content" toggle, or a fuller "focus mode" (per @georgewallace) that also reduces other chrome? Which ships first?
    • Sequencing: should this wait on the "unified navbar" effort (per @theletterf / @georgewallace), or proceed independently?
    • Affordance: where does the desktop toggle live and how does the collapsed state reveal the nav again (rail, edge handle, keyboard shortcut)?
    • Persistence: should the collapsed state persist across pages/sessions (and via sessionStorage like today's nav state in pages-nav.ts, or localStorage)?

    Once those are settled, the implementation touches src/Elastic.Markdown/_Layout.cshtml (grid columns), src/Elastic.Documentation.Site/Layout/_PagesNav.cshtml (toggle + desktop affordance), and src/Elastic.Documentation.Site/Assets/pages-nav.ts (persisted collapse state).

    Related issues

    Part of a small cluster around side-nav visibility/density controls:

    Maintainers may want to plan #1150 and #241 together as one coherent side-nav-controls workstream.

    Notes

    • Existing labels design + low hanging fruit capture the design intent, but the comment thread (unified-nav-first, focus-mode reframing) shows the UX decision is the actual blocker, hence ai:ux-question rather than a quick fix.
  5. added
    ai-triaged
    ai:ux-question
    on Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-triagedai:ux-questiondesignlow hanging fruit

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions