fix(frontend): harden font/theme preferences for production edge cases
Edge-case review identified several issues that would degrade UX or silently break under unusual conditions: - Anon settings chosen on the login screen were lost on first login because the storage namespace switched from "anon" to the user id; resolveStorageValue now falls through user -> anon -> legacy, so pre-login choices carry over and v1 unscoped keys are still picked up. - localStorage.setItem can throw under quota / private mode; setters now swallow the error so the UI still updates for the session. - applyFont reduced to String(undefined) when currentSize held an invalid value; runtime fallbacks to the default scale guard against manipulated storage. - Added var(--app-font-scale, 1) defaults to all 32 calc() expressions in theme.css and the body font-size, so a missing variable cannot void the calc() value. - Validation guards in setSansFont / setMonoFont / setFontSize / setTheme reject invalid keys instead of writing them to storage. - GeneralSettings.vue now watches the composable refs so the form stays in sync if preferences change externally (e.g. user switch while on the page). - Dropped the unverified t-radio-group variant prop in favour of the default style. https://claude.ai/code/session_01S1FVPf4jRfWXkTSnpMmMp7
This commit is contained in:
@@ -192,7 +192,7 @@ html,
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: calc(14px * var(--app-font-scale));
|
||||
font-size: calc(14px * var(--app-font-scale, 1));
|
||||
font-family: var(--app-font-family);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
|
||||
Reference in New Issue
Block a user