diff --git a/apps/web/src/preview/main.tsx b/apps/web/src/preview/main.tsx index 3a9c9531..31982832 100644 --- a/apps/web/src/preview/main.tsx +++ b/apps/web/src/preview/main.tsx @@ -97,6 +97,7 @@ export const scenes: Record = { settings: { kind: "component", title: "设置(§ion=…)", artboard: "Settings" }, launch: { kind: "component", title: "启动画面", artboard: "Launch" }, "launch-error": { kind: "component", title: "启动出错", artboard: "Launch" }, + "launch-waiting": { kind: "component", title: "等待 Docker", artboard: "Launch" }, welcome: { kind: "component", title: "首次使用", artboard: "Welcome" }, connect: { kind: "component", title: "连接服务电脑", artboard: "Connect" }, login: { kind: "component", title: "登录", artboard: "Login" }, diff --git a/apps/web/src/preview/scenes.tsx b/apps/web/src/preview/scenes.tsx index 97db2a31..3529b271 100644 --- a/apps/web/src/preview/scenes.tsx +++ b/apps/web/src/preview/scenes.tsx @@ -6,6 +6,7 @@ import { App } from "../App"; import { AttachmentsManagerDialog } from "../components/AttachmentsManager"; import { DeleteIdentityDialog } from "../components/DeleteIdentityDialog"; import { DesktopConnectionScreen } from "../components/DesktopConnectionScreen"; +import { DesktopInstallScreen } from "../components/DesktopInstallScreen"; import { DesktopLocalWorkerScreen } from "../components/DesktopLocalWorkerScreen"; import { DesktopSettingsScreen, @@ -25,6 +26,7 @@ import { ModelSettingsScreen } from "../components/ModelSettingsScreen"; import { NodeManagerDialog } from "../components/NodeManagerDialog"; import { LaunchScreen } from "../components/Onboarding"; import { ShareConversationDialog } from "../components/ShareConversationDialog"; +import type { NativeServerState, OpenBotDesktopBridge } from "../desktop-runtime"; import { setPreviewStartLocation, type WorkspaceLocation } from "../workspace-navigation"; import { AvatarSpecimens, GroupSpecimens } from "./AvatarSpecimens"; import type { scenes as sceneTable } from "./main"; @@ -104,19 +106,25 @@ const components: Record ReactElement> = { banner: () => , groups: () => , launch: () => , + // The real startup screen over a fake Desktop bridge, so the copy can never drift from the app. "launch-error": () => ( - - - - - } + undefined} + onBack={() => undefined} + /> + ), + "launch-waiting": () => ( + (() => undefined), + )} + onReady={() => undefined} + onBack={() => undefined} /> ), welcome: () => ( @@ -189,3 +197,14 @@ function EditModelConnectionScene() { /> ); } + +/** A Desktop bridge that reports one startup state and answers the install call with `result`. */ +function startupBridge( + state: NativeServerState, + result: Promise, +): OpenBotDesktopBridge { + return { + getNativeServerState: async () => state, + installNativeServer: () => result, + } as unknown as OpenBotDesktopBridge; +}