Expand description
The tray UI: an egui window + system tray that is a client of the
daemon (studio-worker run). See docs/runtime/daemon-and-tray.md.
The UI never runs a job: a poller mirrors the daemon’s state into a
Replica the pages render, and the operator’s actions go back over the
local API. When no daemon runs, the poller starts one. One tray UI runs
per config directory (single_instance).
Gated behind the ui cargo feature so headless installs and the
service path don’t pull in egui / eframe / the tray backends.
Modules§
- actions
- Carries the operator’s clicks to the daemon off the UI thread, and keeps the one-line result the status bar shows.
- app
- The eframe
App: a client of the daemon. It renders theReplicathe poller keeps fresh inside the window’s chrome (rail, pulse header, status bar) and sends the operator’s actions through theActionRunner; it never runs a job itself. - chrome
- The window’s chrome: the navigation rail, the pulse header and the status bar. Each keeps its size whatever the state, so nothing moves when a job starts or ends.
- format
- How the UI writes durations, ages, days and times.
- icons
- Line icons painted from geometry, so they stay crisp at any scale, take the theme’s colours and need no icon font.
- log_
view - A log as the UI shows it: monospace, the level coloured, wrapping, selectable and copyable. The job detail pane and the Logs page share it.
- notifier
- OS-native desktop notifications gated on per-event toggles.
- page
- The pages on the navigation rail. Pure data so the contract is testable without egui in scope.
- pages
- One module per page on the rail. Each exposes a pure-data view model
(testable without egui) and a thin
renderthat draws it. - prefs
- The tray UI’s own preferences: theme, reduce motion, notifications.
- pulse
- The worker’s pulse: what the header always says. Pure data built from the replica, so what the header says is tested without egui.
- single_
instance - One tray UI per config directory.
- theme
- The tray UI’s look: two palettes (dark, light) held to WCAG 2.2 AA contrast by tests, the egui visuals and style built from them, and the soft “breathing” glow of running work.
- tray
- Tray icon state + menu factory (pure data). The per-OS tray
construction lives in
super::tray_host(ksnion Linux,tray-iconon macOS / Windows); this module keeps the logic that decides what the tray looks like (icon variant, menu labels, ARGB byte order) free of any platform types so it stays unit-testable. - tray_
host - Cross-platform system-tray host.
- widgets
- Small building blocks every page shares: cards, pills, status dots, buttons, fact rows, copy buttons, empty states. Rendering only; the decisions they show are made by the pages’ view models.
Constants§
- DISPLAY_
ATTEMPT_ ENV - Carries the display-retry attempt across the restart in place.
- DISPLAY_
RETRY_ BASE - First wait before retrying the display, doubled per attempt.
- DISPLAY_
RETRY_ MAX - Longest wait between display attempts.
Functions§
- display_
attempt - The display attempt this process is, from
DISPLAY_ATTEMPT_ENV. - display_
retry_ delay - How long to wait before display attempt
attempt + 1. - log_
display_ wait - Log a failed display attempt and answer how long to wait.
- raise_
window - Show, un-minimise and focus the window (from any thread).
- run
- Entry point for
studio-worker ui.