feat(site): wire template builder entrypoint from templates list page by jeremyruppel · Pull Request #26756 · coder/coder · GitHub
Skip to content

feat(site): wire template builder entrypoint from templates list page#26756

Open
jeremyruppel wants to merge 3 commits into
mainfrom
feat/template-builder-entrypoint
Open

feat(site): wire template builder entrypoint from templates list page#26756
jeremyruppel wants to merge 3 commits into
mainfrom
feat/template-builder-entrypoint

Conversation

@jeremyruppel

Copy link
Copy Markdown
Contributor

The templates list page "New template" button and the empty-state "View all starter templates" button now link to /templates/new/builder when the template builder is enabled in the deployment config, falling back to /starter-templates when disabled.

The TemplateBuilderPage now checks createTemplates permission and redirects to /templates if the user lacks access. The templateBuilderBases query is also gated on enabled to avoid a 404 when the feature is disabled.

Implementation details
  • TemplatesPage fetches deploymentConfig() (only when user has createTemplates permission) and computes templateBuilderEnabled using === false to default safely while loading.
  • templateBuilderEnabled is threaded through TemplatesPageView and EmptyTemplates to conditionally set link targets.
  • TemplateBuilderPage uses useAuthenticated() to check permissions.createTemplates before rendering.
  • Added Storybook story variants for the builder-enabled state.

Generated by Coder Agents on behalf of @jeremyruppel

Route the 'New template' button to /templates/new/builder when the
template builder is enabled in the deployment config, falling back to
/starter-templates when disabled. Add createTemplates permission check
to TemplateBuilderPage and gate the bases query to avoid 404s when
the feature is disabled.
Use strict === false check so templateBuilderEnabled defaults to false
while deployment config is loading or on error, preventing a brief
wrong link target. Add story variants for the builder-enabled state.
The disabled field uses omitempty, so it is undefined (not false) when
the builder is enabled. Use isSuccess to avoid the loading default
issue while correctly treating undefined as not-disabled.
Comment on lines 76 to 78

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tracyjohnsonux @aqandrew this is the empty state for the templates view. right now these cards navigate to /templates/new?exampleId=docker. should we similarly deep link into template builder, at least for the base template?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the template builder is the preferred method we want to funnel users to, then yeah I think that's a great idea

@jeremyruppel jeremyruppel marked this pull request as ready for review June 26, 2026 17:23
@jeremyruppel jeremyruppel requested a review from aqandrew June 26, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants