Skip to content

fix(onboarding): Sync SCM context with product toggles on setup-docs#113763

Merged
jaydgoss merged 2 commits intomasterfrom
jaygoss/sync-scm-onboarding-context-product-toggles
Apr 23, 2026
Merged

fix(onboarding): Sync SCM context with product toggles on setup-docs#113763
jaydgoss merged 2 commits intomasterfrom
jaygoss/sync-scm-onboarding-context-product-toggles

Conversation

@jaydgoss
Copy link
Copy Markdown
Member

@jaydgoss jaydgoss commented Apr 22, 2026

TL;DR

Product toggles on the setup-docs step don't sync back into OnboardingContext, so SCM back-navigation shows stale selections and re-expands deselected products on Continue.

This PR wires a callback from ProductSelection through SdkDocumentation and OnboardingLayout into setSelectedFeatures, keeping the context aligned with URL state when the SCM experiment is active.

Background

SCM onboarding preselects products in scmPlatformFeatures and forwards them to setup-docs via URL query. ProductSelection on the setup-docs step still renders and writes toggles back to the URL, but not to OnboardingContext. Back-navigation then reads stale selectedFeatures, shows previously-deselected items as checked, and re-expands them on Continue.

The fix

Thread an optional onProductSelectionSync callback through SdkDocumentation and OnboardingLayout so setupDocs can wire setSelectedFeatures in when the SCM experiment is active. The callback is composed with the existing doc.onProductSelectionChange handler so both fire on every toggle. Legacy onboarding passes undefined and is unchanged.

Not addressed

Toggles on setup-docs do not fire onboarding.scm_platform_feature_toggled. The legacy ProductSelection has no analytics on toggle at all, so there is no parallel event to emit; that would need a new handler if funnel coverage on this edge becomes important.

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 22, 2026
SCM onboarding preselects products in scmPlatformFeatures and passes them
to setup-docs via URL query. ProductSelection on setup-docs still renders
and writes toggles back to the URL, but not to the onboarding context.
Going back to scmPlatformFeatures then read stale selectedFeatures and
re-expanded deselected products on continue.

Thread an optional onProductsChange callback through SdkDocumentation and
OnboardingLayout so setupDocs can wire setSelectedFeatures in when the
SCM experiment is active. Legacy onboarding passes undefined and is
unchanged.
The callback read too similarly to the sibling onProductSelectionChange
it composes with. Sync makes the "mirror state elsewhere" role explicit
versus Change as "react to a toggle".
@jaydgoss jaydgoss force-pushed the jaygoss/sync-scm-onboarding-context-product-toggles branch from 51a4be1 to 03fed2a Compare April 22, 2026 23:14
@jaydgoss jaydgoss marked this pull request as ready for review April 23, 2026 14:39
@jaydgoss jaydgoss requested a review from a team as a code owner April 23, 2026 14:39
@jaydgoss jaydgoss requested a review from a team April 23, 2026 14:40
@jaydgoss jaydgoss merged commit ee30662 into master Apr 23, 2026
68 checks passed
@jaydgoss jaydgoss deleted the jaygoss/sync-scm-onboarding-context-product-toggles branch April 23, 2026 14:48
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