feat: add nav bar button to publish pending config changes

Shows an orange "Publish Config" button to the left of the alert-pie
for admin users when there are staged config changes. Uses localStorage
to persist staged changes across page navigations so the button appears
on any page, not just settings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Andreas Wrede
2026-05-12 09:32:32 -04:00
parent 708508157f
commit 59e256a042
3 changed files with 60 additions and 0 deletions
+5
View File
@@ -871,9 +871,13 @@
if (count > 0) {
document.getElementById('pending-count').textContent = count;
banner.style.display = 'flex';
localStorage.setItem('hbd_pending_config', JSON.stringify(_staged));
} else {
banner.style.display = 'none';
localStorage.removeItem('hbd_pending_config');
}
const navBtn = document.getElementById('nav-publish-btn');
if (navBtn) navBtn.style.display = count > 0 ? '' : 'none';
}
function stageFormSection(sectionId, apiSection) {
@@ -1050,6 +1054,7 @@
function discardAll() {
Object.keys(_staged).forEach(k => delete _staged[k]);
localStorage.removeItem('hbd_pending_config');
updatePendingBanner();
window.location.reload();
}