Skip to content

Select repositories added while managing account repositories - #23254

Merged
niik merged 1 commit into
developmentfrom
niik-manage-repositories-review-follow-ups
Dec 2, 2026
Merged

niik merged 1 commit into
developmentfrom
niik-manage-repositories-review-follow-ups

Conversation

@niik

@niik niik commented Dec 1, 2026

Copy link
Copy Markdown
Member

Follow-up to #23223. Relates to #376 (part of #375).

Description

  • Addresses this review comment from Manage repositories for an account #23223. The Manage repositories dialog only set up its selection when it was first opened. A repository added while it was open, such as a background clone assigned to the account, was left unchecked, so submitting cleared its assignment even though the user never unchecked it.
  • ManageAccountRepositoriesDialog now uses getDerivedStateFromProps to 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.
  • Not addressed here: the comment about telling identical clones apart. We're not showing each repository's full local path in the list until users tell us it's a real problem. We think repository aliases already handle most of these cases.

Validation (at f8ef25b):

  • npx tsc --noEmit --skipLibCheck: passed
  • npm test -- app/test/unit/ui/manage-account-repositories-test.tsx app/test/unit/account-repositories-test.ts: 11 tests passed
  • New rerender regression test: fails without the dialog change (the new alice repository stays unchecked and is missing from the submitted selection) and passes with it
  • npm run lint:fix: no changes

Screenshots

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.

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]>
@niik
niik requested a review from a team as a code owner December 1, 2026 10:32
@niik
niik requested review from tidy-dev and a balanced review from Copilot December 1, 2026 10:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@niik
niik merged commit 7b09cd3 into development Dec 2, 2026
23 of 25 checks passed
@niik
niik deleted the niik-manage-repositories-review-follow-ups branch December 2, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants