fix(ios): reduce back-to-latest button sensitivity

This commit is contained in:
weishu
2026-09-13 11:46:10 +08:00
parent 051dbbd7da
commit 2e37419a7d
9 changed files with 308 additions and 8 deletions
@@ -0,0 +1,18 @@
/// Presentation-only hysteresis. Being close enough to hide the latest
/// button never opts the reader back into tail following.
struct TranscriptBottomProximity {
private(set) var isAwayFromBottom = false
mutating func update(bottomDistance: Double, followsTail: Bool) {
guard !followsTail else {
isAwayFromBottom = false
return
}
let distance = max(0, bottomDistance)
if isAwayFromBottom {
if distance <= 24 { isAwayFromBottom = false }
} else if distance >= 80 {
isAwayFromBottom = true
}
}
}