fix: CI lint pin + copilot-thread hardening

The wiring-lint test used percent-formatted regex patterns — UP031 under
the ruff 0.15.6 the CI pre-commit pins (the older venv binary let it
through; checked repo-wide against the exact pin now). f-strings with
doubled quantifier braces, plus one over-long fixture line in the
livepass generator split.

Copilot threads, both validated rather than blindly applied:
- closeShelf's scrim-ownership scan now skips detached entries. The
  thread's throw scenario doesn't occur on the real removal path (a pane
  close detaches an ANCESTOR, so _hostOf still resolves inside the
  detached subtree) — but a detached shelf is genuinely not a scrim
  owner, so the guard is correct beyond being defensive.
- toast.js drops the popover attribute via removeAttribute instead of
  the null assignment. The claim that null leaves popover="null" is
  refuted — the IDL is nullable and null removes the attribute (verified
  empirically in headless Chrome) — but removeAttribute reads correct
  without requiring that spec knowledge.
This commit is contained in:
Patrick Buckley
2026-06-10 13:24:24 -07:00
parent 9102f858a4
commit b991dc2e83
4 changed files with 7 additions and 7 deletions
+2 -1
View File
@@ -194,7 +194,8 @@ UI_TEMPLATE = """<!doctype html>
{
ws_id: "c3d4e5f6a1b2",
title:
"a very long workstream title that should wrap rather than punch out of the dialog box entirely",
"a very long workstream title that should wrap " +
"rather than punch out of the dialog box entirely",
},
]);
c.toggleAll();
+3 -5
View File
@@ -199,19 +199,17 @@ def test_every_hatch_button_is_wired() -> None:
continue
bid = re.escape(idm.group(1))
direct = re.search(
r'getElementById\(\s*"%s"\s*\)[\s\S]{0,120}?\.(?:onclick|addEventListener)'
% bid,
rf'getElementById\(\s*"{bid}"\s*\)[\s\S]{{0,120}}?\.(?:onclick|addEventListener)',
js,
)
wired = bool(direct)
if not wired:
for vm in re.finditer(
r'(?:const|var|let)\s+(\w+)\s*=\s*document\.getElementById\(\s*"%s"\s*\)'
% bid,
rf'(?:const|var|let)\s+(\w+)\s*=\s*document\.getElementById\(\s*"{bid}"\s*\)',
js,
):
var = re.escape(vm.group(1))
if re.search(r"\b%s\s*\.\s*(?:onclick|addEventListener)" % var, js):
if re.search(rf"\b{var}\s*\.\s*(?:onclick|addEventListener)", js):
wired = True
break
assert wired, (
+1
View File
@@ -180,6 +180,7 @@ export function closeShelf(dlg) {
// hide it when no open shelf shares the host.
let hostStillBusy = false;
for (const [other] of _shelfState) {
if (!other.isConnected) continue; // detached with its pane — not an owner
if (state.scrim.parentElement === _hostOf(other)) hostStillBusy = true;
}
if (!hostStillBusy) state.scrim.hidden = true;
+1 -1
View File
@@ -46,7 +46,7 @@ function _displayToast(el, message, type) {
} catch (e) {
/* already hidden */
}
el.popover = null; // restore the classic fade path
el.removeAttribute("popover"); // restore the classic fade path
}
_toastShowing = false;
_toastTimer = null;