From 52bc7066db7329f210628cdb47af50f7233368af Mon Sep 17 00:00:00 2001 From: Scarriffle Date: Mon, 6 Jul 2026 22:16:10 +0200 Subject: [PATCH] =?UTF-8?q?fix(web):=20settings=20modal=20=E2=80=94=20tabl?= =?UTF-8?q?e=20crash,=20tab=20restore,=20checkbox=20layout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three separate settings bugs (all pre-existing, exposed once the modal actually opened): 1. renderCalendarTable() referenced a bare `owned` variable (undefined in that scope; should be cal.owned) → ReferenceError on the first owned local calendar → renderAllAccounts threw → the calendar table never rendered. This was the ROOT cause of "settings won't open" (it threw out of openSettingsModal); the earlier try/catch only masked it. Fixed to cal.owned. 2. On reload, writeUrlState() (via fetchAndRender) ran before openSettingsModal activated the saved tab and wrote the HTML-default (Profile) tab into the URL, so every reload landed on Profile. Now the stab is only rewritten once the modal is actually shown; otherwise the saved one is preserved. 3. The directory-hidden checkbox label inherited the global ".form-group label" uppercase/spaced/12px styling, stretching the text into a broken column. A higher-specificity .checkbox-row rule restores normal inline layout. v77. Co-Authored-By: Claude Opus 4.8 --- frontend/css/app.css | 12 ++++++++++-- frontend/js/calendar.js | 17 ++++++++++++++--- frontend/js/version.js | 2 +- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/frontend/css/app.css b/frontend/css/app.css index 7dcbab3..a076b10 100644 --- a/frontend/css/app.css +++ b/frontend/css/app.css @@ -2015,8 +2015,16 @@ a { color: var(--primary); text-decoration: none; } padding-top: 14px; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; } -.checkbox-row { display: flex; align-items: center; gap: 8px; cursor: pointer; } -.checkbox-row input[type=checkbox] { flex-shrink: 0; } +/* Higher specificity than the global ".form-group label" (uppercase / spaced / + 12px) so a checkbox label reads as normal inline text next to its box, not a + stretched uppercase column. */ +.form-group label.checkbox-row, +.checkbox-row { + display: flex; align-items: center; justify-content: flex-start; gap: 8px; + cursor: pointer; text-transform: none; letter-spacing: normal; + font-size: 14px; font-weight: 400; color: var(--text-1); +} +.checkbox-row input[type=checkbox] { flex-shrink: 0; margin: 0; } /* .popup-creator styling moved into the .popup-row / #popup-creator rules above. */ /* ── Groups ─────────────────────────────────────────────────── */ diff --git a/frontend/js/calendar.js b/frontend/js/calendar.js index ba09769..a2c54de 100644 --- a/frontend/js/calendar.js +++ b/frontend/js/calendar.js @@ -91,8 +91,19 @@ function writeUrlState() { let newHash = `date=${dateStr}&view=${state.currentView}`; if (uiSettingsOpen) { newHash += '&settings=1'; - const activeTab = document.querySelector('.settings-nav-btn.active'); - if (activeTab) newHash += `&stab=${activeTab.dataset.panel}`; + // Only read the active tab once the modal is actually shown. On an initial + // reload, writeUrlState() runs (via fetchAndRender) BEFORE openSettingsModal + // has activated the saved tab, and the HTML-default (Profile) tab is still + // marked active — writing it would clobber the saved stab and always send + // the user to Profile. In that window, keep the stab already in the URL. + const modalShown = !document.getElementById('modal-settings')?.classList.contains('hidden'); + const activeTab = modalShown ? document.querySelector('.settings-nav-btn.active') : null; + if (activeTab) { + newHash += `&stab=${activeTab.dataset.panel}`; + } else { + const prev = new URLSearchParams(window.location.hash.replace(/^#/, '')).get('stab'); + if (prev) newHash += `&stab=${prev}`; + } } if (window.location.hash.replace(/^#/,'') !== newHash) { // replaceState statt pushState: prev/next-Klicks sollen nicht jeden @@ -3516,7 +3527,7 @@ function renderCalendarTable() { `; rowCount++; - if (owned && pub) { + if (cal.owned !== false && pub) { rows += `
${t('caldav_published_url')} diff --git a/frontend/js/version.js b/frontend/js/version.js index 9236327..6410feb 100644 --- a/frontend/js/version.js +++ b/frontend/js/version.js @@ -1,2 +1,2 @@ // Increment APP_VERSION with every code change -export const APP_VERSION = 'v76'; +export const APP_VERSION = 'v77';