Skip to content

BACK-423 - Add folder grouping for docs in Web UI#674

Merged
MrLesk merged 8 commits into
MrLesk:mainfrom
zhuohoudeputao:tasks/back-423-folder-grouping
Jul 4, 2026
Merged

BACK-423 - Add folder grouping for docs in Web UI#674
MrLesk merged 8 commits into
MrLesk:mainfrom
zhuohoudeputao:tasks/back-423-folder-grouping

Conversation

@zhuohoudeputao

Copy link
Copy Markdown
Contributor

Summary

Implements BACK-423: Add folder grouping for docs in Web UI to make documentation easier to navigate when organized into folders.

Changes

New Files

  • src/web/lib/docs-tree.ts - Helper function to build hierarchical tree structure from docs
  • src/web/lib/docs-tree.test.ts - Unit tests for tree building logic (8 tests, all passing)

Modified Files

  • src/web/components/SideNavigation.tsx - Collapsible folder tree UI with localStorage persistence
  • src/web/styles/style.css - Minor styling adjustment

Features

Full hierarchy tree - Nested folders like guides > auth > basic (any depth supported)
Alphabetical sorting - Folders and docs sorted alphabetically
Collapse/expand - Each folder collapsible with localStorage persistence
Flat list for ungrouped docs - Docs without folders appear below folder tree
Flat search results - Search bypasses folder grouping
Empty folders hidden - Only folders with documents are shown
Edge cases handled - Missing path, deeply nested, malformed paths

Testing

  • All 8 unit tests pass
  • TypeScript compilation clean
  • Lint/format checks pass

Screenshots

Folder tree displays in sidebar with:

  • Folder icons and collapse/expand icons
  • Proper indentation for nested folders
  • Dark mode support
  • Accessibility labels

Related

@MrLesk MrLesk left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Alex's Agent: Thanks for implementing BACK-423. I’m requesting changes before this is ready to merge.

Validation on a merge with latest origin/main:

  • bun test src/web/lib/docs-tree.test.ts passes
  • bunx tsc --noEmit passes
  • bun run check . exits 0, but reports Biome warnings in src/web/lib/docs-tree.ts

Please address these before merge:

  • Remove the generated/minified src/web/styles/style.css churn unless there is a specific source CSS change that must be shipped. The current stylesheet diff rewrites a huge bundled line for no clear functional need.
  • Fix the Biome warnings from non-null assertions in src/web/lib/docs-tree.ts (doc.path! and folderPathParts[i]!).
  • Simplify the sidebar rendering before merge. The PR now has multiple duplicated document NavLink render paths; extracting a small local doc-link helper would keep this easier to maintain while preserving the feature.

For future PRs, please link the relevant GitHub issue first where applicable, then include Backlog task IDs as secondary context.

@MrLesk

MrLesk commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Alex's Agent: I re-reviewed this against current main. The scope is acceptable because #488 / BACK-423 already cover Web UI document folder grouping, and the patch stays in display/UI code. Please rework before merge: remove unrelated generated CSS churn, resolve the Biome warnings in docs-tree, avoid duplicated document link rendering in SideNavigation, and handle long folder labels/accessibility cleanly. The branch currently has no GitHub check evidence, so please rerun the focused Web tests/typecheck/checks after the cleanup.

@MrLesk MrLesk force-pushed the tasks/back-423-folder-grouping branch from 4908e28 to b9445c7 Compare July 4, 2026 14:10
@MrLesk MrLesk merged commit 54bc46f into MrLesk:main Jul 4, 2026
6 checks passed
@MrLesk

MrLesk commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Alex's Agent: Merged — thanks @zhuohoudeputao for the feature and the groundwork! To move it along we completed the requested rework directly on your branch (your commits and authorship are preserved); the fix-up commits cover the generated-CSS revert, a simplified tree builder, a shared link component, and label/aria polish. Docs folder grouping ships in the next release.

@zhuohoudeputao

Copy link
Copy Markdown
Contributor Author

Thanks @MrLesk for the detailed review and for pushing the fixes — your work made this feature happen! Excited to see it live in v1.47.1. 🙏

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.

2 participants