Answer the review (Claude Fable 5.1); estilo 846b397
- estilo's busy.js now holds only a submit with a spinner showing (rastrillo discussion 51), so script submits no longer stall. - Scripts that submit on the visitor's behalf pass the form's button, so it shows the spinner (Calendar quick-add, Sheets file drop). - Slides' presenter Next/Previous/Blackout opt out (data-busy="false"): a live talk wants those instant. Memoria's old vendoring tool no longer writes rastrillo.js, which would bring the old busy rule back.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 files changed,
+14
−6
go.mod+1 −1go.sum+2 −0internal/calendar/static/busy.js+7 −2internal/calendar/static/quickadd.js+4 −3
CI passed — run details
CI log
=== vet === go vet ./... go: downloading amadan.net/oficina/estilo.git v0.0.0-20260929165053-846b39772f3c === fmt === === test === go test ./... ? amadan.net/oficina/calendar/cmd/calendar [no test files] ok amadan.net/oficina/calendar/internal/calendar 4.534s ? amadan.net/oficina/calendar/internal/calendar/icons [no test files] ? amadan.net/oficina/calendar/internal/calendar/seal [no test files] ok amadan.net/oficina/calendar/internal/calendartest 1.976s ok amadan.net/oficina/calendar/internal/guardstest 0.039s ? amadan.net/oficina/calendar/scripts/writeestilo [no test files] === migration-check === go run github.com/carlosframework/rastrillo/cmd/rastrillo migration check rastrillo migration check: models and migrations agree
diff --git a/go.mod b/go.mod| index 3736469..3708041 100644 |
| --- a/go.mod |
| +++ b/go.mod |
| @@ -14,7 +14,7 @@ require ( |
| gorm.io/gorm v1.31.2 |
| ) |
| -require amadan.net/oficina/estilo.git v0.0.0-20260929095838-0994675f496e |
| +require amadan.net/oficina/estilo.git v0.0.0-20260929165053-846b39772f3c |
| require ( |
| github.com/BurntSushi/toml v1.6.0 // indirect |
diff --git a/go.sum b/go.sum| index 0637c45..3d04629 100644 |
| --- a/go.sum |
| +++ b/go.sum |
| @@ -6,6 +6,8 @@ amadan.net/oficina/estilo.git v0.0.0-20260929095046-d0664ee49914 h1:V0AyxXYCxqGZ |
| amadan.net/oficina/estilo.git v0.0.0-20260929095046-d0664ee49914/go.mod h1:4u0jNBtIdMLOsJyrScfqoEuYDJF7BBM3qM9YWbzt6aw= |
| amadan.net/oficina/estilo.git v0.0.0-20260929095838-0994675f496e h1:LTSmIWUS8RjPb6m94Ynf7moyFYeBXr08rdOr3nmNqvg= |
| amadan.net/oficina/estilo.git v0.0.0-20260929095838-0994675f496e/go.mod h1:4u0jNBtIdMLOsJyrScfqoEuYDJF7BBM3qM9YWbzt6aw= |
| +amadan.net/oficina/estilo.git v0.0.0-20260929165053-846b39772f3c h1:YYocIz3r3b4oIA0K/58JkSsmyTOCzMT/2GaW/MFbbPo= |
| +amadan.net/oficina/estilo.git v0.0.0-20260929165053-846b39772f3c/go.mod h1:4u0jNBtIdMLOsJyrScfqoEuYDJF7BBM3qM9YWbzt6aw= |
| amadan.net/oficina/home/connect v0.0.0-20260910000424-5b8d8410775f h1:lkw3tjzHfZxe74pNfo+tGDz4mkZLg+D6R+FTkmsym6M= |
| amadan.net/oficina/home/connect v0.0.0-20260910000424-5b8d8410775f/go.mod h1:YroavXe43Wietec+po8mtSk4a9Bir2h31Q3iAf4MWxI= |
| amadan.net/oficina/home/handoff v0.0.0-20260908102137-481d2d57f489 h1:RPKtyry/71i06o8L+gjAaUyexbmG56kO1YPs601URAM= |
diff --git a/internal/calendar/static/busy.js b/internal/calendar/static/busy.js| index 5d0a9f8..550a843 100644 |
| --- a/internal/calendar/static/busy.js |
| +++ b/internal/calendar/static/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/internal/calendar/static/quickadd.js b/internal/calendar/static/quickadd.js| index 2d38281..099ba7e 100644 |
| --- a/internal/calendar/static/quickadd.js |
| +++ b/internal/calendar/static/quickadd.js |
| @@ -114,12 +114,13 @@ |
| var form = root.querySelector("[cal-quick-form]"); |
| if (!form) return; |
| // requestSubmit fires submit handlers and honours validation the |
| - // way a real button press does; form.submit() skips both. |
| + // way a real button press does; form.submit() skips both. The |
| + // button goes with it, so the busy rule shows its spinner on Add. |
| + var button = form.querySelector("button[type=submit]"); |
| if (typeof form.requestSubmit === "function") { |
| - form.requestSubmit(); |
| + form.requestSubmit(button || undefined); |
| return; |
| } |
| - var button = form.querySelector("button[type=submit]"); |
| if (button) button.click(); |
| } |