fix(macos): avoid SwiftUI macro plugin dependency (#105768)

* fix(macos): avoid SwiftUI macro plugin dependency

* fix(macos): scope chat previews to iOS

* chore(i18n): refresh native source locations

* fix(macos): preserve explicit environment keys in formatter

* chore(pr): keep changelog release-owned
This commit is contained in:
Peter Steinberger
2026-07-12 17:40:41 -07:00
committed by GitHub
parent 95c3182030
commit af326b98d7
4 changed files with 29 additions and 5 deletions

View File

@@ -30667,7 +30667,7 @@
},
{
"kind": "ui-call",
"line": 33,
"line": 44,
"path": "apps/macos/Sources/OpenClaw/SessionMenuLabelView.swift",
"source": "\\(self.row.tokens.contextSummaryShort) · \\(self.row.ageText)",
"surface": "apple",
@@ -32811,7 +32811,7 @@
},
{
"kind": "ui-call",
"line": 855,
"line": 866,
"path": "apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatMessageViews.swift",
"source": "Running tools…",
"surface": "apple",

View File

@@ -1,9 +1,20 @@
import SwiftUI
extension EnvironmentValues {
@Entry var menuItemHighlighted: Bool = false
// Keep this explicit for SwiftPM toolchains where SwiftUI macro plugins are unavailable.
// swiftformat:disable environmentEntry
private struct MenuItemHighlightedKey: EnvironmentKey {
static let defaultValue = false
}
extension EnvironmentValues {
var menuItemHighlighted: Bool {
get { self[MenuItemHighlightedKey.self] }
set { self[MenuItemHighlightedKey.self] = newValue }
}
}
// swiftformat:enable environmentEntry
struct SessionMenuLabelView: View {
let row: SessionRow
let width: CGFloat

View File

@@ -773,12 +773,23 @@ extension ChatTypingIndicatorBubble: @MainActor Equatable {
}
}
// Keep this explicit for SwiftPM toolchains where SwiftUI macro plugins are unavailable.
// swiftformat:disable environmentEntry
private struct OpenClawAssistantBubblesInCleanChromeKey: EnvironmentKey {
static let defaultValue = false
}
extension EnvironmentValues {
/// Clients that want iMessage-style assistant bubbles in the clean chrome
/// (the iOS app) opt in; the default keeps the plain clean look elsewhere.
@Entry public var openClawAssistantBubblesInCleanChrome: Bool = false
public var openClawAssistantBubblesInCleanChrome: Bool {
get { self[OpenClawAssistantBubblesInCleanChromeKey.self] }
set { self[OpenClawAssistantBubblesInCleanChromeKey.self] = newValue }
}
}
// swiftformat:enable environmentEntry
private struct AssistantBubbleContainerStyle: ViewModifier {
let isClean: Bool
let cornerRadius: CGFloat

View File

@@ -207,6 +207,7 @@ private struct OpenClawChatPreviewTransport: OpenClawChatTransport {
}
}
#if os(iOS)
#Preview("Chat") {
OpenClawChatPreview(scenario: .connected)
}
@@ -243,6 +244,7 @@ private struct OpenClawChatPreviewTransport: OpenClawChatTransport {
markdownVariant: .standard,
userAccent: OpenClawChatTheme.accent)
}
#endif
private struct OpenClawChatPreview: View {
let scenario: OpenClawChatPreviewTransport.Scenario