diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-05 15:26:25 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-05 15:26:25 +0200 |
| commit | bd299df3468822e7b545a90bf55ffbc1bac87f58 (patch) | |
| tree | c2175e3675355148ae3eb1969983d0fa7a337dac /packages/meshbay-hub | |
| parent | c11dd22b593358ef7932deec53c8200f5f14ed8b (diff) | |
| download | meshbay-bd299df3468822e7b545a90bf55ffbc1bac87f58.tar.gz | |
feat(client): system tray on Windows, and a clearer tray icon
The tray's Start/Stop already drove nodeService.status/stop/restart, which
had full win32 branches for both startup modes from the Node page work --
so enabling it on Windows is widening two platform gates (the `tray`
capability in preload.js, the window:minimize-to-tray handler in main.js),
not new logic.
Replaced the tray icon: the previous white chevron-in-a-box read as an
envelope at tray size. New icon is a small "M" drawn as mesh nodes and
edges, echoing the app icon's own motif, in the brand blue instead of
plain white so it stays legible on both light and dark taskbars/panels.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub')
| -rw-r--r-- | packages/meshbay-hub/tests/test_desktop_shell.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/packages/meshbay-hub/tests/test_desktop_shell.py b/packages/meshbay-hub/tests/test_desktop_shell.py index f1dd399..45e3ed4 100644 --- a/packages/meshbay-hub/tests/test_desktop_shell.py +++ b/packages/meshbay-hub/tests/test_desktop_shell.py @@ -376,3 +376,35 @@ def test_package_json_does_not_define_a_second_linux_package(): assert "electron-builder" not in dist, ( "the dist script builds packages with electron-builder again; it " "should delegate to packaging/build/build-client.sh") + + +# ── System tray is cross-platform ──────────────────────────────────────────── + +def test_tray_capability_and_ipc_handler_agree_on_which_platforms(): + """ + The tray (GNOME, then Windows) has exactly two platform gates: the + `tray` capability preload.js exposes, which is all app.js's nav button + is keyed on, and the `window:minimize-to-tray` IPC handler in main.js + that actually creates it. Both must name the same platform set, or one + of two broken states results: a button that renders but does nothing + (handler stricter than the capability), or a hidden window with no way + back (capability stricter than the handler, on a desktop with no tray + to have hidden it into). Everything else the tray uses (`ensureTray`, + `tray.on('click')`, the poll-refresh, `nodeService.status/stop/restart`) + is unconditional Electron/abstraction code with no platform check of its + own -- these two lines are the whole gate. + """ + preload = _preload() + cap_line = next( + (line for line in preload.splitlines() if "tray:" in line + and "process.platform" in line), None) + assert cap_line, "no platform-gated `tray:` capability found in preload.js" + + lines = _main().splitlines() + handler_start = next( + i for i, line in enumerate(lines) if "'window:minimize-to-tray'" in line) + handler_block = "\n".join(lines[handler_start:handler_start + 5]) + + for plat in ("'linux'", "'win32'"): + assert plat in cap_line, f"tray capability must name {plat}" + assert plat in handler_block, f"minimize-to-tray handler must name {plat}" |