Skip to main content

Module ui

Module ui 

Source
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 the Replica the poller keeps fresh inside the window’s chrome (rail, pulse header, status bar) and sends the operator’s actions through the ActionRunner; 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 render that 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 (ksni on Linux, tray-icon on 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.