perf(native): optimize iOS transcript refresh and add frame profiling

Preserve hosted rows while propagating current SwiftUI environments and render captures. Add differential refresh regressions, opt-in real-clock iOS/Android profiling, and reproducible performance results.

Validation: typecheck; CLI/hub/web/shared/relay suites (Web rerun with NODE_OPTIONS=--no-experimental-webstorage for Node 26/jsdom compatibility); existing iOS Debug/Release and Android regression runs.
This commit is contained in:
weishu
2026-09-10 16:22:36 +08:00
parent c2e3d16b7e
commit 0dcc70e7c7
13 changed files with 3242 additions and 13 deletions
@@ -21,7 +21,6 @@ private enum TranscriptRow: Identifiable, Equatable {
struct ChatTranscriptView: View {
let model: ChatModel
@Environment(\.self) private var environment
private var rows: [TranscriptRow] {
var rows: [TranscriptRow] = [.history(model.historyPaging.phase, model.hasMore)]
@@ -50,8 +49,8 @@ struct ChatTranscriptView: View {
},
onLayout: { version, progress in model.historyLaidOut(version: version, madeProgress: progress) }
) { row in
// HostingConfiguration creates a new root: inherit app services.
AnyView(rowView(row).environment(\.self, environment))
// The list bridges the current environment into its hosting roots.
AnyView(rowView(row))
}
.overlay(alignment: .bottomTrailing) {
if !model.followsTail || model.hasTrimmedTail || model.isJumpingToLatest {