Repository navigation
Description
What happened
Rust preview exits the Desktop application when its main window closes. Windows consequently has no tray entry for reopening or explicitly quitting the application. Source inspection shows the corresponding lifecycle gap in the macOS AppKit and Linux GPUI backends; those platforms require native validation.
The requested model follows the TypeScript desktop on main: retain the Desktop main process, not a new Host residency mechanism. The Host remains an independent execution owner.
How to reproduce
- Start Rust preview Desktop on Windows.
- Close its main window.
- Observe that the Desktop process exits, with no tray entry to open Maka or explicitly quit.
- Compare with
main: Windows retains the Electron main process, tray and Runtime Host manager. Tray Open focuses or recreates the window; explicit application Quit performs cleanup.
Expected behavior and implementation plan
- Keep the Desktop main process and its existing admitted Host connection alive after window close. This is the real application client, not a dummy keepalive connection.
- Release the closed window's UI engine, renderer, subscriptions and window-scoped resources. Do not merely hide a fully live Workbench. Recreate UI from the retained connection and persisted state on Open.
- Provide Open Maka and Quit in Windows/Linux trays and a macOS menu-bar entry. Preserve Dock reopen and native application Quit. Opening an already visible window focuses it instead of duplicating it.
- Only explicit application Quit performs the existing bounded Desktop-client detach and exits the Desktop main process. Do not change Host idle retirement, introduce Host desktop residency, or make Host own the tray. Do not terminate shared Hosts or cancel their accepted work.
- Avoid inaccessible background applications if tray setup fails. Where no native reopen entry exists, fall back to close-and-exit; handle tray-host restarts/loss and report failures.
- Keep optional macOS GPUI behavior coherent with the default backend.
Implementation boundaries:
- Desktop shell owns the retained connection, tray/menu actions, application exit and UI creation/release.
- Native backends expose minimal window/application lifecycle facilities without changing defaults for unrelated NSH consumers.
- Restore existing persisted conversation/window state; do not promise unpersisted in-memory UI state.
- Verify real close/reopen, resource release, repeated cycles, focus without duplicate windows, hidden/visible Quit, tray-unavailable recovery and continued Host work/other clients. Keep tests behavioral.
- Update shared CI routing/consumer inputs if native backends, embedded assets or test suites change.
Environment
- Rust preview base:
72162299fab4008435dbf4b063440443b864afe0 - TypeScript reference: local
mainat5d3a0629a - Reported OS: Windows, exact version not supplied
- Targets: macOS/AppKit, Windows/Direct2D, Linux/GPUI
Logs, screenshots, or additional context
Relevant entrypoints: products/maka/desktop-shell/src/{appkit,direct2d,window,host}.rs, NSH native application hooks under third-party/nsh/crates/, and main's apps/desktop/src/main/{windows-app-tray,runtime-host-boot,app-quit-coordinator}.ts.
This user-confirmed plan supersedes suggestions to move the tray into Host or add Host desktop residency. Linux tray support is new capability; the TypeScript version does not already implement Linux trays.
Human owner: @me2seeks. Issue/plan drafted and implementation assisted by Maka (AI agent).
Activity
me2seeks commentedon Nov 6, 2026
take
me2seeks commentedon Nov 6, 2026
Implementation progress (Maka-assisted; local branch
fix/6668-desktop-tray, current code commitbc93674ab):Validation completed locally:
Still outstanding: a complete native macOS build and AppKit/optional-GPUI runtime acceptance. The revised status-menu module passed a macOS-target metadata type check, but that is not a native desktop run. Native macOS desktop compilation/testing is routed through the shared CI definitions. No claim that all three platforms have completed native acceptance yet.
fix(desktop): retain the Rust preview client after window close