From ecd561be21ceddf9b528935ba71c6026a609b960 Mon Sep 17 00:00:00 2001 From: Stuart Date: Mon, 31 Aug 2026 15:04:51 +1000 Subject: [PATCH] Mesh:Tool: actually call set_darkmode() on the CMMS boot path The real reason Mesh:Tool ignored the theme: set_darkmode() runs inside restore_space(), which only fires on the non-CMMS boot path (motoClient 'ready' -> restore_space). The CMMS path (motoClient 'ready' -> cmms_load_from_url) never called it, so #app never got the .dark class and the #app:not(.dark) light CSS always won -> white, regardless of theme. Now cmms_load_from_url()'s finally block calls set_darkmode(config.dark ?? true). --- src/main/mesh.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/mesh.js b/src/main/mesh.js index 4be11664..ad13568e 100644 --- a/src/main/mesh.js +++ b/src/main/mesh.js @@ -812,6 +812,11 @@ async function cmms_load_from_url(config) { boot_done(); handles.setEnabled(api.prefs.map.space.bounds ?? false); broker.publish("app_ready"); + // The normal boot path applies dark/light mode inside restore_space(), + // which this CMMS-scoped launch deliberately skips - so do it here. + // config.dark comes from the CMMS host's theme_is_dark() (cmms_dark + // query param); default dark for a non-CMMS/direct launch. + set_darkmode(config.dark ?? true); } }