From d06cd6cedf773adb7d0300f0639a2a3de92e94d9 Mon Sep 17 00:00:00 2001 From: kicer Date: Wed, 11 Nov 2026 15:42:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E7=AA=84=E5=B1=8F=E5=8F=AA=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E6=97=A7=E6=96=87=E4=BB=B6=E9=9D=A2=E6=9D=BF=EF=BC=9B?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=AE=BE=E7=BD=AE=E5=9B=BE=E6=A0=87=E5=81=8F?= =?UTF-8?q?=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 窄屏(<960px)隐藏左栏的「文件树」图标:手机上只保留输入行右侧的旧「任务文件」面板, 不做两套文件 UI;setDrawerPane 增加窄屏防线,跨断点缩小时自动退回会话列表 - 设置齿轮换成正中且四周留白的图标:原路径外接框垂直中心在 10.5(画布中心 12), 整枚图标偏上,20px 下看起来像顶部被切掉 --- app/server/public/css/style.css | 6 +++--- app/server/public/index.html | 6 +++--- app/server/public/js/files.js | 5 +++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/server/public/css/style.css b/app/server/public/css/style.css index ce9229c..ff09001 100644 --- a/app/server/public/css/style.css +++ b/app/server/public/css/style.css @@ -872,9 +872,9 @@ body.voice-active .scroll-bottom-btn { display: none; } width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; } -/* 窄屏没有右侧预览分栏(预览改走全屏 #fs-viewer),所以只藏这一个钮; - 文件树只是抽屉里的一个面板,任何宽度都能用,不藏。 */ -@media (max-width: 959px) { #da-preview { display: none !important; } } +/* 窄屏:没有右侧预览分栏(预览走全屏 #fs-viewer);文件浏览只保留输入行右侧的 + 旧「任务文件」面板,左栏不再出现文件树(不做两套文件 UI)。所以这两个钮都隐藏。 */ +@media (max-width: 959px) { #da-preview, #da-files { display: none !important; } } .files-tree { display: none; flex: 1; min-height: 0; flex-direction: column; } #drawer.drawer-mode-files .drawer-search, diff --git a/app/server/public/index.html b/app/server/public/index.html index 18950fb..e10d5ac 100644 --- a/app/server/public/index.html +++ b/app/server/public/index.html @@ -235,8 +235,8 @@
- +
diff --git a/app/server/public/js/files.js b/app/server/public/js/files.js index 26aed6c..7b259ee 100644 --- a/app/server/public/js/files.js +++ b/app/server/public/js/files.js @@ -1237,6 +1237,8 @@ // 「文件树」是侧栏两个互斥面板的切换开关:不在文件页 → 切到文件树(高亮), // 再点一次 → 回会话列表(不亮)。预览与设置不占用侧栏,高亮由 preview.js / settings.js 同步。 function setDrawerPane(files) { + // 窄屏没有文件树(只有输入行右侧的旧文件面板),任何调用方都不允许切过去 + if (files && !drawerMQ.matches) return; // 文件树模块没加载成功时不要把一个空面板切出来 if (files && typeof window.showFileTree !== 'function') return; const drawer = $('drawer'); @@ -1251,6 +1253,9 @@ $('da-files').addEventListener('click', () => { setDrawerPane(!$('drawer').classList.contains('drawer-mode-files')); }); + // 窄屏只保留输入行右侧的旧「任务文件」面板,左栏不再提供文件树(按钮也已 CSS 隐藏)。 + // 宽屏缩到窄屏时如果正停在文件页,先退回会话列表,避免出现两套文件 UI。 + drawerMQ.addEventListener('change', (e) => { if (!e.matches) setDrawerPane(false); }); // 预览:同一个按钮开/关右侧面板 $('da-preview').addEventListener('click', () => { if (typeof pvTogglePane === 'function') pvTogglePane();