From 28dd70f61fb5ccacd4340d9e8bc8539f40202c06 Mon Sep 17 00:00:00 2001 From: yetone Date: Tue, 6 Oct 2026 05:41:14 +0800 Subject: [PATCH] =?UTF-8?q?gui:=20a=20dialog's=20fields=20no=20longer=20sc?= =?UTF-8?q?roll=20sideways=20in=20the=20Mac=20app=20when=20the=20dialog=20?= =?UTF-8?q?scrolls=20=E2=80=94=20WebKit=20laid=20a=20framed=20editor's=20g?= =?UTF-8?q?rid=20out=20at=20the=20full=20width=20and=20then=20let=20the=20?= =?UTF-8?q?8px=20Mac=20scrollbar=20(4dab45e3)=20take=20its=20right=20edge,?= =?UTF-8?q?=20so=20a=20disconnect=20preview=20in=20a=20560x420=20window=20?= =?UTF-8?q?ran=208px=20wide;=20the=20bar's=20room=20is=20now=20always=20ke?= =?UTF-8?q?pt,=20taken=20out=20of=20the=20right=20padding,=20so=20fields?= =?UTF-8?q?=20end=20where=20they=20did=20when=20nothing=20scrolls.=20agent?= =?UTF-8?q?-disconnect-preview=20measures=20the=20body's=20content=20box?= =?UTF-8?q?=20up=20to=20the=20scrollbar=20(clientWidth)=20rather=20than=20?= =?UTF-8?q?its=20outer=20edge;=20its=20"no=20horizontal=20overflow"=20chec?= =?UTF-8?q?k=20fails=20in=20WebKit=20without=20the=20fix=20and=20passes=20?= =?UTF-8?q?with=20it=20in=20Chromium=20and=20WebKit,=20en=20and=20zh.=20ac?= =?UTF-8?q?count-arrange,=20editor-short-window,=20models-free-only,=20mod?= =?UTF-8?q?els-fold,=20names-fold,=20plugin-market,=20whats-new,=20old-web?= =?UTF-8?q?kit=20and=20click-scroll=20pass=20in=20both=20(plugin-move=20fa?= =?UTF-8?q?ils=20in=20Chromium=20the=20same=20without=20the=20change).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/gui/assets/app.css | 5 +++++ internal/gui/tests/agent-disconnect-preview.test.cjs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) 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,