fix(onboarding): Reset downstream state when repository changes#111479
Merged
fix(onboarding): Reset downstream state when repository changes#111479
Conversation
2210996 to
1d46164
Compare
434a6ef to
6fac7ea
Compare
6fac7ea to
d52032d
Compare
d52032d to
4881665
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
4881665 to
ceed412
Compare
4899b24 to
a01d40f
Compare
ceed412 to
4451129
Compare
evanpurkhiser
approved these changes
Mar 26, 2026
7579eda to
a9522c5
Compare
938e03e to
081bf74
Compare
081bf74 to
1d584a7
Compare
a9522c5 to
a1ace12
Compare
Base automatically changed from
jaygoss/vdy-22-scm-connect-step-ui-polish-and-analytics-pass
to
master
March 26, 2026 20:21
When a user goes back to repo selection and picks a different repo, the previously selected platform, features, and created project slug are stale. Add clearDerivedState to the onboarding context that clears these fields without wiping the entire session (which setSelectedPlatform(undefined) would do), and call it from the repo selector onChange.
…repo Add test that clearDerivedState clears selectedPlatform, selectedFeatures, and createdProjectSlug while preserving selectedIntegration and selectedRepository in session storage.
Replace manual ContextReader component with renderHookWithProviders and additionalWrapper to match the established testing pattern. Also update the connected tag assertion to match the new format.
…xture Extract duplicated Next.js selectedPlatform object into a shared nextJsPlatform const in the SCM test suite. Use RepositoryFixture instead of an inline object with as any. Revert provider to inline to match OrganizationIntegration's type shape.
…elect Move clearDerivedState from the onSelect callback to handleChange so it only fires on direct user interaction. The hook's error-recovery path in handleRemove calls onSelect(previous) to restore the repo when the hide-API fails, which was incorrectly wiping platform, features, and created project state. VDY-22
Without this, clearing the repo via the select's clear button leaves the internal search term intact, causing stale results to appear when the dropdown reopens.
7b398d2 to
a83d006
Compare
Move clearDerivedState into the selection branch so error-recovery in handleRemove can restore the repo without losing platform and feature state. When the user clears and re-selects, clearDerivedState runs on the new selection.
Revert the previous move — derived state must be cleared when the user clears the repo too, otherwise stale features persist if the user navigates back and skips without re-selecting. The error-recovery edge case (API failure restoring repo without derived state) is an acceptable tradeoff.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

When a user navigates back to repo selection and picks a different repo, the previously selected platform, features, and created project slug are stale.
Adds
clearDerivedStateto the onboarding context that clears these fields in a single session storage update without wiping the entire session -- whichsetSelectedPlatform(undefined)would do due to theremoveOnboarding()call in its undefined branch.The repo selector's
onSelectcallback now callsclearDerivedState()whenever the repository changes.Stacked on PR #111478 (VDY-22: UI polish and analytics).
Refs VDY-22