From 5799407f5500ad90fa68bb03fbe1568114cc2642 Mon Sep 17 00:00:00 2001 From: r-zakarya <82443831+r-zakarya@users.noreply.github.com> Date: Tue, 21 Jul 2026 19:24:09 +0100 Subject: [PATCH] fix(settings): sync the view-mode toolbar button to the server value on load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit viewMode is a synced setting. On launch localStorage is wiped (ephemeral port = new origin) so state.viewMode defaults to 'cards' and applyViewMode() highlights the cards button. loadServerSettings then set state.viewMode='table' and re-rendered the content (table) but never re-synced the .view-btn highlight or the column-picker — so table content showed under a cards-active toolbar. Re-apply both in the visual-settings block, alongside theme/sidebar. Co-Authored-By: Claude Opus 4.8 --- js/app.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/app.js b/js/app.js index c880877..1e8e944 100644 --- a/js/app.js +++ b/js/app.js @@ -6794,6 +6794,14 @@ async function loadServerSettings() { // Apply visual settings immediately. if (remote.theme) setTheme(remote.theme); if ('sidebarCollapsed' in remote) applySidebarCollapsed(); + // viewMode's active-button highlight + column-picker visibility were + // set once at init from the (port-wiped) localStorage default 'cards'; + // re-sync them to the server value so the toolbar matches the content. + if ('viewMode' in remote) { + $$('.view-btn').forEach(b => + b.classList.toggle('is-active', b.dataset.view === state.viewMode)); + applyColsWrapVisibility(); + } } catch (e) { // Network/server hiccup is harmless — localStorage cache still works. }