mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-14 11:16:06 +00:00
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:
committed by
GitHub
parent
95c3182030
commit
af326b98d7
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user