Repository navigation
Conversation
Changed Files sections default to the existing flat path list and can switch to a tree; All Files keeps its tree default and gains a flat list view, capped at 1000 rows since nothing is virtualized. Each list's choice persists per client in localStorage. All Files' buildTree/sortChildren and TreeBranch/DirRow move to shared modules so both panels render trees identically. Dirs are keyed with a trailing "/" so a file and dir sharing a name (deleted `foo` plus new `foo/bar`) both show. Staged renames are placed and named by their destination path; destOf moves to src/shared/git-paths.ts for reuse. All Files list rows are memoized with ref-stabilized callbacks, and the changed-files map only feeds the list memo while filtering.
This branch has not been deployed
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.
Each file list in the right column gets a button that switches it between a flat, path-sorted list and a folder tree: the Uncommitted and Committed sections of Changed Files, and All Files.
Changed Files still starts as a list, and All Files still starts as a tree, so nothing changes until you click. All Files gains a list view it didn't have before. Each list remembers its choice per client in
localStorage, the same way panels remember being collapsed.All Files in list view, filtered. As in the tree, files changed on the branch sort first while filtering:
Implementation
buildTree/sortChildrenand itsTreeBranch/DirRowrenderer move intosrc/renderer/file-tree.tsandcomponents/FileTree.tsx, and both panels use them, so the trees look and behave the same. Changed-file trees start expanded; All Files still starts collapsed./, so a file and a folder with the same name (a deletedfooplus a newfoo/bar) both show.old -> newfromgit status --porcelain) are placed and named by their destination.destOfmoves fromworktree.tstosrc/shared/git-paths.tsso main and renderer share it.Testing
npm run typecheck,npx electron-vite build,npx vitest run: 1,844 passing, including the newfile-tree.test.ts.Known issues, not fixed here
old -> newpath. The list view did this before this PR too.git status --porcelainquotes (spaces, non-ASCII) still parse wrong. Also not new.Screenshots are from the headless web client, using this PR's own branch as demo data.