summaryrefslogtreecommitdiffstats
path: root/docs/WINDOWS-PORT.md
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-08 03:14:34 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-08 03:14:34 +0200
commit8b0f4ba3bc5fc146bad4730b1ccdcd5be55f192d (patch)
tree49d7d169115a9b7c87d46d251abaf8590133191e /docs/WINDOWS-PORT.md
parent6a5997655d9f2fa583bf707a5611bbb0c0f109fc (diff)
downloadmeshbay-8b0f4ba3bc5fc146bad4730b1ccdcd5be55f192d.tar.gz
feat(client): create the system tray at launch, not on first minimise
ensureTray() was reachable only from the window:minimize-to-tray handler, so the indicator did not exist until you had already hidden the window into it. That is backwards on both desktops — most of what a tray is for is finding an application that is not in front of you — and on Windows it read as the app having no tray presence at all. Created during app.whenReady(), after registerBridge() and before createWindow(). The order matters: buildTrayMenu reads the nodeService that registerBridge assigns, so the other way round puts the Start/Stop entry on the menu one five-second poll late. The menu's labels were the one thing that came *from* the minimise call, since the main process has no i18n. A new tray:labels IPC (platform.setTrayLabels) carries them instead, sent from the renderer's boot once initLocale() has a catalogue; a language change reloads the page, so the same call covers it. The window between launch and that first message shows TRAY_FALLBACK, in English. §5.10's two platform gates become one — trayOS() in main.js, which every tray path calls. test_desktop_shell.py's existing test is rewritten against it and two are added: the launch ordering, and that no tray path tests process.platform inline instead of calling the gate. Windows still files a new tray icon under hidden icons until the person drags it onto the taskbar. No API promotes it; documented in WINDOWS-PORT.md §5.11 rather than worked around. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V8EDjk6pkYZrCbo63m2x87
Diffstat (limited to 'docs/WINDOWS-PORT.md')
-rw-r--r--docs/WINDOWS-PORT.md33
1 files changed, 33 insertions, 0 deletions
diff --git a/docs/WINDOWS-PORT.md b/docs/WINDOWS-PORT.md
index e33b6f5..e1acc66 100644
--- a/docs/WINDOWS-PORT.md
+++ b/docs/WINDOWS-PORT.md
@@ -580,6 +580,39 @@ Linux-or-win32: the `tray` capability in `preload.js`, and the
`files`, no separate Windows list). `test_desktop_shell.py` now pins that
both gates name the same platform set — nothing did before.
+### 5.11 The tray is created at launch (2026-09-08)
+
+**Scope:** `src/main.js`, `src/preload.js`, `static/platform.js`,
+`static/app.js`, `test_desktop_shell.py`
+
+`ensureTray()` was reachable only from the `window:minimize-to-tray` handler,
+so the indicator did not exist until you had already hidden the window into
+it. That is backwards on both desktops — most of what a tray is for is finding
+an application that is *not* in front of you — and on Windows it read as the
+app having no tray presence at all.
+
+It is now created during `app.whenReady()`, after `registerBridge()` and
+before `createWindow()`. The order matters: `buildTrayMenu` reads the
+`nodeService` that `registerBridge` assigns, so creating the tray first would
+put the Start/Stop entry on the menu one five-second poll late.
+
+The menu's labels were the one thing that came *from* the minimise call, since
+the main process has no i18n. A new `tray:labels` IPC (`platform.setTrayLabels`)
+carries them instead, sent from the renderer's boot once `initLocale()` has a
+catalogue; a language change reloads the page, so the same call covers it. The
+window between launch and that first message shows `TRAY_FALLBACK`, in English.
+
+The two platform gates of §5.10 are now one — `trayOS()` in `main.js`, which
+every tray path calls — and `test_desktop_shell.py` pins the launch ordering,
+that no tray path tests `process.platform` inline instead of calling the gate,
+and (as before) that the gate and the `preload.js` capability name the same
+platform set.
+
+**Not fixed here, because it cannot be:** Windows puts a new tray icon in the
+hidden-icons overflow until the person drags it onto the taskbar. No API
+promotes it, and an installer that edits the registry to force it is the kind
+of thing this project does not do.
+
---
## 6. Execution order