Repository navigation
perf(ui): idle-zero Dock speedster, zoomie mascots and usage probe - #70
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
app_visibilityfollowsNSApplication.occlusionStatethrough its change notification, so there is no polling.pause_animations_in_backgroundstays 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.MiniSpinner. It repaints only itself and parks when it is not painted. The feed notifies only when the snapshot changes.Before / after
The GUI is not launched for measurement. These numbers come from the code paths and are pinned by unit tests.
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_timerspeedster::hidden_window_plus_running_agents_animates_at_most_four_fpsspeedster::hidden_windows_hold_the_quiet_pose_still_until_the_napspeedster::battery_and_low_power_cap_working_moods_at_four_fpsspeedster::a_waiting_alert_waves_then_settlesspeedster::reduced_motion_follows_mood_changes_onlyshell::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_onceapp_visibility::visible_until_told_otherwise_and_observers_hear_changesA full
cargo build -p godspeedcovers 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: