Skip to content

feat(tray): a tray icon on Windows, Linux and macOS, a client of the hub (ADR-0060) - #249

Merged
7schmiede merged 2 commits into
mainfrom
feat/tray
Oct 23, 2026
Merged

7schmiede merged 2 commits into
mainfrom
feat/tray

Conversation

@7schmiede

Copy link
Copy Markdown
Member

Closes #1. Replaces #248, whose macOS AppKit adapter this takes over.

Why

#248 proposed a macOS-only menu bar client (devstack menubar) that read every daemon's /v1/stack and worked out each stack's state itself. The need is the same on Windows first (#1) and on Linux, and a third reading of the state would drift from the dashboard's and the notifications'. ADR-0060 (Accepted) makes the tray one client process for every platform, started by the hub, which says what it shows.

What

  • GET /hub/summary: every registered stack (running, starting or stopping, services ready of all, started lanes, what needs attention) and one state over all of them. What needs attention is what notifies (ADR-0045), read from the same streams (Scope::glance), plus a failed start from the dashboard.
  • devstack tray: the hub starts it at its own start (off with devstack hub tray off or DEVSTACK_NO_TRAY; no desktop, no tray). One per user. It works out no state and never talks to a daemon: Start, Stop (down?infra=true, as the dashboard's Stop; lanes keep running), Open Folder (/hub/open, files) and Open in Dashboard (paired, as devstack ui) go through the hub. Quitting it stops nothing. A tray older than the hub hands over to the new devstack's.
  • Icon: the dashboard's mark, green / amber / red / grey; on macOS a template image tinted orange or red.
  • devstack-desktop::tray: one menu model, three adapters:
    • Windows: Shell_NotifyIconW on a hidden top-level window (re-added on TaskbarCreated), popup menu on either click.
    • Linux: org.kde.StatusNotifierItem and com.canonical.dbusmenu over zbus (the service feature), so the binary stays static; it registers again when a watcher appears.
    • macOS: the AppKit status item from feat(macos): add an optional native menu bar #248 (accessory app, no Dock icon), credited as co-author.
  • devstack hub tray [on|off]; self uninstall ends the tray with the hub.

Checked

  • cargo clippy --workspace --all-targets, cargo fmt, unit tests for the workspace, --test hub (the summary reports a failed start).
  • devstack-desktop with clippy for x86_64-pc-windows-msvc and aarch64-apple-darwin (hub and CLI need C toolchains for those targets; their tray code is platform-independent).
  • Live on Ubuntu GNOME (AppIndicator), with an isolated hub: the item registers with the watcher; tooltip, icon and menu follow the summary (a stack with a failing service turns red, shows "broken: failed" and why); Stop, Start and Start Dashboard Hub through dbusmenu events work; hub tray off / on, a stopped hub and Quit behave as the ADR says.
  • Not checked on Windows or a Mac: docs/macos.md has a tester checklist for the tray (19–23). A Windows check of the notification area and the popup menu is still needed before release.

🤖 Generated with Claude Code

7schmiede and others added 2 commits October 23, 2026 21:20
… own, on every desktop

ADR-0018 put a tray in the daemon, ADR-0021 moved it to the hub, ADR-0045
took the notifications out of it. A contribution for macOS (#248) built a
menu bar client as a separate process and showed why: AppKit wants the
main thread, which the hub's server has. It also read every daemon's state
and judged it on its own, a third reading beside the dashboard's and the
notifications'.

The tray is `devstack tray` on every platform, started by the hub (off
with `devstack hub tray off` or `DEVSTACK_NO_TRAY`), a client of the hub:
`GET /hub/summary` says what it shows, the same as what notifies; its
actions are the dashboard's requests. One menu model, drawn per platform
(Shell_NotifyIconW, a StatusNotifierItem over zbus so the Linux binary
stays static, an NSStatusItem). ADR-0018 point 2 and ADR-0021 are amended.

Refs #1, #248

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hub (ADR-0060)

The hub starts `devstack tray` (unless `devstack hub tray off`,
`DEVSTACK_NO_TRAY`, or no desktop): the dashboard's mark, green when
something runs, amber while a stack starts or stops, red when something
needs attention, grey when nothing runs. Its menu opens the dashboard,
lists every registered stack with what needs attention (a click opens
that service), and starts, stops or opens a stack's folder, each a
request to the hub as the dashboard makes it. Quitting it stops nothing.

- `GET /hub/summary`: every stack at a glance and one state over all. What
  needs attention comes from the streams the hub follows for its
  notifications (`notify::rules::Scope::glance`), so the tray, the
  notifications and the dashboard agree; a failed start from the
  dashboard too.
- `devstack-desktop::tray`: one menu model, drawn per platform. Windows:
  `Shell_NotifyIconW` on a hidden window, re-added when Explorer restarts.
  Linux: a StatusNotifierItem with a dbusmenu over zbus, so the binary
  stays static; it registers again when a watcher appears. macOS: the
  AppKit status item from #248, tinted by state.
- One tray per user (a lock beside the hub's state); a tray of an older
  devstack than the hub's hands over to the new one. `devstack hub tray
  [on|off]`; `self uninstall` ends it with the hub.

Checked live on Ubuntu's GNOME (AppIndicator): the item registers, the
menu follows the summary, Stop, Start and Start Dashboard Hub work, off,
on and Quit end it. Windows and macOS are checked by clippy for their
targets only; docs/macos.md lists what a tester checks.

Closes #1
Replaces #248

Co-authored-by: offline-first <2144520+offline-first@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede merged commit 042a5f5 into main Oct 23, 2026
13 checks passed
@7schmiede
7schmiede deleted the feat/tray branch October 23, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tray icon for the hub (Windows first; Linux without losing the static build)

1 participant