fix(settings): sync the view-mode toolbar button to the server value on load
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user