Conversation
Replace the flat file list with a collapsible directory tree. Files are grouped by parent directories with VS Code-style single-child chain collapsing. Tree component is generic and reusable for the future file browser (phase 7).
E2E scenarios: directory tree grouping, expand/collapse toggle. Unit tests: buildFileTree grouping, sorting, chain collapsing, status preservation. Also adds doc comments to TreeNode types.
M=yellow, A/?=green, D/U=red, R/C=muted, T=yellow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The flat file list in the Code tab is now a collapsible directory tree. Files are grouped by parent directories —
packages/server/src/git-review.tsrenders underpackages/server/src/instead of as one long path. Single-child directory chains auto-collapse VS Code-style, sopackages/server/srcbecomes one node when each intermediate has only one child.The tree component (
FileTree) is generic and reusable — it takes aTreeNode[]discriminated union (FileNode | DirNode) with expand/collapse state, selection, and optional badge rendering. Phase 7 (full file browser) will plug into the same component with a lazyloadChildrencallback; the data model was designed with that in mind.A pure
buildFileTree()function handles the flat-to-tree transformation: path segmentation, directory grouping, alphabetical sorting (directories first), and chain collapsing. All client-side — no new RPC, no schema change.Closes #514 phase 3.