mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-22 04:17:05 +00:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user