diff --git a/frontend/src/components/ThemeToggleButton.vue b/frontend/src/components/ThemeToggleButton.vue index 00366f95..3362b27a 100644 --- a/frontend/src/components/ThemeToggleButton.vue +++ b/frontend/src/components/ThemeToggleButton.vue @@ -15,7 +15,7 @@ const isDarkTheme = computed(() => appliedTheme.value === 'dark'); const buttonClass = computed(() => props.floating ? 'fixed bottom-5 right-5 z-[70] h-11 w-11 rounded-full bg-white/90 dark:bg-slate-900/90 backdrop-blur-md shadow-lg border border-slate-200 dark:border-slate-700 text-slate-600 dark:text-slate-300 hover:text-slate-900 dark:hover:text-slate-100 hover:shadow-xl flex items-center justify-center transition-all' - : 'h-9 w-9 rounded-full bg-white/80 dark:bg-slate-900/80 backdrop-blur-md shadow-sm border border-slate-200 dark:border-slate-700 text-slate-600 dark:text-slate-300 hover:text-slate-900 dark:hover:text-slate-100 hover:shadow-md flex items-center justify-center transition-all' + : 'h-8 w-8 md:h-9 md:w-9 rounded-full bg-white/80 dark:bg-slate-900/80 backdrop-blur-md shadow-sm border border-slate-200 dark:border-slate-700 text-slate-600 dark:text-slate-300 hover:text-slate-900 dark:hover:text-slate-100 hover:shadow-md flex items-center justify-center transition-all' ); @@ -26,7 +26,7 @@ const buttonClass = computed(() => :title="isDarkTheme ? (t('theme.switchToLight') || 'Switch to light mode') : (t('theme.switchToDark') || 'Switch to dark mode')" :aria-label="isDarkTheme ? (t('theme.switchToLight') || 'Switch to light mode') : (t('theme.switchToDark') || 'Switch to dark mode')" > - - + + diff --git a/frontend/src/i18n.ts b/frontend/src/i18n.ts index 34ed3309..b83d7262 100644 --- a/frontend/src/i18n.ts +++ b/frontend/src/i18n.ts @@ -78,6 +78,12 @@ const messages = { }, workspace: { title: 'AI Workspace', + brandTitle: 'Hexin AI Workspace', + languageLabel: 'Language', + languageOptionEn: 'English', + languageOptionZhCN: 'Chinese (Simplified)', + languageOptionZhTW: 'Chinese (Traditional)', + languageOptionTh: 'Thai', userTitle: '{username}\'s AI Workspace', subtitle: 'Choose an agent or click a quick question to start', search: 'Search agents...', @@ -762,6 +768,12 @@ const messages = { }, workspace: { title: 'AI 工作台', + brandTitle: '和信AI工作台', + languageLabel: '语言', + languageOptionEn: '英文', + languageOptionZhCN: '简体中文', + languageOptionZhTW: '繁體中文', + languageOptionTh: '泰语', userTitle: '{username} 的 AI 工作台', subtitle: '选择一个助手,或点击常用问题快速开始', search: '搜索应用...', @@ -1425,6 +1437,12 @@ const messages = { }, workspace: { title: 'AI 工作台', + brandTitle: '和信AI工作台', + languageLabel: '語言', + languageOptionEn: '英文', + languageOptionZhCN: '簡體中文', + languageOptionZhTW: '繁體中文', + languageOptionTh: '泰語', userTitle: '{username} 的 AI 工作台', subtitle: '選擇一個助手,或點擊常用問題快速開始', search: '搜索應用...', @@ -2088,6 +2106,12 @@ const messages = { }, workspace: { title: 'พื้นที่ทำงาน AI', + brandTitle: 'Hexin AI Workspace', + languageLabel: 'ภาษา', + languageOptionEn: 'อังกฤษ', + languageOptionZhCN: 'จีน (ตัวย่อ)', + languageOptionZhTW: 'จีน (ตัวเต็ม)', + languageOptionTh: 'ไทย', userTitle: 'พื้นที่ทำงาน AI ของ {username}', subtitle: 'เลือกผู้ช่วยหรือคลิกคำถามด่วนเพื่อเริ่ม', search: 'ค้นหาตัวแทน...', diff --git a/frontend/src/style.css b/frontend/src/style.css index f4ebedef..2afbb14f 100644 --- a/frontend/src/style.css +++ b/frontend/src/style.css @@ -101,6 +101,27 @@ @apply bg-white rounded-2xl border border-slate-100 shadow-soft hover:shadow-lg transition-all duration-300; } + /* Mobile-first layout tokens for consistent spacing and density. */ + .page-shell-mobile { + @apply px-3 md:px-8; + } + + .section-gap-mobile { + @apply mb-3 md:mb-8; + } + + .card-mobile-compact { + @apply p-3 sm:p-5; + } + + .icon-box-mobile { + @apply w-8 h-8 sm:w-10 sm:h-10; + } + + .icon-glyph-mobile { + @apply w-4 h-4 sm:w-6 sm:h-6; + } + .badge { @apply px-2.5 py-0.5 rounded-full text-xs font-medium border; } diff --git a/frontend/src/views/ChatView.vue b/frontend/src/views/ChatView.vue index baa273dc..a5d83f0c 100644 --- a/frontend/src/views/ChatView.vue +++ b/frontend/src/views/ChatView.vue @@ -65,14 +65,14 @@ interface SourceFileLink { } // 源文件展示配置(来自 config.ts) -const sourceFileConfig = { - // 是否显示整个“源文件”区域 - showSourceFiles: config.workspace?.sourceFiles?.showSourceFiles !== false, - // 是否显示 MD 源文件(.md/.markdown) - showMdFiles: config.workspace?.sourceFiles?.showMdFiles !== false, - // MD 源文件是否默认展开“源文档”详情 - expandMdByDefault: config.workspace?.sourceFiles?.expandMdByDefault === true, -}; +// const sourceFileConfig = { +// // 是否显示整个“源文件”区域 +// showSourceFiles: config.workspace?.sourceFiles?.showSourceFiles !== false, +// // 是否显示 MD 源文件(.md/.markdown) +// showMdFiles: config.workspace?.sourceFiles?.showMdFiles !== false, +// // MD 源文件是否默认展开“源文档”详情 +// expandMdByDefault: config.workspace?.sourceFiles?.expandMdByDefault === true, +// }; const PREFERRED_SOURCE_EXTS = new Set([ 'pdf', 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'csv', @@ -232,7 +232,7 @@ const getSourceLinks = (resources: any[] = []): SourceFileLink[] => { // Skip links whose display name itself is noisy. if (isNoisySourceName(name)) continue; // 根据配置决定是否显示 MD 文件 - if (!sourceFileConfig.showMdFiles && (isMarkdownFileName(name) || isMarkdownByUrl(url))) continue; + if ( (isMarkdownFileName(name) || isMarkdownByUrl(url))) continue; const key = `${name}|${url}`; if (!map.has(key)) { map.set(key, { name, url }); @@ -245,7 +245,10 @@ const getSourceLinks = (resources: any[] = []): SourceFileLink[] => { }; const getMessageLinks = (msg: any): SourceFileLink[] => { - if (!sourceFileConfig.showSourceFiles) return []; + // if (!sourceFileConfig.showSourceFiles) { + // console.info('showSourceFiles is false'); + // return []; + // } const map = new Map(); const merge = (links: SourceFileLink[]) => { @@ -253,7 +256,7 @@ const getMessageLinks = (msg: any): SourceFileLink[] => { if (isChunkLikeLink(link.url)) continue; // 文件名有效时,保留文件按钮(即便 URL 是临时签名地址)。 if (isNoisySourceName(link.name)) continue; - if (!sourceFileConfig.showMdFiles && (isMarkdownFileName(link.name) || isMarkdownByUrl(link.url))) continue; + if ( (isMarkdownFileName(link.name) || isMarkdownByUrl(link.url))) continue; if (isMarkdownFileName(link.name)) { const key = `${link.name}|${link.url}`; if (!map.has(key)) map.set(key, link); @@ -277,9 +280,9 @@ const getMessageLinks = (msg: any): SourceFileLink[] => { }; const getDisplayRetrieverResources = (msg: any): any[] => { - if (!sourceFileConfig.showSourceFiles) return []; + // if (!sourceFileConfig.showSourceFiles) return []; const list = Array.isArray(msg?.retriever_resources) ? msg.retriever_resources : []; - if (sourceFileConfig.showMdFiles) return list; + // if (sourceFileConfig.showMdFiles) return list; return list.filter((doc: any) => { const name = doc?.source_filename || doc?.document_name || doc?.title || ''; const url = doc?.source_download_url || doc?.url || doc?.file_url || doc?.document_url || ''; @@ -288,8 +291,12 @@ const getDisplayRetrieverResources = (msg: any): any[] => { }; const shouldExpandSourceDetails = (msg: any): boolean => { - if (!sourceFileConfig.showSourceFiles) return false; - if (!sourceFileConfig.showMdFiles || !sourceFileConfig.expandMdByDefault) return false; + // if (!sourceFileConfig.showSourceFiles) { + // console.info('showSourceFiles is false'); + // return false; + // } + + // if (!sourceFileConfig.showMdFiles || !sourceFileConfig.expandMdByDefault) return false; return getMessageLinks(msg).some((link) => isMarkdownFileName(link.name) || isMarkdownByUrl(link.url)); }; @@ -521,10 +528,10 @@ const submitFeedback = async () => { > @@ -584,7 +589,7 @@ const submitFeedback = async () => {
- @@ -606,15 +611,15 @@ const submitFeedback = async () => {