feat(lib-vuetify): system theme option and assorted small fixes#33
Draft
BatLeDev wants to merge 4 commits into
Draft
feat(lib-vuetify): system theme option and assorted small fixes#33BatLeDev wants to merge 4 commits into
BatLeDev wants to merge 4 commits into
Conversation
The `compiledLayout {locale} options: ...` log was huge because it ran
after `schemaVjsfOpts.ajvOptions = { schemas: otherSchemas }`, which
serialized the entire schema collection. Move the log right after the
`delete schemaVjsfOpts.compName` line, before any mutation of
`schemaVjsfOpts`, matching the pattern used in the `vjsf` section.
…witcher - Admin mode toggle label (fr/en) now starts with a capital letter. - Theme switcher options (default, dark, high contrast, dark and high contrast) now start with a capital letter in both locales. - Drop the dead `darkMode` i18n key from personal-menu (never referenced via t()).
Previously the OS theme preference (prefers-color-scheme, forced-colors) was only consulted once on the very first visit; after that the resolved value was locked in the `theme` cookie and never re-evaluated. On mobile devices that toggle light/dark over the day, the chosen theme could not follow the OS. - Add `'system'` to the `Theme` union and store it explicitly in the cookie. - New `resolveTheme()` helper derives the effective theme via `getDefaultTheme` when the user is on 'system' (or when the cookie is absent, which is now treated as an implicit 'system' choice). - Listen to `prefers-color-scheme` and `forced-colors` matchMedia changes and re-apply the theme reactively while the user is on 'system' — no reload. - Expose a 'system' radio option in the theme-switcher (i18n: Système / System). simple-directory does not read the theme cookie server-side (verified across its api/ and ui/ sources) and reuses lib-vuetify's theme-switcher directly, so the new cookie value is transparently handled there too.
…s forbidden The 403 "switch account" affordance in layout-fetch-error only matched user memberships when their department exactly equalled the resource's `x-owner.department`. A user who only had access at the root of the organization was therefore never offered a switch, even though root access generally grants visibility over department-scoped resources in simple-directory's authz model. - Match the exact department first, then fall back to a root membership of the same organization when the resource lives in a department. - Exclude the current account from candidates so the button is not offered when switching would be a no-op.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A batch of unrelated small fixes plus one feature (system theme support).
feat(lib-vue, lib-vuetify):'system'theme option — the OS theme preference (prefers-color-scheme,forced-colors) was previously consulted only on the very first visit, then locked into thethemecookie and never re-evaluated. Mobile devices that toggle light/dark over the day were stuck on the initial choice.'system'is now an explicit value of theThemeunion, resolved to the actual applied theme via a newresolveTheme()helper. AmatchMedialistener re-applies the theme reactively (no reload) while the user is on'system'. Thetheme-switcherexposes a new "Système" / "System" radio option. Verified thatsimple-directorydoes not read the theme cookie server-side and reuseslib-vuetify's theme-switcher directly, so this new cookie value is transparently handled there too.fix(lib-vuetify): root-of-org switch fallback inlayout-fetch-error— the 403 "switch account" affordance only matched user memberships when their department exactly equalled the resource'sx-owner.department. A user with access only at the root of the organization was never offered a switch, even though root access generally grants visibility over department-scoped resources. The matcher now prefers an exact-department membership and falls back to a root membership of the same org; the current account is excluded from candidates to avoid no-op switches.fix(lib-vuetify): capitalize i18n labels — the "Admin mode" toggle and the fourtheme-switcheroptions (Default/Par défaut,Dark/Sombre,High contrast/Contraste élevé,Dark and high contrast/Sombre et contraste élevé) now start with a capital letter. The deaddarkModekey (never referenced viat()) is dropped frompersonal-menu.fix(types-builder): logcompiledLayoutoptions before attaching schemas — thecompiledLayout {locale} options: ...log was huge because it ran afterschemaVjsfOpts.ajvOptions = { schemas: otherSchemas }, which serialized the entire schema collection. The log is now emitted right afterdelete schemaVjsfOpts.compName, matching the pattern already used in thevjsfsection above it.