From 01ed6b1f04bfa12bb737a52d75597b4fbc082ecf Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 12 Jul 2026 17:34:14 +0200 Subject: [PATCH] fix(ios): distinguish localized and verbatim session actions --- apps/.i18n/native-source.json | 2 +- .../Sources/Design/CommandCenterSupport.swift | 20 +++++++++++-------- scripts/apple-app-i18n.ts | 3 ++- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/apps/.i18n/native-source.json b/apps/.i18n/native-source.json index d9d908a35667..6c555db3a95c 100644 --- a/apps/.i18n/native-source.json +++ b/apps/.i18n/native-source.json @@ -15075,7 +15075,7 @@ }, { "kind": "ui-call", - "line": 340, + "line": 344, "path": "apps/ios/Sources/Design/CommandCenterSupport.swift", "source": "View More", "surface": "apple", diff --git a/apps/ios/Sources/Design/CommandCenterSupport.swift b/apps/ios/Sources/Design/CommandCenterSupport.swift index 1272bb020df9..701cca4f886a 100644 --- a/apps/ios/Sources/Design/CommandCenterSupport.swift +++ b/apps/ios/Sources/Design/CommandCenterSupport.swift @@ -160,16 +160,16 @@ struct CommandSessionActionsModifier: ViewModifier { } else { self.actionButton( self.session.pinned == true - ? LocalizedStringKey("Unpin") - : LocalizedStringKey("Pin"), + ? OpenClawTextValue.localized("Unpin") + : OpenClawTextValue.localized("Pin"), systemImage: self.session.pinned == true ? "pin.slash" : "pin") { self.actions.togglePinned() } self.actionButton( self.session.unread == true - ? LocalizedStringKey("Mark as Read") - : LocalizedStringKey("Mark as Unread"), + ? OpenClawTextValue.localized("Mark as Read") + : OpenClawTextValue.localized("Mark as Unread"), systemImage: self.session.unread == true ? "envelope.open" : "envelope.badge") { self.actions.toggleUnread() @@ -229,7 +229,7 @@ struct CommandSessionActionsModifier: ViewModifier { private var groupMenu: some View { Menu { ForEach(self.categories, id: \.self) { category in - self.actionButton(category, systemImage: "folder") { + self.actionButton(.verbatim(category), systemImage: "folder") { self.actions.moveToGroup(category) } } @@ -276,13 +276,17 @@ struct CommandSessionActionsModifier: ViewModifier { } private func actionButton( - _ title: LocalizedStringKey, + _ title: OpenClawTextValue, systemImage: String, action: @escaping () -> Void) -> some View { Button(action: action) { - Label(title, systemImage: systemImage) - .font(OpenClawType.subhead) + Label { + title.text + .font(OpenClawType.subhead) + } icon: { + Image(systemName: systemImage) + } } } diff --git a/scripts/apple-app-i18n.ts b/scripts/apple-app-i18n.ts index 164c1f8b87c8..43635e6fc00c 100644 --- a/scripts/apple-app-i18n.ts +++ b/scripts/apple-app-i18n.ts @@ -223,7 +223,8 @@ const LOCALIZED_WRAPPER_CONTRACTS: Record = { "Text(verbatim: self.item.trailing)", "Text(verbatim: self.item.detail)", "struct CommandEmptyStateRow: View {\n let icon: String\n let title: OpenClawTextValue\n let detail: OpenClawTextValue", - "private func actionButton(\n _ title: LocalizedStringKey", + "private func actionButton(\n _ title: OpenClawTextValue", + "self.actionButton(.verbatim(category)", ], "apps/ios/Sources/Design/IPadSkillWorkshopScreen.swift": [ 'format: String(localized: "No proposals in %@")',