From 1f3484ac19b2a4e9908b0f39ced7e23aa1de4323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Fri, 17 Apr 2026 20:12:19 -0400 Subject: [PATCH] refactor(communication): polish FilterBar + thread time + composer shortcut MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Communication page audit items from the second-round pass landed as one commit because they sit on overlapping render paths: - FilterBar had two native onChangeFilters({ ...filters, channelType: e.target.value as MessageChannel | "all" })} - className="rounded-lg border border-border bg-card px-2 py-1 text-[11px] font-medium text-foreground" - > - - - - - - - - onChangeFilters({ ...filters, priority: e.target.value })} - className="rounded-lg border border-border bg-card px-2 py-1 text-[11px] font-medium text-foreground" - > - - - - - + onChange={(v) => onChangeFilters({ ...filters, priority: v })} + options={[ + { value: "all", label: t("comm.allPriorities") }, + { value: "urgent", label: t("comm.urgent") }, + { value: "normal", label: t("comm.normal") }, + { value: "low", label: t("comm.low") }, + ]} + /> diff --git a/src/renderer/components/communication/MessageComposer.tsx b/src/renderer/components/communication/MessageComposer.tsx index 55652da4..9362879e 100644 --- a/src/renderer/components/communication/MessageComposer.tsx +++ b/src/renderer/components/communication/MessageComposer.tsx @@ -119,7 +119,7 @@ export function MessageComposer({ placeholder={t("composer.typeMessage")} sending={sending} error={sendError} - shortcutHint={`Press ${cmdOrCtrlLabel()}+Enter to send`} + shortcutHint={t("comm.sendShortcut").replace("{0}", cmdOrCtrlLabel())} sendLabel={t("composer.sendMessage")} sendDisabled={!body.trim() || (channel === "direct" && !directRecipientId)} leading={ diff --git a/src/renderer/components/communication/ThreadPanel.tsx b/src/renderer/components/communication/ThreadPanel.tsx index a6d0d69d..7afa75e2 100644 --- a/src/renderer/components/communication/ThreadPanel.tsx +++ b/src/renderer/components/communication/ThreadPanel.tsx @@ -12,6 +12,7 @@ import { motion } from "framer-motion" import type { AgentRecord, ConversationEventRecord, ThreadWaitStateRecord, ConversationThreadRecord, DocumentRecord } from "@shared/types" import WaitStateIndicator, { type WaitStateInfo } from "./WaitStateIndicator" import { MessageComposer } from "./MessageComposer" +import { formatMessageTime } from "../../lib/formatters" import { useT, type TranslationFn } from "../../i18n" interface ThreadPanelProps { @@ -28,7 +29,7 @@ function EventItem({ event, agents, t }: { event: ConversationEventRecord; agent ? t("thread.actor.you") : agents.find((a) => a.id === event.actorId)?.name ?? event.actorId - const time = new Date(event.createdAt).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) + const time = formatMessageTime(event.createdAt) const iconClass = event.eventType === "status_change" ? "text-primary"