Skip to content

[codex] Add docs sidebar tree and search#3204

Merged
hengyunabc merged 2 commits into
masterfrom
codex/sidebar-tree
Jun 2, 2026
Merged

[codex] Add docs sidebar tree and search#3204
hengyunabc merged 2 commits into
masterfrom
codex/sidebar-tree

Conversation

@hengyunabc
Copy link
Copy Markdown
Collaborator

What changed

  • Added a local VuePress SidebarItem implementation for collapsible sidebar groups with dedicated expand/collapse controls.
  • Added a local SidebarItems implementation with a search input above the docs sidebar.
  • Preserved parent links while separating text navigation from expand/collapse clicks.
  • Kept sibling sidebar text aligned by reserving a consistent tree-control column.
  • Filters nested sidebar items while keeping matching parent context visible and force-opening matching branches during search.

Why

The docs sidebar already configured nested groups such as 命令列表, AI 相关, and 其他特性, but the rendered sidebar did not expose the nested document tree clearly. After adding the tree controls, ordinary sibling links and collapsible rows had different text start positions because only collapsible rows reserved space for the arrow. The search input makes large command lists easier to navigate without scrolling through every command.

Impact

Users can now expand/collapse documentation groups from the sidebar and filter sidebar entries by typing a command or document name. Chinese and English docs use localized search placeholder, clear button label, empty state, and expand/collapse aria labels.

Validation

  • Ran npm run docs:build successfully; VuePress rendered 150 pages.
  • Browser-tested /doc/commands.html:
    • 命令列表 defaults expanded and can collapse/expand.
    • 表达式核心变量, 命令列表, and FAQ align to the same text x-position.
    • Searching mcp shows AI 相关 -> Arthas MCP Server and opens that branch.
    • Searching cat shows 命令列表 -> cat and opens that branch.
    • Searching a missing value shows 没有匹配结果.
    • Clearing search restores the full sidebar.

Note: the build still reports the existing Browserslist caniuse-lite is outdated warning.

@hengyunabc hengyunabc force-pushed the codex/sidebar-tree branch from 8ef53a5 to ac6cbd6 Compare June 2, 2026 08:06
@hengyunabc hengyunabc marked this pull request as ready for review June 2, 2026 08:07
@hengyunabc hengyunabc merged commit 9cfdb94 into master Jun 2, 2026
8 of 30 checks passed
@hengyunabc hengyunabc deleted the codex/sidebar-tree branch June 2, 2026 08:07
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.

1 participant