Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private enum SyncRing {
static let ellipsisGlyphSize: CGFloat = 9
static let dimGlyphOpacity: Double = 0.5

/// The transient "Syncing" label's tone.
/// The "Syncing" label's tone.
static let labelOpacity: Double = 0.92

/// Stroke weight `eased` of the way from the battery ring to the spinner. The entry passes its own
Expand Down Expand Up @@ -428,20 +428,8 @@ public struct ChargeSyncIndicator: View {
showsLabel = true
}

try? await Task.sleep(
nanoseconds: StrandMotion.syncIndicatorLabelVisibilityNanoseconds
)
guard !Task.isCancelled else { return }
animate(poseStill ? nil : StrandMotion.syncIndicatorLabelOut) {
showsLabel = false
}
try? await Task.sleep(
nanoseconds: StrandMotion.syncIndicatorCollapseDelayNanoseconds
)
guard !Task.isCancelled else { return }
animate(poseStill ? nil : StrandMotion.syncIndicatorMorph) {
pillProgress = 0
}
// Keep the label and capsule stable until endSync; collapsing during an active sync
// shifts the neighbouring header controls while the strap is still handing over data.
}
}

Expand Down
9 changes: 3 additions & 6 deletions Packages/StrandDesign/Sources/StrandDesign/Motion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ public enum StrandMotion {
/// distinct mid-sweep.
static let syncIndicatorTintBandTurns: Double = 0.10

/// Transient label fades after the capsule has settled.
/// Sync label fades after the capsule has settled.
static let syncIndicatorLabelIn = Animation.easeOut(duration: 0.26)
static let syncIndicatorLabelOut = Animation.easeInOut(duration: 0.26)

static let syncIndicatorFrameInterval = 1.0 / 60.0
static let syncIndicatorSpinPeriod = 1.25
Expand All @@ -123,13 +122,11 @@ public enum StrandMotion {

/// Grace period the SCREEN applies to the falling edge of the sync signal before it tells the
/// indicator to wind down. Public because the raw signal is the screen's to own: `backfilling` drops
/// between history chunks, and without this the control would flap back to the battery reading in the
/// middle of one logical sync.
/// between automatically continued offload sessions, and otherwise the control would flap back to
/// the battery reading in the middle of one logical sync.
public static let syncIndicatorSignalDebounceNanoseconds: UInt64 = 3_000_000_000

static let syncIndicatorLabelDelayNanoseconds: UInt64 = 650_000_000
static let syncIndicatorLabelVisibilityNanoseconds: UInt64 = 1_900_000_000
static let syncIndicatorCollapseDelayNanoseconds: UInt64 = 240_000_000
/// Steady spinner rate in degrees per second. Derived from the spin period rather than written out,
/// so the wind-down cannot drift out of step with the spin it has to hand off from.
static var syncIndicatorSpinRateDegrees: Double { 360 / syncIndicatorSpinPeriod }
Expand Down
Loading
Loading