From 89ed51e9b7ea38bd4475ce3a234f8c783b3d9b09 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Fri, 4 Sep 2026 18:10:39 +0200 Subject: feat(client): minimise to a system tray indicator (GNOME) A dedicated monochrome button in the nav, immediately left of the notification bell, hides the window to a tray indicator. Linux only for now; Windows is being done on that OS, and the capability is declared per platform so the button never appears where the desktop shows no indicator -- there it would hide the window for good. Hides, never closes: `window-all-closed` quits the app, so closing here would make "minimise" mean "exit" and drop the session, the transfers and the node connection. `second-instance` now calls the same restore path, since focusing a hidden window does nothing visible. The context menu is not decoration. Under libappindicator -- how GNOME shows a tray at all, via the AppIndicator extension -- `tray.on('click')` never fires; the indicator only opens its menu. A tray whose sole affordance was a click would be inert on the one desktop this targets. The click handler is kept for desktops that do send it. Menu labels come from the renderer with the IPC call: the locale files are the interface's, the main process has no i18n, and a second string table is how two of them start disagreeing. English fallbacks if none arrive. The icon lives in src/, not build/: package.json `files` packages only `src/**` and `ui/**`, so an icon under build/ is present in a dev run and missing from every installed one. Monochrome, stroked, matching the nav glyph. Verified on this host: Ubuntu GNOME with ubuntu-appindicators@ubuntu.com and libayatana-appindicator3 present, so the indicator has somewhere to appear. Not yet run end to end. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01DtfG7z6wHWj8RKHCvxQtY1 --- .../meshbay-hub/src/meshbay_hub/static/style.css | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'packages/meshbay-hub/src/meshbay_hub/static/style.css') diff --git a/packages/meshbay-hub/src/meshbay_hub/static/style.css b/packages/meshbay-hub/src/meshbay_hub/static/style.css index 3d9206d..2770dd7 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/style.css +++ b/packages/meshbay-hub/src/meshbay_hub/static/style.css @@ -2075,6 +2075,31 @@ a.transfer-name { } } +/* ── Minimise to tray ────────────────────────────────────────────────────── */ + +/* Monochrome on purpose: it sits next to the bell, and the bell's badge is the + only thing in this corner allowed to pull the eye. Inherits --nav-text like + every other nav control, so it follows the theme rather than carrying its own + colour, and the glyph is a stroked `currentColor` icon with nothing to tint. */ +.nav-tray { + display: inline-flex; + align-items: center; + justify-content: center; + background: none; + border: 0; + padding: 4px; + margin-right: 2px; + color: var(--nav-text); + cursor: pointer; + border-radius: 6px; + opacity: 0.75; +} +.nav-tray:hover, +.nav-tray:focus-visible { + opacity: 1; + background: rgba(255, 255, 255, 0.1); +} + /* ── Notification bell ───────────────────────────────────────────────────── */ .nav-notif { -- cgit v1.2.3