From 296c72eb3f0c242b6b3e8387f0452a259618324f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 16 Apr 2026 23:02:29 -0400 Subject: [PATCH] composer/settings: use ActionButton iconOnly send; replace deprecated navigator.platform with lib/platform (P1-9, P2-46) --- .../communication/MessageComposer.tsx | 17 ++++++++++++----- .../components/execution/SettingsPane.tsx | 5 +++-- src/renderer/lib/platform.ts | 11 +++++++++++ 3 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 src/renderer/lib/platform.ts diff --git a/src/renderer/components/communication/MessageComposer.tsx b/src/renderer/components/communication/MessageComposer.tsx index 090ce0b6..f5d93476 100644 --- a/src/renderer/components/communication/MessageComposer.tsx +++ b/src/renderer/components/communication/MessageComposer.tsx @@ -3,17 +3,24 @@ import { AnimatePresence, motion } from "framer-motion" import { ArrowBendUpLeft, PaperPlaneTilt, X, ChatCircle, UserCircle, Paperclip, FileText } from "@phosphor-icons/react" import type { AgentMessageRecord, AgentRecord, DocumentRecord, MessageChannel } from "@shared/types" import { unwrap } from "../../lib/desktop" +import { cmdOrCtrlLabel } from "../../lib/platform" import { useAppStore } from "../../state/store" -import { InlineNotice } from "../ui" +import { ActionButton, InlineNotice } from "../ui" import { useT } from "../../i18n" const HUMAN_SENDER_ID = "__board__"; function SendButton({ sending, disabled, onClick, label }: { sending: boolean; disabled: boolean; onClick: () => void; label: string }) { return ( - + ) } @@ -320,7 +327,7 @@ export function MessageComposer({ agents, companyId, channel, channelTargetId, d /> )} -
Press {navigator.platform.includes("Mac") ? "Cmd" : "Ctrl"}+Enter to send
+
Press {cmdOrCtrlLabel()}+Enter to send
) } diff --git a/src/renderer/components/execution/SettingsPane.tsx b/src/renderer/components/execution/SettingsPane.tsx index cb0bde39..7f7732bd 100644 --- a/src/renderer/components/execution/SettingsPane.tsx +++ b/src/renderer/components/execution/SettingsPane.tsx @@ -6,6 +6,7 @@ import { APP_LOCALES, LOCALE_LABELS } from "@shared/locale" import { useLocale, useT } from "../../i18n" import { formatTime } from "../../lib/formatters" import { unwrap } from "../../lib/desktop" +import { isMac } from "../../lib/platform" import { ActionButton, ConfirmDialog, EmptyState, InlineNotice, Select } from "../ui" import { describeActionError } from "./execution-utils" import { useAppStore } from "../../state/store" @@ -50,8 +51,8 @@ export function SettingsPane({ snapshot, secrets, companyId, onSaved }: { snapsh
Keyboard Shortcuts
{([ - [navigator.platform.includes("Mac") ? "⌘K" : "Ctrl+K", "Open command palette"], - [navigator.platform.includes("Mac") ? "⌘Enter" : "Ctrl+Enter", "Send message"], + [isMac() ? "⌘K" : "Ctrl+K", "Open command palette"], + [isMac() ? "⌘Enter" : "Ctrl+Enter", "Send message"], ["Escape", "Close modal / palette"], ["↑ / ↓", "Navigate palette results"], ["Enter", "Select palette result"], diff --git a/src/renderer/lib/platform.ts b/src/renderer/lib/platform.ts new file mode 100644 index 00000000..cf0b4ceb --- /dev/null +++ b/src/renderer/lib/platform.ts @@ -0,0 +1,11 @@ +export function isMac(): boolean { + return window.agentCompany.platform === "darwin"; +} + +export function cmdOrCtrlLabel(): string { + return isMac() ? "Cmd" : "Ctrl"; +} + +export function cmdOrCtrlSymbol(): string { + return isMac() ? "⌘" : "Ctrl+"; +}