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).
This commit is contained in:
Stuart 2026-08-31 15:04:51 +10:00
commit ecd561be21

View file

@ -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);
}
}