Skip to content

refactor(app): Phase 6 — add tray adapter skeleton (Open / Quit menu only) #1409

@shm11C3

Description

@shm11C3

Parent

Part of #1402. Depends on Phase 5.

Goal

Add a minimal app::adapters::tray::TrayAdapter under src-tauri/src/app/adapters/tray.rs that gives users a way back to the window once Phase 5 stops auto-quitting on close. No live metric rendering — that lands in #1401.

Workspace Context

This phase is entirely App-side: the tray adapter lives under src-tauri/src/app/adapters/ and is allowed to use tauri::*. It calls into the core crate for the Quit action introduced in Phase 5.

Scope

  • Tray icon registered on app startup.
  • Tray menu with Open (restore main window) and Quit (calls the Quit action from Phase 5, which ultimately drives core::monitoring::MonitoringState to Stopped).
  • Left click on the tray icon also restores the window.
  • All three platforms (Windows / macOS / Linux). On Linux, document any AppIndicator caveats discovered during implementation.

Out of Scope

Definition of Done

  • Closing the main window leaves a tray icon visible.
  • Clicking Open restores the window with state intact (size, position, current view).
  • Quit exits the app cleanly through the lifecycle path from Phase 5.
  • Graceful fallback when the user's environment does not support a tray (e.g. some Linux desktops): the app still quits cleanly via Quit from another path.

Notes

Once this lands, #1275 (background mode UX) and #1401 (live tray widget) can both proceed in parallel.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions