feat(FN-3398): update desktop README with multi-project setup and troublesh

The merge lands Step 7 of FN-3398, adding documentation and delivery artifacts across the mobile and desktop packages with updated READMEs, mobile-specific docs, and architecture references.

Fusion-Task-Id: FN-3398
This commit is contained in:
Fusion
2026-05-04 21:41:52 -07:00
committed by gsxdsm
parent 9699c3f2b6
commit 3feeb9026a
43 changed files with 2025 additions and 398 deletions

View File

@@ -13,6 +13,8 @@ import {
} from "./native.js";
import { setupTray } from "./tray.js";
import { getRendererUrl, getRendererFilePath, isUrlRenderer } from "./renderer.js";
import { DesktopLocalServerManager } from "./local-server.js";
import { readShellSettings } from "./shell-settings.js";
// Re-export for backward compatibility
export { IS_DEVELOPMENT } from "./renderer.js";
@@ -33,6 +35,7 @@ enableSourceMaps();
let mainWindow: BrowserWindow | null = null;
let tray: Tray | null = null;
let localServerManager: DesktopLocalServerManager | null = null;
function getAppWithQuitFlag(): Electron.App & AppWithQuitFlag {
return app as Electron.App & AppWithQuitFlag;
@@ -88,14 +91,34 @@ export async function initializeApp(): Promise<void> {
appName: "Fusion",
});
localServerManager = new DesktopLocalServerManager(process.cwd());
tray = new Tray(nativeImage.createEmpty());
setupTray(createdWindow, tray);
registerIpcHandlers(createdWindow, tray);
registerIpcHandlers(createdWindow, tray, {
onDesktopModeChange: async (mode) => {
if (!localServerManager) {
return;
}
if (mode === "local") {
await localServerManager.start();
} else {
await localServerManager.stop();
}
},
getLocalServerState: () => localServerManager?.getState() ?? { status: "idle", error: null },
getServerPort: () => localServerManager?.getPort(),
});
registerDeepLinkProtocol();
setupDeepLinkHandler(createdWindow);
setupAutoUpdater(createdWindow);
const shellSettings = await readShellSettings();
if (shellSettings.desktopMode === "local") {
await localServerManager.start();
}
if (state?.isMaximized === true) {
createdWindow.maximize();
}
@@ -119,6 +142,10 @@ export function run(): void {
tray.destroy();
tray = null;
}
if (localServerManager) {
void localServerManager.stop();
}
});
app.on("activate", () => {