feat(FN-3399): route desktop remote mode into shell onboarding flow

Removes the standalone `DesktopShellBootstrap` component from the desktop package, routing desktop remote mode into the shell onboarding flow instead. Updates the corresponding test file to reflect the component removal and adjusts the README.

Fusion-Task-Id: FN-3399
This commit is contained in:
Fusion
2026-05-04 22:53:57 -07:00
committed by gsxdsm
parent 8565cdcff7
commit f7995bd4e7
22 changed files with 521 additions and 40 deletions

View File

@@ -1,7 +1,13 @@
import { app, type BrowserWindow, ipcMain, type Tray } from "electron";
import { setupAutoUpdater, showExportSettingsDialog, showImportSettingsDialog } from "./native.js";
import { type EngineStatus, updateTrayStatus } from "./tray.js";
import { readShellSettings, writeShellSettings, type ShellConnectionProfile } from "./shell-settings.js";
import {
getDesktopShellModeState,
readShellSettings,
writeShellSettings,
type DesktopShellMode,
type ShellConnectionProfile,
} from "./shell-settings.js";
import type { DesktopLocalServerState } from "./local-server.js";
interface ShellConnectionProfileInput {
@@ -13,14 +19,18 @@ interface ShellConnectionProfileInput {
interface ShellConnectionState {
host: "desktop-shell";
desktopMode?: "local" | "remote";
desktopModeState: {
isFirstRun: boolean;
desktopMode: DesktopShellMode | null;
};
desktopMode?: DesktopShellMode;
activeProfileId: string | null;
profiles: ShellConnectionProfile[];
localServer?: DesktopLocalServerState;
}
interface RegisterIpcOptions {
onDesktopModeChange?: (mode: "local" | "remote") => Promise<void>;
onDesktopModeChange?: (mode: DesktopShellMode) => Promise<void>;
getLocalServerState?: () => DesktopLocalServerState;
getServerPort?: () => number | undefined;
}
@@ -39,7 +49,8 @@ function toShellState(
): ShellConnectionState {
return {
host: "desktop-shell",
desktopMode: settings.desktopMode,
desktopModeState: getDesktopShellModeState(settings),
desktopMode: settings.desktopMode ?? undefined,
activeProfileId: settings.activeProfileId,
profiles: settings.profiles,
localServer: localServerState ?? { status: "idle", error: null },
@@ -133,9 +144,15 @@ export function registerIpcHandlers(mainWindow: BrowserWindow, tray: Tray, optio
return emitShellState(mainWindow, options.getLocalServerState);
});
ipcMain.handle("shell:setDesktopMode", async (_event, mode: "local" | "remote") => {
ipcMain.handle("shell:getDesktopModeState", async () => {
const settings = await readShellSettings();
return getDesktopShellModeState(settings);
});
ipcMain.handle("shell:setDesktopMode", async (_event, mode: DesktopShellMode) => {
const settings = await readShellSettings();
settings.desktopMode = mode;
settings.hasCompletedModeSelection = true;
await writeShellSettings(settings);
await options.onDesktopModeChange?.(mode);
return emitShellState(mainWindow, options.getLocalServerState);