Conversation
A List/Tree switch in the Changes heading. List keeps today's flat view and stays the default; Tree groups each status group's files into collapsible folders, with single-child folder chains compacted into one row (like VS Code's Source Control "View as Tree"). The choice is remembered in localStorage. Switching views or folding a folder repaints only the file list, leaving the selection and diff pane untouched, and keeps keyboard focus on the toggled folder.
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.
Summary
Adds a List / Tree switch to the Changes section of a project's Git tab. List is today's flat view and stays the default. Tree groups the changed files into collapsible folders, like View as Tree in VS Code / Cursor Source Control.
Why
With many changes under a few deep directories (e.g. 30+ untracked files under
backend/docs/…andbackend/script/…), the flat list repeats the same long prefix on every row and it's hard to see where the changes are. A tree makes the shape of the change obvious and lets you fold away folders you've already looked at.What it does
.pane-segcontrol.localStorage(gitChangesView) as one global preference, like the diff mode in the file panel. Unknown values, or storage that throws, fall back to list.backend/docs/ai-engine), like VS Code's compact folders.aria-expanded), and keyboard focus stays on that folder after the list re-renders. Collapse state lives in memory, per repository.old → newfor renames) plus the staged/unstaged/untracked label move into the tooltip.Implementation notes
public/project-git-view.js:buildGitChangeTree()andgitTreeRows(), easy to unit-test;createGitFileRow(), shared by both modes, andcreateGitFolderRow();paintGitChanges()takes{ repaintDiff }, so a view switch or folder toggle skips the diff pane;paintGitRepository().public/projects-view.js: newPICONS.treeicon (Lucidelist-tree).public/style.css:.git-view-toggle/.git-view-btn,.git-folder-row, and.git-file-row.tree. Indentation uses a--depthcustom property.changesarray the renderer already receives.Testing
test/project-git-view.test.js(11 tests), which loads the realpublic/project-git-view.jsin avmcontext. It covers:localStorage;npm test: 429/429 pass.style.cssandproject-git-view.js, with a 33-file fixture:<b>x-inject-test.shrenders as literal text;