Skip to content

FE: runtime per-tenant theming (S8) + react-i18next EN/IT (X2) - #51

Draft
braghettos wants to merge 1 commit into
mainfrom
feat/FE
Draft

FE: runtime per-tenant theming (S8) + react-i18next EN/IT (X2)#51
braghettos wants to merge 1 commit into
mainfrom
feat/FE

Conversation

@braghettos

Copy link
Copy Markdown
Collaborator

Implements FE (tier-a mechanism): S8 per-tenant runtime palette override via ConfigContext → CSS custom properties + antd theme, and X2 react-i18next wiring with EN/IT catalogs, externalized app-chrome strings, and the i18n: key convention for widget CR strings. Includes design scaffolds (docs/ux-scaffolds.md) for per-user dashboard personalization, group-admin params UI, onboarding wizard shell, and a11y audit notes. Ref: braghettos/krateo-acmp#14, braghettos/krateo-acmp#19. Draft for review.

Notes:

  • Everything is config-driven and falls back to built-in defaults when unset (no behavior change for existing installs).
  • Lint, full vitest suite (174 tests incl. 11 new) and production build are green.
  • package-lock.json updated via npm (the Dockerfile path); pnpm-lock.yaml left untouched.

Two engine-level, use-case-agnostic portal mechanisms:

Runtime theming (config.theme):
- config.json gains an optional `theme` section (primaryColor + per-mode
  palette overrides) served through the same ConfigMap-mounted path as the
  login branding — per-install re-branding at runtime, NO rebuild.
- resolvePalette() overlays the built-in tokens; primaryColor rewrites the
  BRAND keys only (semantic status colors stay intact); both the antd theme
  and the :root CSS custom properties re-derive from it, light and dark.
- Built-in tokens remain the referentially-stable fallback when unset.

Internationalization (react-i18next, EN + IT):
- src/i18n: catalogs + init before mount; locale order = user choice
  (persisted) > Org default from config.json (i18n.defaultLocale) >
  browser > EN. Language switcher in the user menu.
- App-chrome strings externalized (theme toggle, user menu, notifications,
  command palette, widget error states).
- Second layer: `i18n:`-prefixed strings in widget CR data resolve against
  the catalogs (deep walk in WidgetRenderer); plain strings pass through
  untouched, unknown keys fall back to the key body. Runtime-extendable
  via i18next.addResourceBundle.

Plus: RuntimeConfigBridge wiring both concerns from the fetched config,
unit tests (palette resolution, widget-string resolution), and docs —
usage (docs/theming-and-i18n.md) + design scaffolds for per-user dashboard
personalization, group-admin params UI, onboarding wizard shell and the
a11y audit loop (docs/ux-scaffolds.md).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@braghettos

Copy link
Copy Markdown
Collaborator Author

Status note (leaving this draft open for its author): the theming half is now superseded — Brand v2 landed on main (src/theme/tokens.ts + src/context/ThemeModeContext.tsx are the active theming), so that part conflicts and would need a rebase-drop. The i18next half is still net-new and salvageable — there is no src/i18n on main and i18next is not in package.json. Flagging so a rebase can drop the theming conflicts and keep the i18n work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant