gui: a passing note in the main window takes no clicks
Since v0.1.2281 the window's footer takes no room and its status line
floats as a pill 18px over the window's foot, so a row at the page's foot
can sit under it. plugin-namesake's "ja 440" (chromium) pressed Install at
y 832-855 of an 860px window while "...をインストールしました" was showing
(class "status ok lift"), the press landed on the pill and the confirm
never opened: red twice at the v0.1.2281 head, green at its parent.
An ok or plain note in the window now has pointer-events: none, as a
toast: a press under it reaches the page. An error or warning keeps its
clicks, to be selected and copied as before. The panel is unchanged.
Tried first and dropped: 44px of bottom padding on the window's views so
the last row scrolls clear of the pill. It lifts Providers' sticky Add bar
36px off the window's foot (sticky at bottom -8px), so it was taken out.
Run (wsl-run, magpie-desktop, Playwright 1.62.0, chromium + webkit):
- window-no-footer (en, zh, zh-TW, ja, de; 1200/700/390; providers,
settings; panel), plugin-namesake, status-long, panel-open-once:
200 pass, 0 fail.
Broken by hand: the pointer-events rule removed, window-no-footer goes
red in both engines, 60 subtests "a press under a passing note reaches
the page".
Not tried: a real macOS, Windows or Linux app window; the whole GUI suite
at this head (the 22 files red at v0.1.2281 were red the same at its
parent apart from checkin-account, fixed in 11fc687c0, and this one).
This commit is contained in:
@@ -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); }
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user