feat(site/src/pages/TemplateBuilder): deep-link base template via query param - #26808
Closed
jeremyruppel wants to merge 2 commits into
Closed
feat(site/src/pages/TemplateBuilder): deep-link base template via query param#26808jeremyruppel wants to merge 2 commits into
jeremyruppel wants to merge 2 commits into
Conversation
…ry param Add support for a `?base=<id>` query parameter on `/templates/new/builder` that preselects a base template and advances the wizard to the next available step (base parameters if applicable, otherwise module select). - Move `toSelectedBaseMeta` from `BaseInfraSelectStep` to `wizardState` as a shared data mapper. - In `TemplateBuilderPage`, read the `?base` search param and resolve it against the bases query before rendering the view. - In `TemplateBuilderPageView`, accept a `preselectedBase` prop and use it to initialize reducer state and step index.
…o resolvedInitialState
jeremyruppel
force-pushed
the
jeremy/devex-557-deeplink-to-base-template
branch
from
June 30, 2026 13:30
d88209d to
6108fc5
Compare
code-asher
approved these changes
Jul 1, 2026
Member
There was a problem hiding this comment.
Did not run it but it looks reasonable to me!
One downside is that I think without a query param we would get the outline rendered and then as the bases query loads we get another loader inside the select step?
But now if you set ?base then you get the higher-level loader even though it is still the same query you are waiting for.
Not a big deal by any means but maybe there is a case to be made for a bit of a refactor where we pass in the query param and the state stores just the ID rather than needing the whole base up front (unless this is a big lift).
jeremyruppel
added a commit
that referenced
this pull request
Jul 8, 2026
Add a ?base=<baseId> query param that preselects a base template when entering the wizard. The page container resolves the base from the API before mounting the view, then passes it as preselectedBase. The view initializes the reducer with the base already selected and defaults to the next step past base-infra when no explicit ?step= param is present. Also moves toSelectedBaseMeta from BaseInfraSelectStep to wizardState so both the page container and the step component can reuse it. Supersedes #26808.
jeremyruppel
added a commit
that referenced
this pull request
Jul 14, 2026
#27104) Browser back/forward controls did not work in the template builder wizard. Using browser navigation sent the user out of the wizard entirely instead of moving between steps. The wizard's current step is now driven by a `?step=` search param. Step transitions push history entries so browser back/forward walks the steps. Steps that are invalid, skipped, or unreachable given the wizard state are clamped and the URL is rewritten with a replace, keeping URL and state in sync in both directions. `?base=` is accepted as the only entry search param and deep-links to a preselected base template (superseding #26808). The page container resolves it against the available bases, holds the wizard behind a loader until it is consumed and removed from the URL, then mounts the wizard starting on the first step after base selection. Closes https://linear.app/codercom/issue/DEVEX-594 > Generated with [Coder](https://coder.com) by @jeremyruppel
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.
Adds support for a
?base=<id>query parameter on/templates/new/builderthat preselects a base template and advances the wizard to the next available step (base parameters if applicable, otherwise module select).Changes
wizardState.ts: MovetoSelectedBaseMetahere as a shared data mapper between the APITemplateBuilderBasetype and the UISelectedBaseMetatype.BaseInfraSelectStep.tsx: ImporttoSelectedBaseMetafromwizardStateinstead of defining it locally.TemplateBuilderPage.tsx: Read the?basesearch param. When present, wait for bases data to load, resolve the matching base, and pass it as apreselectedBaseprop.TemplateBuilderPageView.tsx: AcceptpreselectedBaseprop. Use it to initialize wizard reducer state and starting step index at mount time (no effects or refs needed).Example
/templates/new/builder?base=dockeropens the wizard with Docker preselected, landing on base parameters or module select depending on the base.