Skip to content

Collapse nested sidebar groups by default#24

Merged
hongyi-chen merged 1 commit intomainfrom
hyc/collapse-sidebar-by-default
May 5, 2026
Merged

Collapse nested sidebar groups by default#24
hongyi-chen merged 1 commit intomainfrom
hyc/collapse-sidebar-by-default

Conversation

@hongyi-chen
Copy link
Copy Markdown
Collaborator

@hongyi-chen hongyi-chen commented May 5, 2026

Summary

Auto-collapses nested sidebar groups (e.g. Capabilities, Triggers, Integrations, Self-hosting) on first load so the H2 section headers (GETTING STARTED, WARP AGENTS, THIRD-PARTY CLI AGENTS, OZ CLOUD AGENTS & ORCHESTRATION, etc.) stay visible at the top of the sidebar instead of getting pushed below the fold.

Preview: https://docs-git-hyc-collapse-sidebar-by-default-warpdotdev.vercel.app/agent-platform/

Problem

On /agent-platform/ and other topic pages today, every nested group renders fully expanded. The result is a long sidebar where the lower H2 sections (e.g. OZ CLOUD AGENTS & ORCHESTRATION) sit below the fold and have to be scrolled to.

Change

Adds collapsed: true to the 23 nested groups in src/sidebar.ts. Top-level groups (the H2 section headers) are intentionally untouched so the section anchors remain the first thing users see.

collapsed is part of Starlight's native sidebar schema and flows straight through starlight-sidebar-topics. Starlight's SidebarSublist opens a group via:

open={flattenSidebar(entry.entries).some((i) => i.isCurrent) || !entry.collapsed}

…so any group containing the current page still auto-expands. Deep links (e.g. /agent-platform/capabilities/skills) land with their ancestor group expanded — only siblings stay closed.

Inventory (23 nested groups)

  • Terminal (14): Migrate to Warp, Blocks, Modern text editing, Command entry, Command completions, Windows and Tabs, Sessions, Terminal appearance, Settings file, Warpify overview, More Features, Terminal comparisons, Built-in code editor, Warp Drive overview
  • Agents (7): Capabilities, Interacting with agents, Agent context, Triggers, Integrations, GitHub Actions, Self-hosting
  • Reference (2): API Troubleshooting, Errors

Support & Community / Enterprise / Guides have no nested groups (only flat link lists), so nothing to add there.

Out of scope

The standalone Scalar API reference at /api is a separate bundle with its own sidebar and is intentionally left as-is for this PR.

Validation

  • npx astro check — clean (no new errors/warnings).
  • Vercel preview verified: /agent-platform/ matches the requested screenshot — H2 sections expanded, inner groups (Capabilities, Interacting with agents, etc.) collapsed.
  • Deep-link spot check: visiting /agent-platform/capabilities/skills auto-expands Capabilities.

Conversation

Co-Authored-By: Oz oz-agent@warp.dev

@cla-bot cla-bot Bot added the cla-signed label May 5, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 5, 2026 10:03pm

Request Review

Auto-collapse the nested groups inside each top-level sidebar section
(e.g. 'Capabilities', 'Interacting with agents', 'Agent context',
'Triggers', 'Integrations', 'Self-hosting') so the H2 section headers
stay visible on first load but their inner groups don't push the rest
of the sidebar below the fold.

Top-level groups (which render as the H2 section headers like
'GETTING STARTED', 'WARP AGENTS', 'THIRD-PARTY CLI AGENTS', 'OZ CLOUD
AGENTS & ORCHESTRATION') stay expanded by default \u2014 those are the
section anchors users scan first.

Inventory (23 nested groups across Terminal, Agents, Reference):
- Terminal: Migrate to Warp, Blocks, Modern text editing, Command
  entry, Command completions, Windows and Tabs, Sessions, Terminal
  appearance, Settings file, Warpify overview, More Features, Terminal
  comparisons, Built-in code editor, Warp Drive overview
- Agents: Capabilities, Interacting with agents, Agent context,
  Triggers, Integrations, GitHub Actions, Self-hosting
- Reference: API Troubleshooting, Errors

Starlight's SidebarSublist still auto-expands the ancestor group of
the current page (via the 'isCurrent' inside the group check), so
deep links continue to highlight context.

Co-Authored-By: Oz <oz-agent@warp.dev>
@hongyi-chen hongyi-chen force-pushed the hyc/collapse-sidebar-by-default branch from 9666df0 to 8d8884e Compare May 5, 2026 22:02
@hongyi-chen hongyi-chen changed the title Collapse top-level sidebar groups by default Collapse nested sidebar groups by default May 5, 2026
Copy link
Copy Markdown
Contributor

@rachaelrenk rachaelrenk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing!

@hongyi-chen hongyi-chen merged commit 70571ec into main May 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants