diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.css index bfd71335a..142773084 100644 --- a/internal/gui/assets/app.css +++ b/internal/gui/assets/app.css @@ -2140,6 +2140,10 @@ body.window .profiles.detailed > #save { margin-top: 4px; } the page's foot, and goes with it. The panel's footer is as it was. */ body.window footer.foot { position: fixed; left: 0; bottom: 0; width: 0; height: 0; min-height: 0; padding: 0; overflow: visible; z-index: 21; } body.window .foot .status:not(:empty):not(.lift) { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); max-width: calc(100vw - 32px); font-size: 12.5px; line-height: 16px; font-weight: 500; padding: 3px 10px; border-radius: 11px; background: color-mix(in srgb, currentColor 16%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 30%, transparent), 0 6px 20px rgba(0, 0, 0, .28); animation: fade-in .2s var(--ease); } +/* a passing note over the page's foot takes no clicks, as a toast: a press + on the row under it (the Plugins page's Install at the window's foot) + lands on the row. An error or warning stays selectable, to be copied. */ +body.window .foot .status:not(.err):not(.warn) { pointer-events: none; } .status { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .3s; } .status.ok { color: var(--green); } .status.err { color: var(--red); } diff --git a/internal/gui/tests/window-no-footer.test.cjs b/internal/gui/tests/window-no-footer.test.cjs index 9ebfb3bb8..db71b82dd 100644 --- a/internal/gui/tests/window-no-footer.test.cjs +++ b/internal/gui/tests/window-no-footer.test.cjs @@ -4,7 +4,8 @@ // along the window's foot, and every page stopped above it, its last rows // cut off over a blank bar beside the sidebar. Now a page runs to the // window's foot, and a line said there floats as a pill over it, inside the -// window, and goes. The tray panel's footer, with Quit, is as it was. +// window, and goes. A press under a passing note reaches the page +// (plugin-namesake's Install at the window's foot). The tray panel's footer, with Quit, is as it was. // Both engines, every language, with the sidebar and the header's tabs, // wide and narrow. const assert = require("node:assert/strict"); @@ -77,6 +78,18 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", assert(got.status.left >= 0 && got.status.right <= got.vw && !got.status.cut, `it fits: ${JSON.stringify(got)}`); assert.notEqual(got.status.bg, "rgba(0, 0, 0, 0)", "it has its own ground over the page"); assert(Math.abs(got.view - got.vh) < 1, `saying it doesn't make the page shorter: ${JSON.stringify(got)}`); + // a press where the note is lands on the page under it; an error + // stays on top, to be selected and copied + const hit = () => page.evaluate(() => { + const s = document.querySelector("#status").getBoundingClientRect(); + const e = document.elementFromPoint(s.left + s.width / 2, s.top + s.height / 2); + return !!e && !!e.closest("#status"); + }); + assert(!(await hit()), "a press under a passing note reaches the page"); + await page.evaluate(() => status("x".repeat(300), "ok")); + assert(!(await hit()), "under a long one too"); + await page.evaluate(() => status("failed", "err")); + assert(await hit(), "an error can be selected"); // a plain line too await page.evaluate(() => status("…")); got = await look(page);