Add pull-to-clean on page 1 (storage) — pull zone now on all pages

Pages 1 and 2 both show PULL/RELEASE TO CLEAN. Only page 0
triggers backup; all others trigger the clean confirmation.

Co-Authored-By: Kutesir <kutesir@provoc.ug>
Co-Authored-By: Sentry <sentry@provoc.ug>
This commit is contained in:
Robin Kutesa
2026-05-21 15:00:32 +03:00
parent 1a40d4c1b6
commit 02feba092c

View File

@@ -691,20 +691,18 @@ struct BackupView: View {
Color.clear.frame(height: 60)
}
}
// Pull zone floats above the ring on pages 0 and 2
// Pull zone floats above the ring on all pages
.overlay(alignment: .top) {
if ringPage == 0 || ringPage == 2 {
pullZone
.offset(y: -max(0, pullProgress * 0.52))
}
}
}
private var pullZone: some View {
let pct = min(pullProgress / 58, 1.0)
let ready = pullProgress >= 58
let pullLabel = ringPage == 2 ? "PULL TO CLEAN" : "PULL TO BACK UP"
let releaseLabel = ringPage == 2 ? "RELEASE TO CLEAN" : "RELEASE TO BACK UP"
let pullLabel = ringPage == 0 ? "PULL TO BACK UP" : "PULL TO CLEAN"
let releaseLabel = ringPage == 0 ? "RELEASE TO BACK UP" : "RELEASE TO CLEAN"
return VStack(spacing: 3) {
Text("")
.font(.system(size: 13))
@@ -820,7 +818,7 @@ struct BackupView: View {
withAnimation(.spring(response: 0.38, dampingFraction: 0.85)) { pullProgress = 0 }
if fired {
UIImpactFeedbackGenerator(style: .medium).impactOccurred()
if ringPage == 2 { triggerCleanViaPull() } else { triggerBackupViaPull() }
if ringPage == 0 { triggerBackupViaPull() } else { triggerCleanViaPull() }
}
}
}