Skip to content

feat(frontend): allow creating serverfull instances during onboarding#5035

Open
jog1t wants to merge 1 commit into
05-11-feat_frontend_add_provider_iconsfrom
05-11-feat_frontend_allow_creating_serverfull_instances_during_onboarding
Open

feat(frontend): allow creating serverfull instances during onboarding#5035
jog1t wants to merge 1 commit into
05-11-feat_frontend_add_provider_iconsfrom
05-11-feat_frontend_allow_creating_serverfull_instances_during_onboarding

Conversation

@jog1t
Copy link
Copy Markdown
Contributor

@jog1t jog1t commented May 11, 2026

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@jog1t jog1t marked this pull request as ready for review May 11, 2026 18:42
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 11, 2026

PR Review: feat(frontend): allow creating serverfull instances during onboarding

Overview

This PR adds support for creating serverfull runner instances during the onboarding flow. It introduces a mode toggle (serverless/serverfull) in BackendSetup, refactors it into dedicated BackendSetupServerless and BackendSetupServerfull sub-components, adds a "Skip onboarding" link for non-platform environments, and moves onboarding-display logic into the namespace route loader.


Issues

Debug artifacts that must be removed before merge

frontend/src/app/dev-toolbar.tsx

A console.log was added at the top of DevToolbar that logs a localStorage key read on every render into the browser console in production. Remove this before merging.

frontend/src/routes/__root.tsx<DevToolbar /> was moved outside the DEV-only guard and now renders unconditionally in CloudRoute. The component itself gates on a localStorage flag, but rendering it unconditionally means its code is always evaluated in production. Verify this is intentional or gate it the same way as TanStackRouterDevtools.


Type-safety issues

getting-started.tsx — repeated as unknown as casts

The form values are cast with values as unknown as { runnerName, provider, mode } in the submit handler. Since Zod schema shapes are known at compile time, derive the union type with z.infer from both branch schemas so these casts are unnecessary.

ns.$namespace.tsxsearch as unknown as cast

This bypasses TanStack Router's typed search params. Add skipOnboarding and onboardingSuccess to the route's validateSearch so they appear in the typed SearchSchema and the cast is unnecessary.

ns.$namespace.tsxdeps as cast

loaderDeps returns a typed object that is then cast again in loader. Typing the return of loaderDeps directly avoids the second cast.


Routing/logic concerns

beforeLoad redirect makes the loaderDeps dep dead code

If beforeLoad always redirects when skipOnboarding is set (clearing search), the d.skipOnboarding check in the loader body can never be true — it is unreachable. Either handle the skip entirely in the loader (no redirect) or remove the redundant loaderDeps/loader dep for skipOnboarding.

Stale isSkipped === true strict check

ls.get() can return a truthy non-true value (e.g. "true" as a string). The strict === true check may silently fail. Use a plain truthiness check (if (isSkipped)) or ensure ls.get always deserializes the stored boolean correctly.


Fragile schema dispatch

The fallback Zod schema includes mode as optional but does not validate serverfull-specific required fields (e.g. datacenter). If values.mode is not yet set during initial validation, the wrong schema is selected and required-field errors won't fire for the serverfull branch. Consider a discriminated union at the top level so Zod always picks the correct branch.


Silent error in managed pool mutation fallback

The fallback mutationFn throws a plain Error with no user-visible feedback. If this code path is reachable in the serverfull flow the user will see an unhandled error rather than a clear message. Either gate the UI so this mutation is never triggered on non-cloud providers, or add an onError handler that surfaces a toast.


useServerfullEndpoint — unnecessary query before datacenter is selected

When datacenter is empty this fires a query for "auto", which may not exist and generates a spurious network request on every render before the user selects a datacenter. Add enabled: !!datacenter to skip the query until a real selection is made.


Positive observations

  • Splitting BackendSetup into BackendSetupServerless and BackendSetupServerfull is a clean separation of concerns.
  • Moving onboarding-display logic into the route loader aligns with the project's TanStack Router conventions for async-computed values.
  • The fetchInfiniteQuery + Promise.all loader pattern is consistent with existing code.
  • Gating the "Skip onboarding" link on !features.platform is appropriate.

Summary

The blocking issue is the console.log debug artifact in dev-toolbar.tsx that must be removed before merge. The unconditional <DevToolbar /> render in __root.tsx also needs verification. The remaining issues are type-safety and logic correctness concerns worth addressing.

@jog1t jog1t force-pushed the 05-11-feat_frontend_add_provider_icons branch from 97c2f75 to 577a189 Compare May 11, 2026 18:49
@jog1t jog1t force-pushed the 05-11-feat_frontend_allow_creating_serverfull_instances_during_onboarding branch from e600754 to 81994b8 Compare May 11, 2026 18:49
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.

1 participant