Repository navigation
Prepare for restart from the menu bar - #26
Merged
Merged
Conversation
…then The menu bar panel gets a "Prepare for restart" button (asks once in place): it pauses the backup, detaches the image and waits until everything has reached Drive - the same steps as `prepare-shutdown`, now shared in `ShutdownPrep` and used by both. The preparation also leaves a marker. The gdrive-attach agent runs every 900 s and attached the detached image again, so a preparation followed by a restart a few minutes later could leave fresh Time Machine writes local only - the backlog the preparation exists to prevent. `attach-image` now skips (not an error) while the marker is active: same boot session and at most 30 min old, so a preparation without a restart never leaves Time Machine without a destination for long. An explicit attach from the window and a mount restart clear it. While prepared, the headline says the image is detached on purpose and the badge is amber instead of "Action needed". The panel also shows what the app is doing and how the last action ended - before, a click there showed nothing. 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.
Adds Prepare for restart to the small menu bar panel, with a confirmation in place. It pauses the backup, detaches the image and waits until everything has reached Google Drive. These are the same steps as
cloudmachine-agent prepare-shutdown, now shared inShutdownPrep.Bug fixed along the way
The
gdrive-attachagent runs every 900 s and attached the detached image again, which undid the preparation. If the Mac was then restarted, fresh Time Machine writes could stay local only. The CLI had the same gap.The preparation now leaves a marker: boot time plus the time of the preparation.
attach-imageskips while the marker is active. The skip exits with code 0, not as an error. The marker is active only in the same boot session and for at most 30 min, so a preparation without a restart never leaves Time Machine without a destination for long. An explicit attach from the window and a mount restart clear it.UI
Tests
ShutdownPrepTests(7): checks that the marker holds the agent back in the same boot session, and stops holding after a restart, after 30 min, with a clock set back, or with no marker or boot time.isActivebroken to always return false, 2 of these 7 tests fail.AppStatusHealthTestschecks the new headline.swift test418/418;swift-format lint --strictis clean.ImageRenderer) in four states: idle, confirming, busy, prepared. I did not click it in the live app, because that would detach the real backup.🤖 Generated with Claude Code