mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-24 04:47:03 +00:00
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.
This commit is contained in:
@@ -13,8 +13,8 @@ struct ToolCallBlockView: View {
|
||||
let block: ToolCallBlock
|
||||
let basePath: String?
|
||||
|
||||
@State private var expanded: Bool
|
||||
@State private var childrenOpen: Bool
|
||||
@ChatStoredState private var expanded: Bool
|
||||
@ChatStoredState private var childrenOpen: Bool
|
||||
@Environment(\.hapiTheme) private var theme
|
||||
@Environment(\.chatInteractions) private var interactions
|
||||
|
||||
@@ -22,8 +22,8 @@ struct ToolCallBlockView: View {
|
||||
self.block = block
|
||||
self.basePath = basePath
|
||||
let pending = block.tool.permission?.status == .pending
|
||||
_expanded = State(initialValue: pending)
|
||||
_childrenOpen = State(initialValue: pending)
|
||||
_expanded = ChatStoredState(wrappedValue: pending, id: block.id, field: "expanded")
|
||||
_childrenOpen = ChatStoredState(wrappedValue: pending, id: block.id, field: "children")
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
|
||||
Reference in New Issue
Block a user