Skip to content

Add local vs. cloud sync status badge to the header#34

Merged
geokoko merged 2 commits into
masterfrom
feature/sync-status-badge
Jul 9, 2026
Merged

Add local vs. cloud sync status badge to the header#34
geokoko merged 2 commits into
masterfrom
feature/sync-status-badge

Conversation

@geokoko

@geokoko geokoko commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Surface the existing 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 unknown
  • Badge is hidden when Drive integration is disabled or the user is signed out
  • Refreshes from the existing startup sync check (no extra network call), when the Profile window closes (where Drive upload/download/sign-in actions live), and on click for an on-demand re-check

Closes #33

Test plan

  • ./gradlew compileJava
  • ./gradlew test

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings July 9, 2026 16:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@geokoko geokoko merged commit 906cf3d into master Jul 9, 2026
1 check passed
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.

Add a local vs. cloud remote status comparator

2 participants