Stop rendering hidden windows; log Docker outages once - #5
Merged
Merged
Conversation
Closing the dashboard only hides it, and the menu-bar flyout is dismissed with orderOut, so SwiftUI kept re-evaluating, animating, and committing frames for both off-screen on every poll — measured at 21-28% CPU with neither window visible, dominated by the gauge's shadowed conic gradient. WindowVisibilityReader tracks the hosting window's occlusion state; the dashboard and the flyout's gauge render a placeholder while hidden. riskScore now snaps to 0 below 0.5 (where the gauge already shows 0): pure exponential decay never reached 0, so the gauge re-animated every tick indefinitely. Hidden-window CPU drops to ~1%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hasLoggedExit was reset on every successful spawn of `docker events`, but the CLI spawns fine with no daemon and exits immediately, so the "exited" line was written every 60s for as long as Docker was down (~12.6k lines). Reset it only once the daemon actually produces output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
Argus climbed from ~2–3% CPU at launch to 44–50%. Profiling showed the per-poll detection cost was flat (confirmed across week-long runs in the heartbeat log); the time was all main-thread SwiftUI/Core Animation rendering of windows that weren't on screen:
orderOut, so both kept re-evaluating, animating, and committing frames on every poll — the gauge's shadowed conic gradient was the largest single cost.riskScoredecays exponentially and never reached exactly 0, so the gauge's score-keyed animation re-ran every tick indefinitely.Changes
WindowVisibility.swift(new):WindowVisibilityReadertracks the hosting window'socclusionState;renderedOnlyWhenVisibleswaps in a placeholder while hidden. Applied to the dashboard body and the flyout's gauge.ProcessMonitor:riskScoresnaps to 0 once below 0.5 (where the gauge already displays 0), and is only reassigned when it changes.DockerWatcher:hasLoggedExitwas reset on every successful spawn ofdocker events, but the CLI spawns fine with no daemon and exits immediately — so "docker events exited" was logged every 60s while Docker was down (~12.6k lines). It now resets only once the daemon actually produces output.Verification
swift test: 213 tests, 0 failures.🤖 Generated with Claude Code