Add local vs. cloud sync status badge to the header#34
Merged
Conversation
Surfaces the existing GoogleDriveService.checkSyncStatus() comparator as a glanceable badge in the main window header: in sync, local newer, Drive newer, conflict, or unknown. Hidden when Drive integration is disabled or signed out. Updates from the existing startup sync check, when the Profile window closes (where Drive actions happen), and on click to re-check. Closes #33 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a Google Drive sync status badge to the main window header so users can quickly see whether the local database and the Drive copy are in sync, and trigger an on-demand re-check.
Changes:
- Adds a header badge that renders the current
GoogleDriveService.SyncStatus(in sync / local newer / Drive newer / conflict / unknown). - Updates startup sync resolution flow to apply the badge state and refresh it in the pending-download alert case.
- Refreshes the badge when the Profile window closes (where Drive actions occur) and on badge click.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+240
to
+248
| private void refreshSyncStatusBadge() { | ||
| syncStatusBadge.setText("Checking sync…"); | ||
| syncStatusBadge.setGraphic(null); | ||
| setSyncBadgeVisible(true); | ||
| CompletableFuture.supplyAsync(googleDriveService::checkSyncStatus) | ||
| .whenComplete((status, error) -> Platform.runLater(() -> | ||
| applySyncStatusBadge(error != null | ||
| ? GoogleDriveService.SyncStatus.UNKNOWN : status))); | ||
| } |
…ard access - Guard badge updates with a generation counter and re-check isIntegrationEnabled/isSignedIn before applying, so an async sync check started before sign-out can no longer resurface the badge with stale state - Fold the font styling into the badge's inline style instead of calling fontBold before setStyle (which wiped it) - Make the badge a Button so the re-check action is keyboard accessible Co-Authored-By: Claude Fable 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.
Summary
GoogleDriveService.checkSyncStatus()comparator as a glanceable badge in the main window header, showing which database is most up-to-date: ✓ In sync, ↑ Local is newer, ↓ Drive is newer, ⚠ Sync conflict, or ? Sync unknownCloses #33
Test plan
🤖 Generated with Claude Code