oficina / estilo Public

busy: re-copy busy.js — hold only a submit with a spinner showing

rastrillo discussion 51 (Claude Fable 5.1, approve): a script's
requestSubmit() with no submitter, or an opted-out button, is no longer
held 650ms with nothing on screen. The shim and CSS are unchanged; the
prefix's digest moves with the bytes, so browsers fetch the new file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 1e3016efb64fff96daac9fbe680b081e5bfd7c11 parent 0994675
2 files changed, +11 −6
  • busy/busy.js +7 −2
  • busy/provenance.json +4 −4

CI passed — run details

CI log
=== modcache ===
all modules verified
=== vet ===
CGO_ENABLED=0 go vet ./...
=== fmt ===
=== build ===
CGO_ENABLED=0 go build -buildvcs=false ./...
=== go-test ===
CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/estilo.git/base	0.013s
ok  	amadan.net/oficina/estilo.git/brand	0.012s
ok  	amadan.net/oficina/estilo.git/busy	0.006s
ok  	amadan.net/oficina/estilo.git/callui	0.012s
ok  	amadan.net/oficina/estilo.git/chrome	0.197s
?   	amadan.net/oficina/estilo.git/cmd/oficina-notices	[no test files]
ok  	amadan.net/oficina/estilo.git/credits	0.006s
ok  	amadan.net/oficina/estilo.git/credits/catalog	0.005s
ok  	amadan.net/oficina/estilo.git/homeconnect	0.009s
ok  	amadan.net/oficina/estilo.git/internal/lint	0.009s
?   	amadan.net/oficina/estilo.git/internal/tokencheck	[no test files]
ok  	amadan.net/oficina/estilo.git/menu	0.011s
ok  	amadan.net/oficina/estilo.git/savestatus	0.093s
ok  	amadan.net/oficina/estilo.git/sky	0.026s
ok  	amadan.net/oficina/estilo.git/theme	0.008s
diff --git a/busy/busy.js b/busy/busy.js
index 5d0a9f8..550a843 100644
--- a/busy/busy.js
+++ b/busy/busy.js
@@ -166,7 +166,7 @@
// back); so does the guard's own refusal of a second submit. Only a
// submit nobody else stopped is held, and only if the busy rule armed
// it (aria-busy on the form: not opted out, not a dialog, not a new
- // window).
+ // window) and a button is showing the spinner.
var held = new WeakSet(); // submit events this listener cancelled
var pending = new Map(); // form -> timer, for a hold still running
var releasing = null; // the form whose held submit is going now
@@ -175,9 +175,14 @@
if (!form || form.tagName !== "FORM") return;
if (form === releasing) { releasing = null; return; }
if (e.defaultPrevented || form.getAttribute("aria-busy") !== "true") return;
+ // Only a submit with a spinner to show is held: the hold is for the
+ // spinner. A script's requestSubmit() with no submitter, or a button
+ // that opted out, has nothing on screen to keep up, and holding it
+ // would only be a silent 650ms stall. The form is still guarded.
+ var btn = e.submitter || null;
+ if (!btn || btn.getAttribute("aria-busy") !== "true") return;
e.preventDefault();
held.add(e);
- var btn = e.submitter || null;
pending.set(form, setTimeout(function () { release(form, btn); }, HOLD_MS));
});
diff --git a/busy/provenance.json b/busy/provenance.json
index f438b33..9bfdbe7 100644
--- a/busy/provenance.json
+++ b/busy/provenance.json
@@ -1,7 +1,7 @@
{
"repository": "https://amadan.net/rastrillo/rastrillo",
- "commit": "a37bfd179cdeadd731e37f75dd2297d9dabe387a",
- "note": "rastrillo main, the merge of busy-min-duration (discussion 50)",
+ "commit": "eda484d4822c5a954b68411375075552c9aeda3e",
+ "note": "rastrillo main, after busy-hold-needs-a-button (discussion 51)",
"files": {
"rastrillo.js": {
"from": "ui/rastrillo.js",
@@ -10,8 +10,8 @@
},
"busy.js": {
"from": "ui/busy.js",
- "sha256": "5894d72db12e143ab569150794fdf7beacec8dda523623e8caeebd949f5c9c06",
- "bytes": 12130
+ "sha256": "b5be5c1c7239b066ec5d13e0c9a21a06c7c7a448542dc7d664a989f4589bae02",
+ "bytes": 12521
},
"busy.css": {
"from": "ui/tokens.css (the block beginning \"With no busy label there are no words to show\", lines 333-374, after a four-line header)",