Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software:2222/vole.git

A free and open-source forge that lives in your Git repo.

#71

Show a spinner while a form post is in flight

merged · by keenan 11d ago · merged into main at 3a068983 by keenan 11d ago

keenan opened this 11d ago

Why

Merge and Update base/head both write to the repository and can leave the browser waiting. Without a pending state the button looks idle, so a second click can accidentally run the mutation again. The same applies to other native POST actions that do real server work.

What changed

  • A native POST form disables its submit button(s) as soon as it is submitted, so a second run cannot be triggered.
  • After 150 ms the button icon becomes a spinner, so a fast save does not flash a loader.
  • A cancelled submission restores the buttons, and pageshow restores them after a back/forward-cache restore.
  • GET forms and HTMX forms are left alone; data-no-busy is an escape hatch.
  • This covers Merge, Update base/head, and other native POST actions such as release writes, repository create/rename/delete, settings saves, and opening a change request.

Checks

  • node --check server/web/static/app.js
  • go test ./...
  • ./vole workflow check

Discussion (0)

No discussion yet.