From b9b91bbb35069ebef00217fbcb8c2cca09ca5375 Mon Sep 17 00:00:00 2001 From: Robin Kutesa Date: Tue, 19 May 2026 10:05:47 +0300 Subject: [PATCH] Replace static NAS status label with live sync status indicator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Swap dot + "NAS Connected/Offline" for an icon + text that reflects the actual engine/coordinator state: Running → ↻ arrow.triangle.2.circlepath (orange) Checking → 🔍 magnifyingglass (gray) Paused → ⏸ pause.fill (orange) Offline → wifi.slash (red) Stopped → ■ stop.fill (gray) Animates crossfade between states. Nothing else changed. Co-Authored-By: Kutesir Co-Authored-By: Sentry --- Features/Backup/BackupView.swift | 44 +++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/Features/Backup/BackupView.swift b/Features/Backup/BackupView.swift index 0e92f12..3f6cc9c 100644 --- a/Features/Backup/BackupView.swift +++ b/Features/Backup/BackupView.swift @@ -528,27 +528,41 @@ struct BackupView: View { } .frame(height: 16) - if statusService.snapshot.connectionState != .unknown { - HStack(spacing: 4) { - Circle() - .fill(nasConnectionStatusColor) - .frame(width: 5, height: 5) - Text(nasConnectionStatusLabel) - .font(.system(size: 9, weight: .regular)) - .foregroundStyle(nasConnectionStatusColor) - } + HStack(spacing: 4) { + Image(systemName: syncStatusIcon) + .font(.system(size: 9, weight: .medium)) + .foregroundStyle(syncStatusColor) + Text(syncStatusLabel) + .font(.system(size: 9, weight: .medium)) + .foregroundStyle(syncStatusColor) } + .animation(.easeInOut(duration: 0.2), value: syncStatusLabel) } } - private var nasConnectionStatusColor: Color { - statusService.snapshot.connectionState == .offline - ? AppTheme.destructive - : Color(red: 1.0, green: 0.58, blue: 0.0) + private var syncStatusIcon: String { + if engine.job.status == .preparing { return "magnifyingglass" } + if engine.job.status.isActive { return "arrow.triangle.2.circlepath" } + if engine.job.status == .paused { return "pause.fill" } + if statusService.isRefreshing || coordinator.phase == .checking { return "magnifyingglass" } + if statusService.snapshot.connectionState == .offline { return "wifi.slash" } + return "stop.fill" } - private var nasConnectionStatusLabel: String { - statusService.snapshot.connectionState == .offline ? "NAS Offline" : "NAS Connected" + private var syncStatusColor: Color { + if engine.job.status.isActive { return Color(red: 1.0, green: 0.58, blue: 0.0) } + if engine.job.status == .paused { return Color(red: 1.0, green: 0.58, blue: 0.0) } + if statusService.snapshot.connectionState == .offline { return AppTheme.destructive } + return AppTheme.inkQuaternary + } + + private var syncStatusLabel: String { + if engine.job.status == .preparing { return "Checking" } + if engine.job.status.isActive { return "Running" } + if engine.job.status == .paused { return "Paused" } + if statusService.isRefreshing || coordinator.phase == .checking { return "Checking" } + if statusService.snapshot.connectionState == .offline { return "Offline" } + return "Stopped" } private func compactStat(_ value: String, label: String, color: Color) -> some View {