Merge branch 'busy-recopy' into main
busy: re-copy busy.js from rastrillo eda484d (hold only with a spinner)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+11
−6
busy/busy.js+7 −2busy/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.005s ok amadan.net/oficina/estilo.git/brand 0.005s ok amadan.net/oficina/estilo.git/busy 0.004s ok amadan.net/oficina/estilo.git/callui 0.004s ok amadan.net/oficina/estilo.git/chrome 0.180s ? amadan.net/oficina/estilo.git/cmd/oficina-notices [no test files] ok amadan.net/oficina/estilo.git/credits 0.013s ok amadan.net/oficina/estilo.git/credits/catalog 0.009s ok amadan.net/oficina/estilo.git/homeconnect 0.010s ok amadan.net/oficina/estilo.git/internal/lint 0.008s ? amadan.net/oficina/estilo.git/internal/tokencheck [no test files] ok amadan.net/oficina/estilo.git/menu 0.010s ok amadan.net/oficina/estilo.git/savestatus 0.089s ok amadan.net/oficina/estilo.git/sky 0.027s 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)", |