fix(ios): picker adaptive onChange loop + OSLog string concatenation

Two independent fixes:

1. **Picker adaptive tag onChange loop**: prevent infinite loop when
   picker selection triggers onChange which re-triggers state update

2. **OSLog concatenation**: Swift doesn't support '+' between
   OSLogMessage operands. Combined 3 multi-line log strings into
   single-line interpolations in NodeAppModel pending action logging.
This commit is contained in:
Eulices Lopez 2026-03-09 06:38:10 -04:00
parent dc86b6d72a
commit 47f4adcefc
2 changed files with 8 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,12 @@ 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
withAnimation(.snappy(duration: 0.22)) {
self.scrollPosition = self.scrollerBottomID
}
}
}
}