Repository navigation
Description
Overview
Under ADR-031 (daemon-client architecture), system tray ownership moves from the Tauri desktop application to nodespaced. The daemon manages the tray icon, tray menu, and UI lifecycle — spawning, focusing, and quitting the Tauri window as directed by tray menu actions.
This delivers the same user experience as the original issue (OneDrive-style background service) but with the correct implementation location: the daemon process that owns the RocksDB lock and all services.
Problem Statement
The original issue placed tray ownership in the Tauri app. Under ADR-031:
nodespacedis the long-running background process that must stay alive- The Tauri app is a thin UI shell — a gRPC client that can be spawned and killed by the daemon
- Tray ownership in the Tauri app means the daemon cannot manage UI lifecycle; the tray dies when the UI dies
Proposed Solution
nodespaced runs the system tray using the tray-icon crate (cross-platform, no Tauri dependency). The tray manages the UI window lifecycle: spawn Tauri on "Open NodeSpace", focus if already running, and clean up on "Quit".
Acceptance Criteria
-
nodespacedstarts a system tray icon on startup - Tray menu: "Open NodeSpace", "Status" (shows connected clients count), "Quit"
- "Open NodeSpace" spawns the Tauri UI if not running, or focuses it if running
- "Quit" gracefully shuts down
nodespacedand all connected clients - Closing the Tauri window hides it (does not quit the daemon or the tray)
- Tray icon updates to reflect daemon health (running / error state)
- Works on macOS (primary), with Linux and Windows as secondary targets
- Tests pass (
bun run test:all) - Code passes
bun run quality:fix
Technical Specifications
Files to create/modify
packages/daemon/src/tray.rs(NEW) — tray setup, menu definition, event handlerpackages/daemon/src/main.rs— initialize tray on daemon startup, pass UI binary pathpackages/desktop-app/src-tauri/src/main.rs— remove existing tray code; handle close → hide behavior via Tauri window event
Crate
tray-icon crate (cross-platform system tray, does not require Tauri):
# packages/daemon/Cargo.toml
tray-icon = "0.14"Tray menu structure
Open NodeSpace
─────────────
Status: X clients connected
─────────────
Quit
UI lifecycle management
The daemon holds the path to the Tauri binary. On "Open NodeSpace":
- Check if a Tauri window is already connected (via active gRPC client list)
- If connected: send a focus event via gRPC stream
- If not connected:
std::process::Command::new(tauri_binary_path).spawn()
Existing Tauri tray code to remove
packages/desktop-app/src-tauri/src/tray.rs— delete- References in
packages/desktop-app/src-tauri/src/main.rs— remove tray setup
Dependencies
- Daemon binary must exist (
nodespacedbinary setup issue)
Related Issues
- Move system tray ownership to nodespaced daemon #241 original implementation intent preserved; implementation location corrected
Activity
Add architecture documentation for PersistenceCoordinator and debug s…
Add architecture documentation for PersistenceCoordinator and debug s…
Add architecture documentation for PersistenceCoordinator and debug s…
Add architecture documentation for PersistenceCoordinator and debug s…
[-]Add Background Service Mode with System Tray (OneDrive-style)[/-][+]Move system tray ownership to nodespaced daemon[/+]malibio commentedon May 17, 2026
Architecture update: tray moves to nodespaced (ADR-031)
Under ADR-031 (daemon-client architecture), the system tray can no longer live in the Tauri app. The Tauri app is now a thin UI shell (gRPC client) that can be spawned/killed.
nodespacedis the persistent background process and the correct owner of the tray icon.packages/daemon/src/tray.rsinstead ofsrc-tauri/src/tray.rstray-icon(no Tauri dep) instead of Tauri's built-in tray APIThe existing Tauri tray code (
src-tauri/src/tray.rs) will be deleted as part of this work.malibio commentedon May 17, 2026
Baseline test results before starting work on issue #241:
Frontend: 3918 passed (128 test files), 0 failures
Duration: 47.70s
Starting implementation: moving system tray ownership from Tauri desktop app to nodespaced daemon per ADR-031.
Move system tray ownership to nodespaced daemon (closes #241) (#1143)
Add invites & join-requests admin sections to the Collaboration view (#…