fix(onboarding): Commit the auto-detected platform to the host#117341
Merged
Conversation
This was referenced Jun 10, 2026
63dd544 to
091ca70
Compare
e42667a to
2c1178d
Compare
091ca70 to
8f214e1
Compare
2c1178d to
d00ee76
Compare
8f214e1 to
a4dda0c
Compare
d00ee76 to
5f1bc6b
Compare
a4dda0c to
92f270f
Compare
5f1bc6b to
06ba6e8
Compare
jaydgoss
added a commit
that referenced
this pull request
Jun 10, 2026
…d core (#117209) ## TLDR Splits the SCM onboarding project-details step into a reusable `useScmProjectDetails` hook plus a presentational `ScmProjectDetailsCore`, so the SCM-first project-creation flow can reuse it and place its own Create button. No behavior change; the existing spec passes unchanged. ## Details - `useScmProjectDetails` owns the form state, the create-project + repo-link flow, the reuse ("nothing changed") short-circuit, and the field/create analytics, routed by an `analyticsFlow` prop. It also supports a no-access member path (`allowMemberWithoutTeam`), off by default. - `ScmProjectDetailsCore` is the presentational name / team / alert-frequency form. It fires the `step_viewed` analytics when shown and hides the team selector for no-access members. Keeping the submit handler in the hook (rather than a render-prop) means each host renders its own Create button wherever it wants, decoupled from where the fields render. - `ScmProjectDetails` (onboarding) is now a thin wrapper: the step header plus the fixed footer with the Back and Create buttons. This is the VDY-76 equivalent of the `ScmPlatformFeaturesCore` extraction (#116624). ## Stack - **PR 1 (this):** Extract project-details form into a hook and core - [PR 2](#117325): Keep getting-started rendered while back nav deletes - [PR 3](#117333): Drive the project-details form from host state - [PR 4](#117213): Wire into single-view project creation - [PR 5](#117341): Commit the auto-detected platform to the host - [PR 6](#117342): Explain the disabled Create CTA in the SCM wizard Refs VDY-76
92f270f to
b52dc19
Compare
06ba6e8 to
b8d040a
Compare
jaydgoss
added a commit
that referenced
this pull request
Jun 11, 2026
…#117325) ## TLDR Keeps the getting-started page rendered when its project disappears from the projects store mid-session, reserving the not-found redirect for projects that were never found. This stops the back nav's project deletion from bouncing to the create-project page without the referrer and project query params. ## Details - The back nav from getting-started (`PlatformDocHeader.handleGoBack`) deletes inactive projects before navigating to the create-project page tagged with `?referrer=getting-started&project=<id>`. The deletion order is deliberate: downstream flows rely on the projects store being updated before they mount (see the equivalent comment in onboarding's `useBackActions`). - The DELETE updates the store while getting-started is still mounted, so its project-not-found fallback fired first and redirected to the create-project page bare, racing the tagged replace navigation. Classic project creation tolerates this reactively (see the delayed route replace regression test in `createProject.spec.tsx`), but the params still arrive a full request roundtrip late, and the single-view flow in PR 3 restores a saved wizard session from them, which made the race visible as a flash of reset state. - Getting-started now latches the last project found for the current slug and keeps rendering it if it vanishes from the store, so the only navigation away is the back nav's own tagged replace. A project deleted from another tab now leaves the docs page in place instead of bouncing immediately, which seems less surprising. ## Stack - [PR 1](#117209): Extract project-details form into a hook and core (merged) - **PR 2 (this):** Keep getting-started rendered while back nav deletes - [PR 3](#117333): Drive the project-details form from host state - [PR 4](#117213): Wire into single-view project creation - [PR 5](#117341): Commit the auto-detected platform to the host - [PR 6](#117342): Explain the disabled Create CTA in the SCM wizard Refs VDY-76
b52dc19 to
bd25648
Compare
b8d040a to
7cf099c
Compare
jaydgoss
added a commit
that referenced
this pull request
Jun 11, 2026
) ## TLDR Makes the SCM project-details hook fully host-driven: the form state lives with the caller (`projectDetailsForm` plus `onProjectDetailsFormChange`, where absent fields derive their defaults), and completion is reported through a single `onComplete` carrying the created project and the submitted form. Prepares the hook for the single-view project-creation host, which keeps it mounted across platform changes and needs clears to actually reach the fields. ## Details - Previously the hook seeded internal `useState` once at mount from the host's saved form, an artifact of the step component it was extracted from, which remounts on every onboarding navigation. A host that stays mounted (the single-view wizard) could clear its form without the live fields noticing. - Controlled now: absent fields fall back to derived defaults (platform-based name, first admin team, default alert config), so a cleared form re-derives by construction. Covered by a new regression test. - The unchanged-return reuse check compares against the form captured at mount (a restored session's saved values), since the live prop can no longer be its own baseline. - The three completion callbacks (`onProjectCreated`, completion-time `onProjectDetailsFormChange`, `onComplete`) collapse into one `onComplete({project, projectDetailsForm})`. On a successful submit they always fired together, so no host could observe a meaningful intermediate state. The reuse path now reports the reused project and form, which match what the host already has. - The onboarding step holds the live form in local state seeded from the context, which keeps the context to submitted values only: a step remount cannot adopt unsubmitted edits as the reuse baseline, and abandoned edits are discarded on navigation, matching the step's previous behavior and classic createProject. The completion payload still flows to the existing context setters, so observable onboarding behavior is unchanged. ## Stack - [PR 1](#117209): Extract project-details form into a hook and core (merged) - [PR 2](#117325): Keep getting-started rendered while back nav deletes (merged) - **PR 3 (this):** Drive the project-details form from host state - [PR 4](#117213): Wire into single-view project creation - [PR 5](#117341): Commit the auto-detected platform to the host - [PR 6](#117342): Explain the disabled Create CTA in the SCM wizard Refs VDY-76
bd25648 to
42515d2
Compare
7cf099c to
fc8e6f1
Compare
fc8e6f1 to
7b6d155
Compare
jaydgoss
added a commit
that referenced
this pull request
Jun 12, 2026
… creation (#117213) ## TLDR Wires the SCM project-details form into the single-view project-creation flow: a Project details section plus an always-present, page-level Create CTA that creates the project and navigates to its getting-started page. Includes parity with classic project creation for members with no admin team. Messaging-integration alerts are deferred to VDY-50. ## Details - Drives the Project details section with `useScmProjectDetails` and the presentational `ScmProjectDetailsCore`. - The Create CTA is a page-level footer, available regardless of which steps are currently revealed (disabled until a platform and details are ready), alongside `ProjectCreationErrorAlert`. - Adds `projectDetailsForm` to the wizard state and clears it when the platform or repository changes (resolving the two standing TODOs). - On success, navigates to the created project's getting-started page via `makeProjectsPathname`. - In-progress wizard state is in-memory, so a fresh visit or reload starts clean. A completed session is snapshotted to session storage when the project is created and restored when returning from its getting-started page, with the return condition computed reactively from the `referrer`/`project` query params (mirroring classic `createProject` autofill) since the back nav can deliver them after mount. - On a restored return, clicking Create with nothing changed reuses the existing project instead of creating a duplicate; any edit abandons it and creates a new one, matching legacy onboarding. - `allowMemberWithoutTeam`: when the viewer has no admin team and can't create one, the team selector is hidden and the project is created with no team (backend assigns one), matching classic `createProject`. Off in onboarding. ## Stack - [PR 1](#117209): Extract project-details form into a hook and core (merged) - [PR 2](#117325): Keep getting-started rendered while back nav deletes (merged) - [PR 3](#117333): Drive the project-details form from host state - **PR 4 (this):** Wire into single-view project creation - [PR 5](#117341): Commit the auto-detected platform to the host - [PR 6](#117342): Explain the disabled Create CTA in the SCM wizard Refs VDY-76
Base automatically changed from
jaygoss/vdy-76-wire-scm-project-details-core
to
master
June 12, 2026 17:44
7b6d155 to
e3e49d2
Compare
jaydgoss
added a commit
that referenced
this pull request
Jun 15, 2026
## TLDR The single-view SCM project creation wizard revealed the Platform & features and Project details sections only after the repo step was completed. This shows all sections up front so the whole form is visible immediately, and removes the progressive-disclosure state that drove the reveal. ## Details Previously `repoStepCompleted` gated sections 2 and 3, flipping true when a repo was selected or the user clicked "Continue without connecting a repo". With everything visible at once that scaffolding is no longer needed, so this removes the `repoStepCompleted` wizard state and its initial value, the `showAllSteps` and `showContinueWithoutRepo` derived flags, the `completeRepoStep` handler and the "Continue without connecting a repo" button, and the now-unused `Fragment` and `MotionFlex`. Connecting a repo stays optional. The page-level Create CTA still validates platform, name, and team, so submission behavior is unchanged. Tests now assert all sections render on a fresh visit, and verify the persisted-session restore by field value rather than by section visibility. ## Notes This branches from master and is independent of the open stack PRs #117341 and #117342, which also touch `scmCreateProject.tsx`. Whichever lands first, the other will need a rebase to resolve overlap in the CTA and section regions. One cosmetic follow-up left out of scope: the first section's heading still reads "Create a new project" (duplicating the page title) above the repo-connect step, which is a little odd now that all steps show together. --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
The platform-features core only derived the displayed platform from detection, committing to the host via onPlatformChange on explicit picks. The onboarding step papers over this with a fallback commit in its Continue handler, but the single-view project-creation flow has no Continue boundary: accepting the detected platform left the wizard's selectedPlatform unset, so the project name never defaulted and the Create CTA stayed disabled with no way to proceed short of re-picking the platform manually. Commit the detected platform in the same once-per-repo effect that fires the platform-selected analytics. The onboarding step's fallback commit becomes a no-op and stays as belt and braces.
e3e49d2 to
5eadafc
Compare
evanpurkhiser
approved these changes
Jun 16, 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.
TLDR
Commits the auto-detected platform to the host in the platform-features core instead of only deriving it for display. In the single-view project-creation flow there is no Continue boundary to commit it later, so accepting the detected platform left the wizard without a platform: the project name never defaulted and the Create CTA stayed disabled.
Details
selectedPlatform?.key ?? detectedPlatformKeybut only calledonPlatformChangeon explicit picks. The onboarding step compensates with a fallback commit in its Continue handler; the single-view flow has no equivalent, so detection-only sessions never populatedselectedPlatform.scm_platform_selectedanalytics, with the same guards: skipped when the user already picked, re-armed on repo change. It does not callonClearProjectDetailsForm, so a restored form is not cleared.Stack
Refs VDY-76