Merge 3d7095f9ce0d7ef083ca43a21a64ebb7e1e1ebf4 into 9fb78453e088cd7b553d7779faa0de5c83708e70

This commit is contained in:
Eulices 2026-03-20 22:02:21 -07:00 committed by GitHub
commit 899a6585f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View File

@ -9,7 +9,7 @@ import UniformTypeIdentifiers
@MainActor
struct OpenClawChatComposer: View {
private static let menuThinkingLevels = ["off", "low", "medium", "high"]
private static let menuThinkingLevels = ["off", "low", "medium", "high", "adaptive"]
@Bindable var viewModel: OpenClawChatViewModel
let style: OpenClawChatView.Style
@ -99,6 +99,7 @@ struct OpenClawChatComposer: View {
Text("Low").tag("low")
Text("Medium").tag("medium")
Text("High").tag("high")
Text("Adaptive").tag("adaptive")
if !Self.menuThinkingLevels.contains(self.viewModel.thinkingLevel) {
Text(self.viewModel.thinkingLevel.capitalized).tag(self.viewModel.thinkingLevel)
}

View File

@ -180,8 +180,13 @@ public struct OpenClawChatView: View {
}
.onChange(of: self.viewModel.streamingAssistantText) { _, _ in
guard self.hasPerformedInitialScroll, self.isPinnedToBottom else { return }
withAnimation(.snappy(duration: 0.22)) {
self.scrollPosition = self.scrollerBottomID
// Defer past the current layout pass to avoid "onChange tried to update
// multiple times per frame" warnings during rapid streaming token delivery.
Task { @MainActor in
guard self.hasPerformedInitialScroll, self.isPinnedToBottom else { return }
withAnimation(.snappy(duration: 0.22)) {
self.scrollPosition = self.scrollerBottomID
}
}
}
}