From d4935aa2a28fcbab8c3556e3532e53667092701e Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Fri, 11 Sep 2026 14:17:55 +0200 Subject: feat: gate the create-group wizard on whether a node is bundled MeshBay Light has no bundled meshbay-node.exe, so the create-group wizard (which assumes it can start a local node) needs its own signal, not just platform.node.available. main.js exposes it over IPC (node:bundled) by checking the packaged resources directory rather than trusting a build-time constant; preload.js and platform.js carry it through the usual contextBridge/wrapper path. winCanElevateServiceMode() replaces the two prior 'app.isPackaged' checks for whether the app can offer service-mode elevation -- Light is packaged but has no service-mode.ps1 to elevate into, so packaged alone was already the wrong test even before this target existed. create-group-page.js gates the wizard step that starts a node on the new capability instead of hiding the whole feature; node-page.js's comment fix is unrelated cosmetic drift caught in the same pass. Co-Authored-By: Claude Sonnet 5 --- .../src/meshbay_hub/static/create-group-page.js | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js') diff --git a/packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js b/packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js index c3b542f..f81247d 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js @@ -8,7 +8,32 @@ import { Icon } from './icon.js'; import { SharedDirectoriesTable } from './group-settings.js'; export function CreateGroupPage(props) { - if (platform.node.available) return html`<${CreateGroupWizard} ...${props} />`; + // The wizard assumes a LOCAL node it can link right there (waiting_for_ + // account / waiting_for_node_key, below) -- exactly what a "Light" desktop + // build (electron-builder.light.yml, no bundled node-runtime) does not + // have. Without this check that polling loop hangs forever, the same + // "Detecting local node…" failure mode already found and fixed once for + // Full (see the Windows-port history around linkNodeKeyAndAwaitRunning). + // `bundled` starts null (unknown) and resolves once via IPC; a plain + // browser has no bridge at all and skips straight to false, the same + // outcome `platform.node.available` already gave it. Falling back to + // CreateGroupFormSimple is not a lesser feature for Light -- it is the + // exact form a browser-only member already uses to create a group with no + // node of their own; hosting it can be linked from a device that has one. + const [bundled, setBundled] = useState(null); + useEffect(() => { + if (!platform.node.available) { setBundled(false); return undefined; } + let cancelled = false; + platform.node.bundled().then((b) => { if (!cancelled) setBundled(b); }); + return () => { cancelled = true; }; + }, []); + + if (platform.node.available && bundled === null) { + return html`
+ ${' '}${t('node.service_checking')} +
`; + } + if (platform.node.available && bundled) return html`<${CreateGroupWizard} ...${props} />`; return html`<${CreateGroupFormSimple} ...${props} />`; } -- cgit v1.2.3