From fd90a89b45549f9d0fd4d47d2f981d23e5cdc698 Mon Sep 17 00:00:00 2001 From: zhayujie Date: Mon, 29 Jun 2026 19:52:46 +0800 Subject: [PATCH] desktop: improve channels page and titlebar UI --- desktop/src/renderer/src/App.tsx | 15 +- .../src/renderer/src/components/ChatInput.tsx | 9 +- desktop/src/renderer/src/components/icons.tsx | 16 ++ desktop/src/renderer/src/i18n.ts | 10 +- desktop/src/renderer/src/layout/NavRail.tsx | 6 +- .../src/renderer/src/layout/SessionList.tsx | 21 +- .../src/renderer/src/pages/ChannelsPage.tsx | 247 +++++++++++++++--- 7 files changed, 267 insertions(+), 57 deletions(-) create mode 100644 desktop/src/renderer/src/components/icons.tsx diff --git a/desktop/src/renderer/src/App.tsx b/desktop/src/renderer/src/App.tsx index e479924e..f94ea704 100644 --- a/desktop/src/renderer/src/App.tsx +++ b/desktop/src/renderer/src/App.tsx @@ -1,6 +1,6 @@ import React, { useState, useCallback, useEffect } from 'react' import { Routes, Route, useLocation, useNavigate } from 'react-router-dom' -import { PanelLeftOpen } from 'lucide-react' +import { History } from 'lucide-react' import NavRail from './layout/NavRail' import SessionList from './layout/SessionList' import WindowControls from './layout/WindowControls' @@ -27,8 +27,8 @@ const App: React.FC = () => { const backend = useBackend() const location = useLocation() const navigate = useNavigate() - const { isWin } = usePlatform() - const { sessionsCollapsed, toggleSessions } = useUIStore() + const { isWin, isMac } = usePlatform() + const { sessionsCollapsed, toggleSessions, navCollapsed } = useUIStore() const onboardingOpen = useOnboardingStore((s) => s.open) const maybeOpenOnboarding = useOnboardingStore((s) => s.maybeOpen) const [, forceUpdate] = useState(0) @@ -107,10 +107,13 @@ const App: React.FC = () => { {isChat && sessionsCollapsed && ( )}
diff --git a/desktop/src/renderer/src/components/ChatInput.tsx b/desktop/src/renderer/src/components/ChatInput.tsx index 8c5cc056..49339c5e 100644 --- a/desktop/src/renderer/src/components/ChatInput.tsx +++ b/desktop/src/renderer/src/components/ChatInput.tsx @@ -3,14 +3,7 @@ import { Plus, Paperclip, Square, X, File as FileIcon, Loader2, Trash2 } from 'l import { t } from '../i18n' import type { Attachment } from '../types' import apiClient from '../api/client' - -// Solid paper-plane icon (Font Awesome's fa-paper-plane path) so the send -// button matches the web console exactly. -const PaperPlaneIcon: React.FC<{ size?: number }> = ({ size = 16 }) => ( - -) +import { PaperPlaneIcon } from './icons' export type ChatInputHandle = (text: string, attachments: Attachment[]) => void diff --git a/desktop/src/renderer/src/components/icons.tsx b/desktop/src/renderer/src/components/icons.tsx new file mode 100644 index 00000000..cc35bffe --- /dev/null +++ b/desktop/src/renderer/src/components/icons.tsx @@ -0,0 +1,16 @@ +import React from 'react' + +// Solid paper-plane icon (Font Awesome's fa-paper-plane path) so the send +// button and the feishu/telegram channels match the web console exactly. +export const PaperPlaneIcon: React.FC<{ size?: number; className?: string }> = ({ size = 16, className }) => ( + +) diff --git a/desktop/src/renderer/src/i18n.ts b/desktop/src/renderer/src/i18n.ts index d0a06a60..5e7f391d 100644 --- a/desktop/src/renderer/src/i18n.ts +++ b/desktop/src/renderer/src/i18n.ts @@ -68,6 +68,7 @@ const translations: Record> = { knowledge_drop_hint: '拖放 .md / .txt 文件到此导入', nav_expand: '展开侧栏', nav_collapse: '收起侧栏', + session_history: '历史会话', update_available: '发现新版本', update_download: '下载更新', update_downloading: '正在下载', @@ -259,7 +260,10 @@ const translations: Record> = { memory_next: '下一页', channels_title: '通道管理', channels_desc: '查看和管理消息通道', - channels_add: '添加通道', + channels_add: '接入通道', + channels_select_label: '选择要接入的通道', + channels_select_placeholder: '请选择通道...', + channels_add_close: '关闭', channels_connected: '已连接', channels_disconnected: '未连接', channels_connect: '连接', @@ -424,6 +428,7 @@ const translations: Record> = { menu_settings: 'Settings', nav_expand: 'Expand sidebar', nav_collapse: 'Collapse sidebar', + session_history: 'Chat history', update_available: 'New version available', update_download: 'Download update', update_downloading: 'Downloading', @@ -616,6 +621,9 @@ const translations: Record> = { channels_title: 'Channels', channels_desc: 'View and manage messaging channels', channels_add: 'Add channel', + channels_select_label: 'Select a channel to add', + channels_select_placeholder: 'Select a channel...', + channels_add_close: 'Close', channels_connected: 'Connected', channels_disconnected: 'Disconnected', channels_connect: 'Connect', diff --git a/desktop/src/renderer/src/layout/NavRail.tsx b/desktop/src/renderer/src/layout/NavRail.tsx index 189a227d..fe7d9f53 100644 --- a/desktop/src/renderer/src/layout/NavRail.tsx +++ b/desktop/src/renderer/src/layout/NavRail.tsx @@ -57,9 +57,9 @@ const NavRail: React.FC = ({ onLangChange }) => { return (