feat: move check status below ring, remove checking spinner, re-enable auto-backup
- Move "X sec ago / refresh" row from inside statsStrip to directly below the ring hero so the last-checked time is visible near the status it describes - Remove "Checking status…" spinner from the action button — button shows "Start backup" / "Back up again" at all times - Remove "Checking…" spinner from the ring center (page 0) — ring always shows the pending backup count or "All photos safe" - Re-enable autoBackupEnabled default (true) now that already-safe counting is accurate; auto backup will fire on LAN join when items need backup Co-Authored-By: Kutesir <kutesir@provoc.ug> Co-Authored-By: Sentry <sentry@provoc.ug>
This commit is contained in:
@@ -54,7 +54,12 @@ struct BackupView: View {
|
||||
|
||||
// ─── Ring ─────────────────────────────────────
|
||||
ringHero
|
||||
.padding(.bottom, 44)
|
||||
.padding(.bottom, 12)
|
||||
|
||||
// ─── Check status ─────────────────────────────
|
||||
checkStatusRow
|
||||
.padding(.horizontal, AppTheme.hPad)
|
||||
.padding(.bottom, 20)
|
||||
|
||||
// ─── Stats ────────────────────────────────────
|
||||
statsStrip
|
||||
@@ -229,14 +234,10 @@ struct BackupView: View {
|
||||
private var ringCenterContent: some View {
|
||||
switch ringPage {
|
||||
case 0:
|
||||
// Engine activity always takes priority.
|
||||
// Coordinator states are shown only when the engine is idle.
|
||||
if engine.job.status.isActive {
|
||||
ringMainView
|
||||
} else if coordinator.phase == .disconnected, statusService.snapshot.needBackup > 0 {
|
||||
disconnectedRingView
|
||||
} else if coordinator.phase == .checking {
|
||||
checkingRingView
|
||||
} else {
|
||||
ringMainView
|
||||
}
|
||||
@@ -487,8 +488,10 @@ struct BackupView: View {
|
||||
.clipShape(RoundedRectangle(cornerRadius: 14, style: .continuous))
|
||||
|
||||
pageIndicator
|
||||
}
|
||||
}
|
||||
|
||||
// Subtle refresh status
|
||||
private var checkStatusRow: some View {
|
||||
HStack(spacing: 5) {
|
||||
if statusService.isRefreshing {
|
||||
ProgressView()
|
||||
@@ -521,7 +524,6 @@ struct BackupView: View {
|
||||
}
|
||||
.frame(height: 16)
|
||||
}
|
||||
}
|
||||
|
||||
private func compactStat(_ value: String, label: String, color: Color) -> some View {
|
||||
VStack(spacing: 2) {
|
||||
@@ -701,17 +703,6 @@ struct BackupView: View {
|
||||
|
||||
private var actionButton: some View {
|
||||
Group {
|
||||
// Coordinator is running a status check — block the start button so
|
||||
// a backup cannot be triggered before reconciliation completes.
|
||||
if coordinator.phase == .checking {
|
||||
HStack(spacing: 8) {
|
||||
ProgressView().scaleEffect(0.8).tint(AppTheme.inkSecondary)
|
||||
Text("Checking status…")
|
||||
.font(AppTheme.body())
|
||||
.foregroundStyle(AppTheme.inkSecondary)
|
||||
}
|
||||
.frame(height: 50)
|
||||
} else {
|
||||
switch resolvedStatus {
|
||||
case .idle, .completed, .failed, .cancelled:
|
||||
Button(action: startBackup) {
|
||||
@@ -748,9 +739,7 @@ struct BackupView: View {
|
||||
.frame(height: 50)
|
||||
}
|
||||
}
|
||||
}
|
||||
.animation(.spring(response: 0.3, dampingFraction: 0.82), value: engine.job.status == .running)
|
||||
.animation(.spring(response: 0.3, dampingFraction: 0.82), value: coordinator.phase == .checking)
|
||||
}
|
||||
|
||||
private func startBackup() {
|
||||
|
||||
@@ -99,7 +99,7 @@ final class ConnectionStore: ObservableObject {
|
||||
onboardingPhotoShown = UserDefaults.standard.bool(forKey: "onboardingPhotoShown")
|
||||
appearanceMode = AppearanceMode(rawValue: UserDefaults.standard.string(forKey: "appearanceMode") ?? "") ?? .system
|
||||
localRetentionDays = UserDefaults.standard.object(forKey: "localRetentionDays") as? Int ?? 0
|
||||
autoBackupEnabled = UserDefaults.standard.object(forKey: "autoBackupEnabled") as? Bool ?? false
|
||||
autoBackupEnabled = UserDefaults.standard.object(forKey: "autoBackupEnabled") as? Bool ?? true
|
||||
autoBackupOnOpen = UserDefaults.standard.object(forKey: "autoBackupOnOpen") as? Bool ?? false
|
||||
allowCellularBackup = UserDefaults.standard.object(forKey: "allowCellularBackup") as? Bool ?? false
|
||||
useTailscaleWhenRemote = UserDefaults.standard.object(forKey: "useTailscaleWhenRemote") as? Bool ?? false
|
||||
|
||||
Reference in New Issue
Block a user