mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-23 04:37:09 +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:
@@ -76,7 +76,7 @@ struct AgentTextBlockView: View {
|
||||
let block: AgentTextBlock
|
||||
|
||||
var body: some View {
|
||||
MarkdownView(markdown: block.text)
|
||||
CachedMarkdownView(markdown: block.text)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,12 @@ struct AgentTextBlockView: View {
|
||||
/// the full reasoning markdown (still subdued — it is meta-content).
|
||||
struct AgentReasoningBlockView: View {
|
||||
let block: AgentReasoningBlock
|
||||
@State private var expanded = false
|
||||
@ChatStoredState private var expanded: Bool
|
||||
|
||||
init(block: AgentReasoningBlock) {
|
||||
self.block = block
|
||||
_expanded = ChatStoredState(wrappedValue: false, id: block.id, field: "expanded")
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
@@ -103,7 +108,7 @@ struct AgentReasoningBlockView: View {
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
if expanded {
|
||||
MarkdownView(markdown: block.text)
|
||||
CachedMarkdownView(markdown: block.text)
|
||||
.opacity(0.75)
|
||||
.padding(.leading, 8)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user