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();