gui: a dialog's fields no longer scroll sideways in the Mac app when the dialog scrolls — WebKit laid a framed editor's grid out at the full width and then let the 8px Mac scrollbar (4dab45e3) take its right edge, so a disconnect preview in a 560x420 window ran 8px wide; the bar's room is now always kept, taken out of the right padding, so fields end where they did when nothing scrolls. agent-disconnect-preview measures the body's content box up to the scrollbar (clientWidth) rather than its outer edge; its "no horizontal overflow" check fails in WebKit without the fix and passes with it in Chromium and WebKit, en and zh. account-arrange, editor-short-window, models-free-only, models-fold, names-fold, plugin-market, whats-new, old-webkit and click-scroll pass in both (plugin-move fails in Chromium the same without the change).

This commit is contained in:
yetone
2026-10-06 05:56:47 +08:00
parent 2bdb0d0e7b
commit 28dd70f61f
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -314,6 +314,11 @@ body.mac :is(.view, .modal .dialog, .modal .editor.framed > .ebody)::-webkit-scr
body.mac :is(.view, .modal .dialog, .modal .editor.framed > .ebody)::-webkit-scrollbar-thumb { background: var(--faint); border: 2px solid transparent; border-radius: 8px; background-clip: padding-box; }
body.mac :is(.view, .modal .dialog, .modal .editor.framed > .ebody)::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }
body.mac :is(.view, .modal .dialog, .modal .editor.framed > .ebody)::-webkit-scrollbar-corner { background: transparent; }
/* WebKit lays a framed editor's grid out at the full width and then lets
the 8px bar take its right edge, so a body that scrolled ran 8px wide
and scrolled sideways; the bar's room is always kept, out of the right
padding, so the fields end where they did */
body.mac .modal .editor.framed > .ebody { overflow-y: scroll; padding-right: 10px; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; flex: none; }
body.panel .list { border: 0; border-radius: 10px; box-shadow: var(--card-edge); }
.row { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 5px 9px 5px 11px; }
@@ -90,8 +90,9 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
const rect = (e) => { const r = e.getBoundingClientRect(); return { left: r.left, right: r.right, top: r.top, bottom: r.bottom, width: r.width }; };
const body = ed.querySelector(".ebody"), css = getComputedStyle(body), diff = ed.querySelector(".ag-diff-wrap");
const r = rect(body), scale = r.width / body.offsetWidth, note = ed.querySelector(".ag-note"), code = diff.querySelector("code");
// the content box ends at the scrollbar, not at the body's edge
return {
content: { left: r.left + parseFloat(css.paddingLeft) * scale, right: r.right - parseFloat(css.paddingRight) * scale },
content: { left: r.left + parseFloat(css.paddingLeft) * scale, right: r.left + (body.clientLeft + body.clientWidth - parseFloat(css.paddingRight)) * scale },
diff: rect(diff), note: note && rect(note), code: rect(code), lineHeight: parseFloat(getComputedStyle(code.parentElement).lineHeight) * scale,
dialog: rect(ed.closest(".dialog")), head: rect(ed.querySelector(".ehead")), bar: rect(ed.querySelector(".bar")),
overflow: body.scrollWidth - body.clientWidth,