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