Merge 3d7095f9ce0d7ef083ca43a21a64ebb7e1e1ebf4 into 9fb78453e088cd7b553d7779faa0de5c83708e70
This commit is contained in:
commit
899a6585f6
@ -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)
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user