feat(backup): toggleable backed-up photos in clean sheet; anchor page 1 stats to bottom
Backed-up photos row in clean sheet now toggles on/off like other rows. Page 1 storage stats (USED/FREE/JUNK) pushed to bottom of screen via Spacer, matching the alignment of the stats strip on the main backup page. Co-Authored-By: Kutesir <kutesir@provoc.ug> Co-Authored-By: Sentry <sentry@provoc.ug>
This commit is contained in:
@@ -24,6 +24,7 @@ struct BackupView: View {
|
||||
@State private var showCleanSheet = false
|
||||
@State private var cleanScreenshotDays: Int? = nil
|
||||
@State private var cleanDeletedPhotos: Bool = false
|
||||
@State private var cleanBackedUpPhotos: Bool = true
|
||||
@State private var deletedPhotosGB: Double = 0
|
||||
@State private var screenshotsGB: Double = 0
|
||||
@State private var pullProgress: CGFloat = 0
|
||||
@@ -71,11 +72,25 @@ struct BackupView: View {
|
||||
.padding(.bottom, 8)
|
||||
|
||||
// ─── Scrollable stats / detail ─────────────────────────
|
||||
if ringPage == 0 {
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
belowContent
|
||||
.padding(.bottom, 24)
|
||||
statsStrip
|
||||
.padding(.horizontal, AppTheme.hPad)
|
||||
.padding(.top, 4)
|
||||
Spacer(minLength: 16).frame(maxHeight: 32)
|
||||
nasStatusRow
|
||||
.padding(.horizontal, AppTheme.hPad)
|
||||
Spacer(minLength: 8).frame(maxHeight: 20)
|
||||
}
|
||||
.refreshable { await triggerRefreshAndBackup() }
|
||||
} else if ringPage == 1 {
|
||||
Spacer()
|
||||
page1BelowContent
|
||||
} else {
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
page2BelowContent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ─── Menu button — floats above scroll content ─────────────
|
||||
@@ -564,24 +579,6 @@ struct BackupView: View {
|
||||
circleSection
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var belowContent: some View {
|
||||
switch ringPage {
|
||||
case 1:
|
||||
page1BelowContent
|
||||
case 2:
|
||||
page2BelowContent
|
||||
default:
|
||||
statsStrip
|
||||
.padding(.horizontal, AppTheme.hPad)
|
||||
.padding(.top, 4)
|
||||
Spacer(minLength: 16).frame(maxHeight: 32)
|
||||
nasStatusRow
|
||||
.padding(.horizontal, AppTheme.hPad)
|
||||
Spacer(minLength: 8).frame(maxHeight: 20)
|
||||
}
|
||||
}
|
||||
|
||||
private func etaString(_ seconds: TimeInterval) -> String {
|
||||
Int(seconds) / 60 > 0 ? "\(Int(seconds) / 60)m" : "\(Int(seconds))s"
|
||||
}
|
||||
@@ -925,7 +922,7 @@ struct BackupView: View {
|
||||
color: AppTheme.positive)
|
||||
}
|
||||
.padding(.horizontal, AppTheme.hPad)
|
||||
.padding(.bottom, 18)
|
||||
.padding(.bottom, 14)
|
||||
|
||||
// Legend
|
||||
HStack(spacing: 20) {
|
||||
@@ -935,7 +932,7 @@ struct BackupView: View {
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.horizontal, AppTheme.hPad)
|
||||
.padding(.bottom, 36)
|
||||
.padding(.bottom, 24)
|
||||
|
||||
}
|
||||
|
||||
@@ -1047,13 +1044,20 @@ struct BackupView: View {
|
||||
.padding(.horizontal, AppTheme.hPad)
|
||||
.padding(.bottom, 24)
|
||||
|
||||
// Row: backed-up photos (always included, non-toggleable)
|
||||
// Row: backed-up photos (toggleable)
|
||||
Button {
|
||||
withAnimation(.spring(response: 0.3, dampingFraction: 0.8)) {
|
||||
cleanBackedUpPhotos.toggle()
|
||||
}
|
||||
} label: {
|
||||
HStack(spacing: 12) {
|
||||
ZStack {
|
||||
Circle().fill(AppTheme.positive.opacity(0.12)).frame(width: 36, height: 36)
|
||||
Circle()
|
||||
.fill((cleanBackedUpPhotos ? AppTheme.positive : AppTheme.inkQuaternary).opacity(0.12))
|
||||
.frame(width: 36, height: 36)
|
||||
Image(systemName: "photo.on.rectangle")
|
||||
.font(.system(size: 14, weight: .medium))
|
||||
.foregroundStyle(AppTheme.positive)
|
||||
.foregroundStyle(cleanBackedUpPhotos ? AppTheme.positive : AppTheme.inkTertiary)
|
||||
}
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Text("Backed-up photos")
|
||||
@@ -1064,14 +1068,16 @@ struct BackupView: View {
|
||||
.foregroundStyle(AppTheme.inkTertiary)
|
||||
}
|
||||
Spacer()
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
Image(systemName: cleanBackedUpPhotos ? "checkmark.circle.fill" : "circle")
|
||||
.font(.system(size: 18))
|
||||
.foregroundStyle(AppTheme.positive)
|
||||
.foregroundStyle(cleanBackedUpPhotos ? AppTheme.positive : AppTheme.inkQuaternary)
|
||||
}
|
||||
.padding(.horizontal, AppTheme.hPad)
|
||||
.padding(.vertical, 14)
|
||||
.background(AppTheme.surfaceSunken)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 14, style: .continuous))
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.padding(.horizontal, AppTheme.hPad)
|
||||
.padding(.bottom, 12)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user