Skip to content

ref(onboarding): Replace useEffect with derived state in ScmConnect#111359

Merged
jaydgoss merged 1 commit intomasterfrom
jaygoss/ref-scm-connect-derived-state
Mar 23, 2026
Merged

ref(onboarding): Replace useEffect with derived state in ScmConnect#111359
jaydgoss merged 1 commit intomasterfrom
jaygoss/ref-scm-connect-derived-state

Conversation

@jaydgoss
Copy link
Member

@jaydgoss jaydgoss commented Mar 23, 2026

Replace the useEffect that synced activeIntegrationExisting to onboarding context with a derived effectiveIntegration value. This eliminates a state-sync effect and makes the component's data flow more predictable.

To support this, ScmRepoSelector and useScmRepoSelection now receive the integration as a prop instead of reading selectedIntegration from context directly. The derived integration is persisted to context in the Continue handler when the user accepts the auto-detected default.

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 23, 2026
@jaydgoss jaydgoss marked this pull request as ready for review March 23, 2026 21:21
@jaydgoss jaydgoss requested a review from a team as a code owner March 23, 2026 21:21
@jaydgoss jaydgoss closed this Mar 23, 2026
@jaydgoss jaydgoss deleted the jaygoss/ref-scm-connect-derived-state branch March 23, 2026 21:22
@jaydgoss jaydgoss restored the jaygoss/ref-scm-connect-derived-state branch March 23, 2026 21:23
@jaydgoss jaydgoss reopened this Mar 23, 2026
@jaydgoss jaydgoss marked this pull request as draft March 23, 2026 21:23
@jaydgoss jaydgoss force-pushed the jaygoss/ref-scm-connect-derived-state branch from 76e09db to 057147d Compare March 23, 2026 21:25
@jaydgoss jaydgoss changed the base branch from jaygoss/vdy-23-scm-platform-features-step-functional-implementation-with to master March 23, 2026 21:25
Derive effectiveIntegration from selectedIntegration ?? activeIntegrationExisting
instead of syncing to context via useEffect. Pass integrationId as a
prop to ScmRepoSelector so it no longer reads selectedIntegration from
context directly. Persist the derived integration to context in the
Continue handler when the user accepts the default.
@jaydgoss jaydgoss force-pushed the jaygoss/ref-scm-connect-derived-state branch from 6c43ffe to 94a2cac Compare March 23, 2026 22:19
@jaydgoss jaydgoss merged commit ef19333 into master Mar 23, 2026
70 checks passed
@jaydgoss jaydgoss deleted the jaygoss/ref-scm-connect-derived-state branch March 23, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants