Theme switcher groundwork: ThemeVariant field through API + state#7756
Open
renemadsen wants to merge 4 commits intostablefrom
Open
Theme switcher groundwork: ThemeVariant field through API + state#7756renemadsen wants to merge 4 commits intostablefrom
renemadsen wants to merge 4 commits intostablefrom
Conversation
Threads the new EformUser.ThemeVariant field through host API models (UserSettingsModel, UserInfoViewModel) and services (AccountService, AdminService), and adds matching fields/actions/selectors to the Angular auth state. No UI yet — SCSS tokens and picker come next. Also bumps Microting.eFormApi.BasePn to 10.0.18 and Microting.EformAngularFrontendBase to 10.0.22 to pick up the new property and DB migration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate theme.scss and custom component mixins to pure Material 3: drop mat.m2-* typography, palettes and color helpers; use mat.define-theme with brand-family/plain-family; replace the global button border-radius block with mat.button/icon-button/fab-overrides; rewrite text/table/chart/tag/ngx-editor/ngx-gallery/ngx-toastr mixins to read from CSS custom properties instead of M2 theme maps. Prerequisite for introducing per-theme density/shape overrides in the upcoming Workspace theme variant. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Introduce scss/themes/_eform.scss exporting an $eform-tokens map (palette, font families, density, button/icon-button/fab/dialog shapes) and scss/themes/_theme-mixin.scss with apply-theme($tokens, $mode), which builds the M3 theme and emits component overrides from the map. theme.scss becomes an orchestrator calling apply-theme for body.theme-light and body.theme-dark. The previous html-level button overrides and .cdk-overlay-container dialog overrides are removed now that the mixin owns them — single source of truth. Preparation for dropping in a second theme (Workspace) that reuses the same mixin with a different token map. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Introduce scss/themes/_workspace.scss exporting $workspace-tokens (mat.$azure-palette, Google Sans / Roboto family stacks, density -1, dialog 28px, fab 16px, card 16px, chip 8px, button 20px pill). Extend $eform-tokens with card-shape and chip-shape, holding the Material 3 defaults (12px and 8px) so eform renders identically. The apply-theme mixin now emits mat.card-overrides and mat.chips-overrides from these tokens. theme.scss keeps body.theme-light and body.theme-dark as the default eform selectors so today's runtime still works, and adds body.theme-workspace.theme-light / .theme-dark selectors that win on specificity when runtime toggles the class in step 6. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
ThemeVariantto user settings: wired fromEformUser(BasePn10.0.18) through host API models (UserSettingsModel,UserInfoViewModel), services (AccountService,AdminService), and Angular auth state (model, action, reducer, selector)Microting.eFormApi.BasePn10.0.17 → 10.0.18 andMicroting.EformAngularFrontendBase10.0.21 → 10.0.22 to pick up the new property and DB migrationBackground
Part of a larger effort to let users choose between the current eForm look and a Google-Workspace-style theme. The preference is orthogonal to the existing dark-mode toggle (theme × appearance are independent). Design notes in
~/.claude/plans/lexical-frolicking-hollerith.md.Test plan
dotnet build eFormAPI/eFormAPI.sln) — verified locally, 0 errorscd eform-client && npm run build)GET /api/account/user-settingsreturnsthemeVariant: "eform"for existing usersPUT /api/account/user-settingswiththemeVariant: "workspace"persists to DBGET /api/users) includesthemeVariantper user🤖 Generated with Claude Code