Restore worktree family rows in the repository sidebar#195
Closed
ignatremizov wants to merge 1 commit into
Closed
Conversation
Restore the pre-v3.5.13 repository-list behavior on top of the upstream worktree model without changing the persisted worktree data model. The sidebar now derives a display family from the saved repositories plus the loaded Git worktree state, so a root repository and its linked worktrees render as one grouped family while still selecting the underlying upstream repository/worktree paths. Changes: - Expand Git-discovered worktrees as nested repository-list rows under their root/main worktree row when the sidebar worktree setting is enabled. - Deduplicate saved linked worktree repositories against the derived worktree family so adding a linked worktree does not emit a second copy of the same family. - Keep linked rows selectable, searchable, pinnable, context-menuable, and visually distinguishable by worktree path/branch when names collide. - Make synthetic root rows explicitly switch to the main worktree path instead of preserving a previously selected linked worktree path. - Refresh and prune worktree-family state on startup/removal so stale and prunable rows remain actionable without duplicate Pull all rows. - Track recent repository selections by repository id plus selected worktree path, expose a configurable recent count, and show only the selected recent worktree row rather than expanding whole families in Recent. - Preserve filtered row order for the repository sidebar so root rows stay above matching linked rows during searches. - Hide overflow on inner virtualized section grids so large account/org groups do not create nested scrollbars. - Add local Copilot SDK model typings and client construction updates required for the branch to compile against the current SDK package. Validation: - yarn test:unit app/test/unit/section-list-test.ts app/test/unit/ui/section-filter-list-test.tsx app/test/unit/repositories-list-grouping-test.ts app/test/unit/ui/repositories-list-test.ts app/test/unit/ui/repository-list-item-test.tsx app/test/unit/repository-list-item-context-menu-test.ts - yarn compile:dev - yarn build:prod Behavioral effect: Searching for a linked worktree name once again surfaces its worktree row under the owning repository family, saved linked worktrees no longer duplicate the family, selecting a parent row switches to the root worktree, and Recent contains the actual recently selected worktree rows with a configurable limit.
6605b34 to
bf3ec2b
Compare
Member
|
@ignatremizov If you don't mind, I'll close this PR as explained here. :) |
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.
Closes #192
Problem
v3.5.13 switched GitHub Desktop Plus to the upstream worktree implementation, but the repository sidebar lost several behaviors that existed in the previous GitHub Desktop Plus worktree implementation:
Solution
This keeps the upstream worktree data model and restores the sidebar behavior as a display-layer projection. The grouping code derives worktree families from saved repositories and loaded Git worktree state, keyed by the normalized main worktree path, then renders those families as a root row plus nested linked worktree rows.
This PR is rebased on top of the upstream fixes for worktree-name search, hierarchy-preserving filtered results, and Enter selection. The hierarchy post-processing now groups by worktree family path instead of only repository id, so those upstream behaviors still work when a saved linked worktree row is backed by a different repository id than the root row.
Changes:
The intent is not to reintroduce the old persisted data model. The new behavior is derived from existing saved repository entries plus upstream worktree state.
Acceptance Criteria
Risk Assessment
Risk tier: Medium
Affected areas: repository sidebar grouping/filtering, repository selection, worktree context menu actions, recent repository persistence, preferences UI, worktree refresh/prune flow, Copilot SDK compile compatibility.
Coverage added for the main risks:
yarn compile:devRemaining risk: manual UI density/regression risk in very large sidebar profiles, because the app does not have an end-to-end repository-sidebar fixture that mirrors a real multi-account worktree setup. I validated that manually with a local profile.
Test Plan
Automated:
yarn test:unit app/test/unit/section-list-test.ts app/test/unit/ui/section-filter-list-test.tsx app/test/unit/repositories-list-grouping-test.ts app/test/unit/ui/repositories-list-test.ts app/test/unit/ui/repository-list-item-test.tsx app/test/unit/repository-list-item-context-menu-test.tsyarn compile:devyarn build:prodManual QA:
Screenshots
Omitted for now because the validating profile contains private repository and worktree names. The automated tests use neutral paths/branches for the row-shape and filtering cases. I can add synthetic screenshots if needed.
Release notes
Notes: [Fixed] Restores grouped worktree rows and worktree-name filtering in the repository sidebar