Files
hapi/ios/Packages/HapiKit/Sources/HapiClient/Chat/ChatHistoryRequestGate.swift
T
weishu c2e3d16b7e feat(native): improve anchored chat scrolling and history loading
Add viewport-driven paging with layout acknowledgements, bounded retries, cancellation gates, and epoch-safe history retention.

Preserve transcript anchors and expansion state, fix tool-group identity collisions, and serialize Android history coordination on Main.

Reduce per-scroll composition and layout work; add native regression tests, CI coverage, and profiling guidance.
2026-09-10 16:22:36 +08:00

14 lines
448 B
Swift

import Foundation
/// Synchronously invalidated by reader input; checked inside the window
/// actor's before-apply callback. Never reaches back into UI from that actor.
public final class ChatHistoryRequestGate: @unchecked Sendable {
private let lock = NSLock()
private var valid = true
public init() {}
public var allowsApply: Bool { lock.withLock { valid } }
public func invalidate() { lock.withLock { valid = false } }
}