feat: add tree view mode to changes tab#1319
Open
CaioDGallo wants to merge 1 commit intoPostHog:mainfrom
Open
Conversation
Contributor
Author
|
Ready for review when you have bandwidth. @jonathanlab , since this builds on #1197, I’d especially appreciate a check that this matches what you had in mind. This implements #1197 with an intentionally scoped approach: tree view mode for the Changes tab, stable selection/expansion across refreshes, virtualized visible rows for larger diffs, and keyboard navigation aligned with the existing list behavior. Happy to trim or reshape scope if any part feels too heavy. |
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.
Problem
Changes
ChangedFile[]with normalized paths and stable node ids. This keeps selection and expansion stable across refresh/reorder.ChangesFilesView, to keep main-thread and scroll cost bounded for large change sets.changesPanelStore, plus stale-path pruning. This preserves user context on refresh and removes invalid expanded paths.up/down/left/right) inuseChangesKeyboardNavigation, so selection remains stable when visible rows change.getCloudChangesStateto centralize waiting/loading/empty/error resolution, so cloud state handling is defined in one place.ChangesFilesView, row components, keyboard hook, state helper), to reduce coupling and reviewer overhead.ChangedFilecontract changes.How did you test this?
Automated
pnpm --filter code typecheckpnpm --filter code test -- changesPanelStore.test.ts changesTreeModel.test.tsManually
Left/Right, including file -> parent onLeft).Different feature states and cases
Closes #1197