fix(web): modal first-click, card order, cache hint

Three dashboard polish fixes:

- `showModal()` was called straight from the htmx response handler, outside
  the user's own click, so the first click on the dialog's Confirm button was
  swallowed while the top-layer/focus handoff settled. Defer it one animation
  frame and focus Confirm, so a single click confirms.
- Reorder the grid so infrastructure health (Host/VMware/Runners/Cache) reads
  before the VM table instead of after it.
- Drop the Maintenance purge-semantics hint duplicated in the Cargo cache
  card; it already sits next to the buttons it describes.
This commit is contained in:
2026-07-25 14:28:48 +02:00
parent d18321d4a0
commit 7218c9b4a2
3 changed files with 23 additions and 14 deletions
+14 -1
View File
@@ -99,7 +99,20 @@
if (dialog.open) {
dialog.close();
}
dialog.showModal();
// showModal() is called here from an htmx response handler, not
// synchronously inside the user's own click -- some browsers then
// swallow the very first click on the dialog's contents (the
// top-layer promotion/focus handoff hasn't settled), so Confirm
// silently does nothing until clicked a second time. One animation
// frame is enough for that to settle; explicitly focusing Confirm
// afterwards makes the browser's hit-testing land on the button.
requestAnimationFrame(function () {
dialog.showModal();
var confirmBtn = dialog.querySelector('button[type="submit"]');
if (confirmBtn) {
confirmBtn.focus();
}
});
}
var cancel = dialog.querySelector("[data-modal-cancel]");
if (cancel) {