From fb7e739d515e4ff99dcf9161b67593fac9ea79a4 Mon Sep 17 00:00:00 2001 From: nil-err Date: Wed, 8 Jul 2026 15:19:03 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(dashboard):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BC=9A=E8=AF=9D=E6=89=80=E5=9C=A8=E8=81=8A=E5=A4=A9=E7=AD=9B?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/dashboard-rows.ts | 3 ++ src/dashboard/web/i18n.ts | 14 +++++- src/dashboard/web/sessions-page.tsx | 4 ++ src/dashboard/web/sessions.ts | 61 ++++++++++++++++++++++++-- src/dashboard/web/style.css | 6 +++ test/dashboard-create-session.test.ts | 6 ++- test/dashboard-sessions-ui.test.ts | 8 +++- test/dashboard-token-usage-row.test.ts | 19 +++++++- test/prompt-builder.test.ts | 1 + 9 files changed, 114 insertions(+), 8 deletions(-) diff --git a/src/core/dashboard-rows.ts b/src/core/dashboard-rows.ts index a47d288cf..c87d756d0 100644 --- a/src/core/dashboard-rows.ts +++ b/src/core/dashboard-rows.ts @@ -25,6 +25,7 @@ export interface SessionRow { closedAt?: number; workingDir?: string; chatId: string; + chatType?: 'group' | 'p2p'; rootMessageId: string; threadId?: string; /** Conversation unit ('thread' = topic-anchored, 'chat' = plain chat scope). @@ -114,6 +115,7 @@ export function composeRowFromActive(ds: DaemonSession): SessionRow { lastMessageAt: sessionLastActivityAtMs(ds.session) || ds.lastMessageAt, workingDir: ds.workingDir, chatId: ds.chatId, + chatType: ds.chatType, rootMessageId: ds.session.rootMessageId, scope: ds.session.scope, title: ds.session.title, @@ -154,6 +156,7 @@ export function composeRowFromClosed(s: Session): SessionRow { closedAt: s.closedAt ? Date.parse(s.closedAt) : undefined, workingDir: s.workingDir, chatId: s.chatId, + chatType: s.chatType, rootMessageId: s.rootMessageId, scope: s.scope, title: s.title, diff --git a/src/dashboard/web/i18n.ts b/src/dashboard/web/i18n.ts index 8bbcbec61..824010f14 100644 --- a/src/dashboard/web/i18n.ts +++ b/src/dashboard/web/i18n.ts @@ -120,11 +120,12 @@ const zh: DashboardMessages = { 'overview.noSchedules': '暂无定时任务。', 'sessions.title': '会话控制', 'sessions.subtitle': '定位飞书话题、打开 Web Terminal、关闭或恢复 CLI 会话。', - 'sessions.search': '搜索工作目录 / 标题 / ID', + 'sessions.search': '搜索群聊 / 工作目录 / 标题 / ID', 'sessions.anyStatus': '全部状态', 'sessions.adoptAny': 'adopt: 全部', 'sessions.adoptYes': 'adopt: 是', 'sessions.adoptNo': 'adopt: 否', + 'sessions.chatAny': '所在聊天: 全部', 'sessions.activeOnly': '仅活跃', 'sessions.closeSelected': '关闭选中', 'sessions.clearSelection': '取消选择', @@ -146,6 +147,10 @@ const zh: DashboardMessages = { 'sessions.bot': 'bot', 'sessions.cli': 'CLI', 'sessions.chat': '群聊', + 'sessions.location': '所在聊天', + 'sessions.groupChat': '群聊', + 'sessions.directChat': '单聊', + 'sessions.chatUnknown': '未知聊天', 'sessions.openChat': '打开群聊', 'sessions.status': '状态', 'sessions.status.starting': '启动中', @@ -1560,11 +1565,12 @@ const en: DashboardMessages = { 'overview.noSchedules': 'No schedules yet.', 'sessions.title': 'Session Control', 'sessions.subtitle': 'Locate Feishu topics, open Web Terminal, close or resume CLI sessions.', - 'sessions.search': 'Search working dir / title / IDs', + 'sessions.search': 'Search chat / working dir / title / IDs', 'sessions.anyStatus': 'Any status', 'sessions.adoptAny': 'adopt: any', 'sessions.adoptYes': 'adopt: yes', 'sessions.adoptNo': 'adopt: no', + 'sessions.chatAny': 'Chat: all', 'sessions.activeOnly': 'Active only', 'sessions.closeSelected': 'Close selected', 'sessions.clearSelection': 'Clear', @@ -1586,6 +1592,10 @@ const en: DashboardMessages = { 'sessions.bot': 'Bot', 'sessions.cli': 'CLI', 'sessions.chat': 'Chat', + 'sessions.location': 'Chat', + 'sessions.groupChat': 'Group', + 'sessions.directChat': 'DM', + 'sessions.chatUnknown': 'Unknown chat', 'sessions.openChat': 'Open chat', 'sessions.status': 'Status', 'sessions.status.starting': 'Starting', diff --git a/src/dashboard/web/sessions-page.tsx b/src/dashboard/web/sessions-page.tsx index 2e574cac1..edaac1cf8 100644 --- a/src/dashboard/web/sessions-page.tsx +++ b/src/dashboard/web/sessions-page.tsx @@ -60,6 +60,9 @@ function SessionsPage() { +