fix: synchronize read state across web and native clients

Track readable content revisions and durable read cursors in the hub. Acknowledge only rendered foreground tails, persist offline read operations, and preserve newer manual unread choices across devices.

Migrate existing history to a read baseline and cover pagination receipts with shared native conformance fixtures.
This commit is contained in:
weishu
2026-11-01 09:52:51 +08:00
parent ee4ac238cb
commit 5ef4304a4a
139 changed files with 2352 additions and 1053 deletions
@@ -34,6 +34,7 @@ enum TranscriptRow: Identifiable, Equatable {
}
struct ChatTranscriptView: View {
@Environment(\.scenePhase) private var scenePhase
let model: ChatModel
private var rows: [TranscriptRow] {
@@ -49,6 +50,8 @@ struct ChatTranscriptView: View {
}
var body: some View {
let revision = model.readThroughRevision
let readState = model.renderedReadState
AnchoredTranscriptList(
items: rows,
historyVersion: model.historyVersion,
@@ -62,6 +65,9 @@ struct ChatTranscriptView: View {
)
},
onLayout: { version, progress in model.historyLaidOut(version: version, madeProgress: progress) },
onTailDisplayed: {
if scenePhase == .active { model.markDisplayed(revision: revision, serverState: readState) }
},
spacingBefore: { previous, row in row.spacing(after: previous) }
) { row in
// The list bridges the current environment into its hosting roots.