Skip to content

Commit 8a584a6

Browse files
committed
Seed direct onboarding config readiness
1 parent 75599d3 commit 8a584a6

2 files changed

Lines changed: 49 additions & 9 deletions

File tree

‎desktop/src/features/onboarding/ui/DefaultConfigStep.tsx‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ import {
2525
type OnboardingTransitionDirection,
2626
OnboardingSlideTransition,
2727
} from "./OnboardingSlideTransition";
28-
import { getVisibleOnboardingRuntimes } from "./onboardingRuntimeSelection";
28+
import {
29+
getReadyOnboardingRuntimes,
30+
getVisibleOnboardingRuntimes,
31+
} from "./onboardingRuntimeSelection";
2932
import type { DefaultConfigStepActions } from "./types";
3033

3134
type DefaultConfigStepProps = {
@@ -107,9 +110,18 @@ function AgentDefaultsSection({
107110
};
108111
}, []);
109112

113+
const effectiveReadyRuntimeIds = React.useMemo(
114+
() =>
115+
readyRuntimeIds.length > 0
116+
? readyRuntimeIds
117+
: getReadyOnboardingRuntimes(runtimesQuery.data ?? []).map(
118+
(runtime) => runtime.id,
119+
),
120+
[readyRuntimeIds, runtimesQuery.data],
121+
);
110122
const readyRuntimeIdSet = React.useMemo(
111-
() => new Set(readyRuntimeIds),
112-
[readyRuntimeIds],
123+
() => new Set(effectiveReadyRuntimeIds),
124+
[effectiveReadyRuntimeIds],
113125
);
114126
// Setup already confirmed readiness. Re-filter only for onboarding
115127
// visibility here; a transient auth recheck must not invalidate that handoff.
@@ -131,7 +143,7 @@ function AgentDefaultsSection({
131143
const configSurfaceError =
132144
runtimesQuery.isError ||
133145
(!configSurfaceLoading &&
134-
readyRuntimeIds.length > 0 &&
146+
effectiveReadyRuntimeIds.length > 0 &&
135147
readyRuntimes.length === 0);
136148
const harnessOptions = React.useMemo(
137149
() =>

‎desktop/tests/e2e/onboarding.spec.ts‎

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,11 +1042,35 @@ test("first-community shows the scenario cards for localhost", async ({
10421042
"true",
10431043
);
10441044
}, BLANK_TYLER_IDENTITY.pubkey);
1045-
await installMockBridge(page, undefined, {
1046-
relayWsUrl: "ws://localhost:3000",
1047-
skipOnboardingSeed: true,
1048-
skipCommunitySeed: true,
1049-
});
1045+
await installMockBridge(
1046+
page,
1047+
{
1048+
acpRuntimesCatalog: [
1049+
{
1050+
id: "claude",
1051+
label: "Claude Code",
1052+
avatar_url: "",
1053+
availability: "available",
1054+
command: "claude",
1055+
binary_path: "/usr/local/bin/claude",
1056+
default_args: [],
1057+
mcp_command: null,
1058+
install_hint: "Install Claude Code",
1059+
install_instructions_url: "https://example.com",
1060+
can_auto_install: true,
1061+
underlying_cli_path: null,
1062+
node_required: false,
1063+
auth_status: { status: "logged_in" },
1064+
login_hint: "Sign in to Claude Code",
1065+
},
1066+
],
1067+
},
1068+
{
1069+
relayWsUrl: "ws://localhost:3000",
1070+
skipOnboardingSeed: true,
1071+
skipCommunitySeed: true,
1072+
},
1073+
);
10501074
await page.goto("/");
10511075

10521076
await expect(
@@ -1068,6 +1092,10 @@ test("first-community shows the scenario cards for localhost", async ({
10681092
name: "Configure your default model settings",
10691093
}),
10701094
).toBeVisible();
1095+
await expect(page.getByTestId("global-agent-default-harness")).toHaveText(
1096+
"Claude Code",
1097+
);
1098+
await expect(page.getByTestId("onboarding-finish")).toBeEnabled();
10711099
});
10721100

10731101
test("first-community direct join reaches profile", async ({ page }) => {

0 commit comments

Comments
 (0)