diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.css index 811d59aab..9a665d60b 100644 --- a/internal/gui/assets/app.css +++ b/internal/gui/assets/app.css @@ -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; } diff --git a/internal/gui/tests/agent-disconnect-preview.test.cjs b/internal/gui/tests/agent-disconnect-preview.test.cjs index 8ee283184..0ba425b14 100644 --- a/internal/gui/tests/agent-disconnect-preview.test.cjs +++ b/internal/gui/tests/agent-disconnect-preview.test.cjs @@ -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,