From 57c0895063317649f1f76f2add18183798e71bbb Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Mon, 17 Aug 2026 20:35:49 +0200 Subject: [PATCH] fix(admin-ui): make Migration tab action buttons consistently reachable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up on #621: the Reboot Speaker button (plus Revert to Defaults, Enable SSH, Disable SSH) was reachable only after expanding the collapsed "Customize this migration" section and scrolling past three fieldsets and the XML/telnet diff panes. Meanwhile every other real action elsewhere in the admin UI (Save Settings, Apply Suggested Plan, Start Sync, ...) is visible by default. - Move Revert to Defaults and Reboot Speaker into an always-visible "Speaker controls" row directly under the Migration State card. - Move Enable/Disable SSH into the Preconditions table, inline with the SSH (remote_services) status row, sized like the existing "Trust CA Now" button next to the CA/TLS row. script.js now only rewrites the inner status span on re-render (matching the CA/TLS pattern) so the buttons survive summary refreshes. - Add shared .btn-primary/.btn-danger CSS classes so button color consistently means the same thing everywhere (primary = confirm, danger = destructive) instead of ad-hoc inline colors; applied to Save Settings, Apply Suggested/Custom Plan, Enable/Disable SSH, Revert to Defaults, and Trust CA Now. Removed decorative gray from Reboot Speaker and the connection/DNS test buttons. - Replace the "Cancel" button (which only hid the whole summary panel, not any of the actions it sat beside) with a "✕ Hide" control next to the "Migration Summary for " heading, alongside a new "↻ Reload" shortcut for refreshSummary(). - Remove the now-unneeded force-open-the-details hack in migrate() since Reboot no longer lives inside any collapsed container. Co-Authored-By: Claude Sonnet 5 --- pkg/service/handlers/web/css/style.css | 14 +++ pkg/service/handlers/web/index.html | 158 +++++++++++-------------- pkg/service/handlers/web/js/script.js | 22 ++-- 3 files changed, 97 insertions(+), 97 deletions(-) diff --git a/pkg/service/handlers/web/css/style.css b/pkg/service/handlers/web/css/style.css index 46eb479..fa00691 100644 --- a/pkg/service/handlers/web/css/style.css +++ b/pkg/service/handlers/web/css/style.css @@ -129,6 +129,20 @@ pre { background-color: #eee; padding: 10px; overflow-x: auto; font-size: 12px; background-color: #d32f2f; } +/* .btn-primary marks the one "do the thing" confirm action of a panel + (Save Settings, Apply Suggested/Custom Plan, Enable SSH, …). Everything + else stays the plain default button so color consistently signals the + same two meanings everywhere: primary = confirm, danger = destructive. */ +.btn-primary { + background-color: #2196f3; + color: white; + border: none; + padding: 5px 10px; +} +.btn-primary:hover { + background-color: #1769aa; +} + .badge { padding: 2px 6px; border-radius: 4px; diff --git a/pkg/service/handlers/web/index.html b/pkg/service/handlers/web/index.html index bbae33a..27004a7 100644 --- a/pkg/service/handlers/web/index.html +++ b/pkg/service/handlers/web/index.html @@ -533,7 +533,7 @@
- + -

- Migration Summary for - +

+ + Migration Summary for + + + + + +

Migration Status:

@@ -739,7 +757,8 @@ SSH (remote_services) - + + + + + + + Account paired @@ -775,6 +811,30 @@
+ +
+

Speaker controls

+
+ + +
+
+ @@ -819,25 +879,13 @@
@@ -879,13 +927,7 @@
@@ -1067,6 +1109,7 @@ @@ -1150,8 +1193,9 @@
@@ -1236,64 +1280,6 @@
-
- - - - - -
diff --git a/pkg/service/handlers/web/js/script.js b/pkg/service/handlers/web/js/script.js index d6886b9..ed71b8e 100644 --- a/pkg/service/handlers/web/js/script.js +++ b/pkg/service/handlers/web/js/script.js @@ -2558,18 +2558,15 @@ async function migrate(deviceId, ip, method) { }), ); - // Make reboot button available and prominent + // Make reboot button available and prominent. It lives in the + // always-visible "Speaker controls" row (see #621 — it used to + // be reachable only after expanding "Customize this migration"), + // so no need to force any collapsed container open here. const rebootBtn = document.getElementById("reboot-speaker-btn"); rebootBtn.style.display = "inline-block"; rebootBtn.disabled = false; rebootBtn.style.border = "2px solid #000"; - // The Reboot button now lives inside the "Customize this - // migration"
; expand it so the post-migration - // reboot affordance is reachable from the Plan flow too. - const customize = rebootBtn.closest("details"); - if (customize) customize.open = true; - // Re-show summary but with prominence on reboot summaryDiv.style.display = "block"; } else { @@ -3915,11 +3912,14 @@ function renderMigrationState(summary) { } // --- Preconditions --- - const remoteCell = document.getElementById("state-remote-services-cell"); - if (remoteCell) { - remoteCell.replaceChildren(); + // Like CA/TLS above, the cell also hosts the Enable/Disable SSH + // buttons as siblings of this line — only rewrite the verdict span so + // they stay put across re-renders. + const remoteLine = document.getElementById("state-remote-services-line"); + if (remoteLine) { + remoteLine.replaceChildren(); const v = remoteServicesVerdict(summary); - remoteCell.appendChild(stateLine(v.icon, v.text, v.note)); + remoteLine.appendChild(stateLine(v.icon, v.text, v.note)); } const pairedCell = document.getElementById("state-paired");