diff --git a/tests/frontend_files.test.mjs b/tests/frontend_files.test.mjs index 08db2d4..4b6a7fd 100644 --- a/tests/frontend_files.test.mjs +++ b/tests/frontend_files.test.mjs @@ -52,3 +52,10 @@ test("mobile navigation distinguishes list, files, and software jobs", () => { assert.match(pageHtml, /id="mv-tab-right"[^>]*data-right-tab="files"/); assert.match(pageHtml, /id="mv-tab-jobs"[^>]*data-right-tab="jobs"/); }); + +test("right workspace widens the legacy default without overriding custom widths", () => { + assert.match(layoutJs, /right: \{ min: 220, max: 560, def: 360 \}/); + assert.match(layoutJs, /!migrated && \(!storedRight \|\| storedRight === "320"\)/); + assert.match(layoutJs, /localStorage\.setItem\(LS_RIGHT_WIDTH_360_MIGRATED, "1"\)/); + assert.match(pageHtml, /--right-grid-width: var\(--right-pane-width, 360px\)/); +}); diff --git a/tests/test_static_vendor.py b/tests/test_static_vendor.py index f98f4ae..57e006a 100644 --- a/tests/test_static_vendor.py +++ b/tests/test_static_vendor.py @@ -145,6 +145,11 @@ class StaticVendorTests(unittest.TestCase): ) self.assertNotIn("hiddenToggle.hidden", files_js) self.assertRegex(html, r'id="btn-file-add" class="[^"]*\bsmall\b[^"]*\bdd-toggle\b') + self.assertRegex( + html, + r'id="btn-file-add"[^>]*aria-label="添加文件或文件夹"[^>]*>+', + ) + self.assertIn("@container (max-width: 280px)", html) self.assertNotIn('id="btn-new-folder"', html) self.assertNotIn('id="btn-src-pick"', html) self.assertNotIn('id="btn-upload"', html) diff --git a/web/static/dev.html b/web/static/dev.html index 4f87f59..7e63e4c 100644 --- a/web/static/dev.html +++ b/web/static/dev.html @@ -498,7 +498,7 @@ #app { display: none; height: 100vh; } #app.ready { --left-grid-width: var(--left-pane-width, 320px); - --right-grid-width: var(--right-pane-width, 320px); + --right-grid-width: var(--right-pane-width, 360px); display: grid; grid-template-columns: var(--left-grid-width) 6px minmax(0, 1fr) 6px var(--right-grid-width); grid-template-rows: auto 1fr; @@ -560,7 +560,7 @@ /* min-height: 0 + overflow: hidden 让内部 flex 子项的 overflow: auto 真正生效(否则被默认 min-height: auto 顶出) */ #pane-mid { grid-area: mid; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--panel); min-height: 0; min-width: 0; overflow: hidden; position: relative; } /* 右侧工作区:页签头固定,文件 / 作业面板各自管理内部滚动 */ - #pane-right { grid-area: right; border-right: none; display: flex; flex-direction: column; overflow: hidden; background: var(--panel); min-height: 0; } + #pane-right { grid-area: right; border-right: none; display: flex; flex-direction: column; overflow: hidden; background: var(--panel); min-height: 0; container-type: inline-size; } #pane-right > .pane-head { flex-shrink: 0; } .right-workspace-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; } #right-jobs-panel { display: none; } @@ -1077,16 +1077,30 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; } .proc-toast.fail { border-color: rgba(192,57,43,0.5); } - .right-workspace-head { gap: 4px; } + .right-workspace-head { + gap: 3px; padding-inline: 8px; flex-wrap: nowrap; overflow: hidden; + } + .right-workspace-head .spacer { min-width: 0; } .mobile-workspace-title { display: none; font-size: 13px; font-weight: 600; } .workspace-tab { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; padding: 4px 7px; border: 0; border-radius: 6px; background: transparent; - color: var(--muted); cursor: pointer; font-size: 12px; + color: var(--muted); cursor: pointer; font-size: 12px; white-space: nowrap; flex: 0 1 auto; } .workspace-tab:hover { background: var(--hover); color: var(--text); } .workspace-tab.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; } .workspace-tab svg { width: 16px; height: 16px; flex-shrink: 0; } + .right-workspace-head > .file-panel-control, + .right-workspace-head > #pane-toggle-right { + width: 28px; height: 28px; min-width: 28px; padding: 0; + display: inline-flex; align-items: center; justify-content: center; + white-space: nowrap; flex: 0 0 28px; + } + .right-workspace-head > #btn-file-add { font-size: 18px; line-height: 1; } + @container (max-width: 280px) { + .right-workspace-head .workspace-tab > span:not(.workspace-badge) { display: none; } + .right-workspace-head .workspace-tab { width: 28px; height: 28px; padding: 0; flex: 0 0 28px; } + } .workspace-badge { min-width: 16px; height: 16px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-style: normal; line-height: 1; @@ -2173,9 +2187,9 @@ - - - + + +