Skip to content

Code tab: tree layout for changed files#538

Merged
srid merged 6 commits intomasterfrom
foul-frost
Apr 15, 2026
Merged

Code tab: tree layout for changed files#538
srid merged 6 commits intomasterfrom
foul-frost

Conversation

@srid
Copy link
Copy Markdown
Member

@srid srid commented Apr 15, 2026

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.ts renders under packages/server/src/ instead of as one long path. Single-child directory chains auto-collapse VS Code-style, so packages/server/src becomes one node when each intermediate has only one child.

The tree component (FileTree) is generic and reusable — it takes a TreeNode[] 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 lazy loadChildren callback; 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.

srid added 6 commits April 15, 2026 09:33
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.
@srid srid marked this pull request as ready for review April 15, 2026 13:49
@srid srid merged commit 57bc0af into master Apr 15, 2026
11 checks passed
@srid srid deleted the foul-frost branch April 15, 2026 13:53
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.

Code tab: diff review & file browser

1 participant