From 3608578ba3311385780cb56f692045b7cce9ecf8 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:16:43 -0400 Subject: [PATCH] refactor(communication): localize ChannelHeader strings; bump tiny chips from 9px to 10px MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stragglers from the Communication audit that did not fit into C10's FilterBar scope: - ChannelHeader carried two hardcoded English strings: the sidebar reveal button's aria-label ("Show sidebar") and the "Open task" link that appears on task-discussion channels. Both now go through i18n — added `comm.showSidebar` ("显示侧边栏" / "Show sidebar") and reused the existing `comm.openTask` key. Users running in Chinese now get a fully Chinese header. - MessageBubble had two 9px uppercase chips (department badge and priority badge). 9px with tracking is unreadable at standard display density; bumped both to 10px and loosened the tracking slightly so the letters don't collide. Same typography decision we made for the OrgChart connector label in C3. Covers the remaining Communication audit items. J-C1 (resizable sidebar) and J-C6 (resizable ThreadPanel) are feature additions and stay out of scope per the audit's "bug fix only" contract. --- src/renderer/components/communication/ChannelHeader.tsx | 4 ++-- src/renderer/components/communication/MessageItem.tsx | 4 ++-- src/renderer/i18n/en.ts | 1 + src/renderer/i18n/zh.ts | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/communication/ChannelHeader.tsx b/src/renderer/components/communication/ChannelHeader.tsx index 166f137d..28914677 100644 --- a/src/renderer/components/communication/ChannelHeader.tsx +++ b/src/renderer/components/communication/ChannelHeader.tsx @@ -53,7 +53,7 @@ export function ChannelHeader({ type="button" onClick={onShowSidebar} className="rounded-[4px] p-1 text-muted-foreground transition hover:text-foreground" - aria-label="Show sidebar" + aria-label={t("comm.showSidebar")} > @@ -64,7 +64,7 @@ export function ChannelHeader({
{activeChannel.label}
{activeChannel.kind === "task" && activeTask ? ( ) : null} diff --git a/src/renderer/components/communication/MessageItem.tsx b/src/renderer/components/communication/MessageItem.tsx index 5aa94097..95509435 100644 --- a/src/renderer/components/communication/MessageItem.tsx +++ b/src/renderer/components/communication/MessageItem.tsx @@ -100,7 +100,7 @@ export const MessageBubble = memo(function MessageBubble({ ) : null} {agent?.department ? ( {agent.department.replace("_", " ")} @@ -110,7 +110,7 @@ export const MessageBubble = memo(function MessageBubble({ {message.priority !== "normal" ? ( {message.priority === "urgent" ? : null} {priorityMap[message.priority]?.label} diff --git a/src/renderer/i18n/en.ts b/src/renderer/i18n/en.ts index d2d40cf0..20cf5bbd 100644 --- a/src/renderer/i18n/en.ts +++ b/src/renderer/i18n/en.ts @@ -599,6 +599,7 @@ export const en: Record = { "comm.adjustFilters": "Try another search or filter", "comm.messagesAppear": "No messages yet", "comm.openTask": "Open task", + "comm.showSidebar": "Show sidebar", "comm.selectChannelSend": "Pick a channel first.", "comm.replyInDiscussion": "Reply in task discussion...", "comm.typeMessage": "Type a message...", diff --git a/src/renderer/i18n/zh.ts b/src/renderer/i18n/zh.ts index 9c13e15c..6ad31bf3 100644 --- a/src/renderer/i18n/zh.ts +++ b/src/renderer/i18n/zh.ts @@ -599,6 +599,7 @@ export const zh: Record = { "comm.adjustFilters": "换个搜索或筛选试试", "comm.messagesAppear": "暂无消息", "comm.openTask": "打开任务", + "comm.showSidebar": "显示侧边栏", "comm.selectChannelSend": "先选一个频道。", "comm.replyInDiscussion": "在任务讨论中回复...", "comm.typeMessage": "输入消息...",