Rebuild Activity screen as a live backup activity center

Section order: Connection Status → Current Session (live, when active) →
Errors → Last Successful Backup → Sync Activity → History → About

Connection Status:
- NAS row shows remotePath as third subtitle line (destination trust signal)
- Wi-Fi Offline badge now orange (was muted grey)

Current Session (new):
- Shows only when backup is active (preparing/running/paused)
- Progress bar, file count, live upload speed, ETA, current filename
- Badge colors: blue for uploading, orange for paused/scanning

Last Successful Backup (new):
- Trust signal always visible — shows date + total photos safe
- Empty state if no clean backup yet

Errors section:
- "Retry Failed" button in header (disabled while active or NAS unreachable)
- Error rows show count + uploaded count as context
- Error detail sheet: Retry Failed Uploads button disabled with reason when NAS is down

Sync Activity:
- Clear button opens confirmationDialog: Clear Completed Logs / Clear Errors / Clear Everything
- Labels: "Backups completed" / "New uploads" / "Already safe" / "Errors"
- ConnectionStore: clearCompletedHistory() and clearErrorHistory() added

History rows:
- "skipped" replaced with human-readable text:
  "X already backed up", "X new · Y already safe", "X photos backed up"

Co-Authored-By: Kutesir <kutesir@provoc.ug>
Co-Authored-By: Sentry <sentry@provoc.ug>
This commit is contained in:
Robin Kutesa
2026-05-17 12:12:26 +03:00
parent a68cf0e5ec
commit 1312ebb278
2 changed files with 378 additions and 118 deletions

View File

@@ -110,6 +110,16 @@ final class ConnectionStore: ObservableObject {
UserDefaults.standard.removeObject(forKey: "historyEntries")
}
func clearCompletedHistory() {
historyEntries.removeAll { $0.failedCount == 0 }
saveUD(historyEntries, key: "historyEntries")
}
func clearErrorHistory() {
historyEntries.removeAll { $0.failedCount > 0 }
saveUD(historyEntries, key: "historyEntries")
}
/// Locks the screen keeps the saved connection but requires Face ID again.
func lock() {
isSessionActive = false