Skip to content

perf(ui): idle-zero Dock speedster, zoomie mascots and usage probe - #70

Merged
ShriD5 merged 3 commits into
mainfrom
perf/idle-zero-ui
Oct 30, 2026
Merged

ShriD5 merged 3 commits into
mainfrom
perf/idle-zero-ui

Conversation

@ShriD5

@ShriD5 ShriD5 commented Oct 30, 2026

Copy link
Copy Markdown
Owner

UI half of the idle-zero work. The Dock buddy keeps its charm (it runs while agents work and sleeps when idle) and loses the waste.

Changes (one commit each)

  • Dock speedster settles when idle.
    • A quiet speedster animates for 45 s, then holds one still sleeping frame (the one with the "z") with no timer.
    • A waiting alert waves for 60 s, then holds still.
    • Working moods stay animated while agents run, capped at 4 fps on battery, in Low Power Mode, or with every window hidden or covered. When hidden, the Dock is the only sign of work, so working moods keep running there. The idle pose holds still while hidden.
    • app_visibility follows NSApplication.occlusionState through its change notification, so there is no polling.
    • pause_animations_in_background stays off by default. GPUI already stops drawing hidden and covered windows, and in a visible but unfocused window the spinners are the only sign that agents are working.
  • Zoomie mascots animate in their own row views. The feed's 8 Hz ticker notified the shell on every frame, so the whole window (sidebar and transcript) re-rendered eight times a second while any zoomie ran, even with the section collapsed. A running row's mascot is now a small cached view on the shared pulse clock, like the loaders' MiniSpinner. It repaints only itself and parks when it is not painted. The feed notifies only when the snapshot changes.
  • Usage probe skips while no window is visible. It catches up when a window comes back.

Before / after

The GUI is not launched for measurement. These numbers come from the code paths and are pinned by unit tests.

Before After
Dock frame swaps, idle for an hour 1,800 (0.5 fps forever) at most 23 in the first 45 s, then 0, no timer scheduled
Dock frame rate, working on battery / LPM / hidden 8-12 fps (LPM: still) at most 4 fps
Dock, pending question for an hour 10,800 swaps (3 fps) 180 in the first 60 s, then 0
Whole-window re-renders while a zoomie runs 8 per second 0 (only the mascot's own 18 pt view repaints, about 7.5 Hz, and only while painted)
Usage probes per hour, all windows hidden 12 0

Tests

cargo test -p zeron-ui --lib -- speedster:: zoomies app_visibility::: 66 passed. New tests:

  • speedster::a_quiet_speedster_jogs_in_place_briefly_then_holds_still_with_no_timer
  • speedster::hidden_window_plus_running_agents_animates_at_most_four_fps
  • speedster::hidden_windows_hold_the_quiet_pose_still_until_the_nap
  • speedster::battery_and_low_power_cap_working_moods_at_four_fps
  • speedster::a_waiting_alert_waves_then_settles
  • speedster::reduced_motion_follows_mood_changes_only
  • shell::zoomies_section::a_running_zoomie_never_re_renders_the_shell_per_frame (2 s of virtual time with a running zoomie: zero feed notifications)
  • zoomies::mascot::the_jog_cycle_steps_through_every_frame_once
  • app_visibility::visible_until_told_otherwise_and_observers_hear_changes

A full cargo build -p godspeed covers the macOS-only Dock driver and the occlusion observer, which test builds exclude.

Needs a human check

Not exercised on a real Dock: the occlusion notification and the battery reading (IOPSGetTimeRemainingEstimate). Worth a glance:

  • Hide all windows while an agent runs: the speedster keeps jogging, a little slower.
  • Leave the app idle: it falls asleep after about 45 s and stays on one frame.

The Dock icon animated forever: idle and sleeping moods swapped frames
every 2 s for the life of the app, and working moods at 8-12 fps
regardless of power state.

- A quiet speedster animates for 45 s, then holds one still sleeping
  frame (the one with the "z") with no timer.
- A waiting alert waves for 60 s, then holds its first frame.
- Working moods stay animated while agents run, capped at 4 fps on
  battery, in Low Power Mode, or with every window hidden or covered
  (then the Dock is the only sign of work); the idle pose holds still
  while hidden.
- app_visibility follows NSApplication's occlusion state so the icon
  reacts when windows are hidden or shown, without polling.

The mood logic (Speedster::plan) is pure and unit tested: idle settles
with no plan, hidden windows with running agents animate at <= 4 fps,
battery caps, reduced motion follows mood changes only.
The zoomies feed ran an 8 Hz ticker while any zoomie ran and notified
on every frame; the shell observes the feed, so the whole window
(sidebar and transcript) re-rendered eight times a second, even with the
section collapsed or the window hidden.

A running row's mascot is now a small cached view on the shared pulse
clock (like the loaders' MiniSpinner), repainting only itself at about
7.5 Hz and parking as soon as it is not painted. The feed notifies only
when the snapshot actually changes.
The composer's usage gauge asked the provider for account limits every
5 minutes even with every window hidden. The probe now skips while no
window is visible and catches up as soon as one is.
@ShriD5
ShriD5 merged commit 0e7f3d6 into main Oct 30, 2026
23 of 24 checks passed
@ShriD5
ShriD5 deleted the perf/idle-zero-ui branch October 30, 2026 13:28
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.

1 participant