mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 00:00:21 +02:00
Keep the toast's fade-in, and join the test's threads on failure
From the review: opening the toast popover with .show already set skipped the fade-in; it now opens hidden and then shows. And the superseded-test test now joins its threads in finally, so a failure can't leave them running into cleanup. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
5b4efc87b3
commit
90034540ae
2 files changed
+8
-2
No files matched your search
@@ -491,6 +491,9 @@ class Connecting(unittest.TestCase):
|
||||
finally:
|
||||
for e in release.values():
|
||||
e.set()
|
||||
for t in tests:
|
||||
if t.ident: # started
|
||||
t.join(10)
|
||||
result = self.link.snapshot()["tests"][d["id"]]
|
||||
self.assertTrue(result["done"])
|
||||
self.assertEqual(result["rows"][0]["detail"], "test 2")
|
||||
|
||||
+5
-2
@@ -1417,13 +1417,16 @@ let toastTimer;
|
||||
function toast(msg, err = false) {
|
||||
const el = $("toast");
|
||||
el.textContent = msg.split("\n").slice(-1)[0] || msg;
|
||||
el.className = "toast show" + (err ? " err" : "");
|
||||
// A popover, so it shows above an open dialog (a modal one covers everything else): opened
|
||||
// again when a dialog has opened since, which puts it back on top.
|
||||
// again when a dialog has opened since, which puts it back on top. Opened hidden first, so
|
||||
// it still fades in.
|
||||
if (el.showPopover && (!el.matches(":popover-open") || document.querySelector("dialog:modal"))) {
|
||||
el.className = "toast" + (err ? " err" : "");
|
||||
try { el.hidePopover(); } catch {}
|
||||
el.showPopover();
|
||||
void el.offsetWidth; // the hidden style is in place before .show changes it
|
||||
}
|
||||
el.className = "toast show" + (err ? " err" : "");
|
||||
clearTimeout(toastTimer);
|
||||
toastTimer = setTimeout(() => el.className = "toast" + (err ? " err" : ""), 3500);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user