Fix stats labels/colors and ring center content to match HTML prototype

- Stats: NAS / IPHONE / PENDING (amber) / SAFE — shorter labels, correct colors
- Running state: ring center counts down remaining files with "BACKING UP" label
- Safe state: ring center shows total photo count in green + checkmark
- Remove unused percentText computed property

Co-Authored-By: Kutesir <kutesir@provoc.ug>
Co-Authored-By: Sentry <sentry@provoc.ug>
This commit is contained in:
Robin Kutesa
2026-05-20 19:39:51 +03:00
parent da6f1926d2
commit c96f28cd06

View File

@@ -186,8 +186,13 @@ struct BackupView: View {
private var ringMainView: some View {
switch widgetState {
case .safe:
VStack(spacing: 8) {
VStack(spacing: 6) {
ringCheckmark
Text("\(statusService.snapshot.phoneTotal)")
.font(.system(size: 46, weight: .ultraLight))
.foregroundStyle(AppTheme.positive)
.contentTransition(.numericText())
.kerning(-2)
Text("PHOTOS SAFE")
.font(.system(size: 8, weight: .regular, design: .monospaced))
.foregroundStyle(AppTheme.positive.opacity(0.75))
@@ -206,23 +211,16 @@ struct BackupView: View {
}
case .running:
VStack(spacing: 5) {
Text(percentText)
VStack(spacing: 6) {
Text("\(notBackedUpDisplayCount)")
.font(.system(size: 46, weight: .ultraLight))
.foregroundStyle(AppTheme.ink)
.contentTransition(.numericText())
.kerning(-2)
Text("\(engine.job.uploadedFiles + engine.job.skippedFiles) OF \(engine.job.totalFiles)")
.font(.system(size: 8, weight: .regular, design: .monospaced))
.foregroundStyle(AppTheme.inkSecondary)
.tracking(1.5).opacity(0.75)
if let eta = engine.job.eta {
Text("~\(etaString(eta)) remaining")
Text("BACKING UP")
.font(.system(size: 8, weight: .regular, design: .monospaced))
.foregroundStyle(AppTheme.inkTertiary)
.tracking(1.5).opacity(0.6)
.padding(.top, 1)
}
.tracking(2).opacity(0.75)
}
default: // offline, pending, paused
@@ -265,8 +263,6 @@ struct BackupView: View {
}
}
private var percentText: String { "\(Int(engine.job.progress * 100))%" }
// MARK: Compact stats strip
// Invariant: alreadySafe + needBackup == phoneTotal always.
@@ -310,25 +306,25 @@ struct BackupView: View {
HStack(spacing: 0) {
compactStat(
"\(nasArchiveDisplayCount)",
label: "NAS Archive",
label: "NAS",
color: AppTheme.interactive
)
thinDivider
compactStat(
"\(statusService.snapshot.phoneTotal)",
label: "On iPhone",
label: "IPHONE",
color: AppTheme.inkSecondary
)
thinDivider
compactStat(
"\(notBackedUpDisplayCount)",
label: "Need Backup",
color: AppTheme.inkSecondary
label: "PENDING",
color: Color(red: 1.0, green: 0.62, blue: 0.0)
)
thinDivider
compactStat(
"\(alreadySafeDisplayCount)",
label: "Already Safe",
label: "SAFE",
color: AppTheme.positive
)
}