fix(onboarding): skip agents step when zero agents and go to company builder.

When the wizard reaches the agents step with no agents discovered,
auto-advance to the company step so users can immediately build their
company without seeing a dead-end "No agents found" screen.

Made-with: Cursor
This commit is contained in:
iamlukethedev
2026-04-08 18:58:08 -05:00
committed by iamlukethedev
parent e8d82b29b7
commit e9d59ace84
2 changed files with 8 additions and 8 deletions
@@ -8,11 +8,8 @@ export type CompanyStepProps = {
export const CompanyStep = ({
connected,
agentCount,
onOpenCompanyBuilder,
}: CompanyStepProps) => {
const canOpenBuilder = connected && agentCount > 0;
return (
<div className="space-y-4">
<div className="rounded-lg border border-amber-500/20 bg-amber-500/10 px-4 py-4">
@@ -60,7 +57,7 @@ export const CompanyStep = ({
</div>
<div className="pt-4">
{canOpenBuilder ? (
{connected ? (
<div className="flex justify-center">
<button
type="button"
@@ -73,8 +70,7 @@ export const CompanyStep = ({
</div>
) : (
<div className="rounded-md border border-amber-500/20 bg-amber-500/10 px-4 py-3 text-xs text-amber-100/80">
Connect to a runtime and keep at least one planning agent available to generate the
company with AI.
Connect to a runtime to generate your company with AI.
</div>
)}
</div>
@@ -88,13 +88,17 @@ export const OnboardingWizard = ({
const goNext = useCallback(() => {
markComplete(currentStep);
const next = getNextStep(currentStep);
let next = getNextStep(currentStep);
if (next === "agents" && agentCount === 0) {
markComplete("agents");
next = "company";
}
if (next) {
setCurrentStep(next);
} else {
onComplete();
}
}, [currentStep, markComplete, onComplete]);
}, [agentCount, currentStep, markComplete, onComplete]);
const goPrev = useCallback(() => {
const prev = getPrevStep(currentStep);