Repository navigation
Select repositories added while managing account repositories - #23254
Merged
Merged
Conversation
The dialog only initialized its selection when it was constructed, so a repository that was added while it was open, such as a finished clone assigned to the account, was left unselected and had its assignment cleared on submit. Apply the default selection rules to newly arriving repositories while preserving the choices for existing ones. Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the repository-selection synchronization change.
No open issues 🎉
What changed in this PR
This follow-up to #23223 keeps the Manage repositories dialog’s selection in sync with repositories added or removed while it is open, preventing newly assigned repositories from being unintentionally unassigned on submission.
Changes:
- Apply default selection rules to newly added repositories without resetting existing user choices.
- Remove departed repositories from selection state.
- Add a rerender regression test covering new repositories, preserved choices, and submitted selections.
| File | Description |
|---|---|
| app/test/unit/ui/manage-account-repositories-test.tsx | Adds rerender support and a regression test for repositories added while the dialog is open. |
| app/src/ui/repository-account/manage-account-repositories-dialog.tsx | Tracks known repositories and reconciles selection when the repository list changes. |
Review effort: Balanced
tidy-dev
approved these changes
Dec 1, 2026
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.
Follow-up to #23223. Relates to #376 (part of #375).
Description
ManageAccountRepositoriesDialognow usesgetDerivedStateFromPropsto apply the existing default-selection rules (getInitialAccountRepositorySelection) to newly added repositories only. Choices the user already made on existing rows stay as they are. Repositories removed while the dialog is open are dropped from the selection, so a repository that comes back gets the default selection again.Validation (at f8ef25b):
npx tsc --noEmit --skipLibCheck: passednpm test -- app/test/unit/ui/manage-account-repositories-test.tsx app/test/unit/account-repositories-test.ts: 11 tests passedalicerepository stays unchecked and is missing from the submitted selection) and passes with itnpm run lint:fix: no changesScreenshots
N/A, no visual change.
Release notes
Notes: no-notes
Team-authored review
Evidence: See the validation list in the Description. Nothing visual changed, so there's no recording.
Review path: Lightweight review. This only changes which rows start selected when repositories are added while the dialog is open. It prevents an assignment from being cleared that the user didn't uncheck.