Skip to content

[app-hax] Configuration / Localization panel in system-settings dashboard - #824

Merged
btopro merged 1 commit into
masterfrom
feature/localization-settings-panel
Sep 8, 2026
Merged

[app-hax] Configuration / Localization panel in system-settings dashboard#824
btopro merged 1 commit into
masterfrom
feature/localization-settings-panel

Conversation

@btopro

@btopro btopro commented Sep 8, 2026

Copy link
Copy Markdown
Member

Summary

Adds a new Configuration panel to the haxcms-system-settings admin dashboard for the system-wide default language, backed by the v1/configuration/localization API shared by the PHP and NodeJS backends (companion PRs haxtheweb/haxcms-php#624 and haxtheweb/haxcms-nodejs#33).

What's added

  • haxcms-system-settings.js — new configuration panel (panelType: "fields") with a localization section containing a defaultLanguage select offering 32 common BCP-47 tags (matching the backend curated list). Load/save helper methods mirror the existing media panel pattern exactly; the save payload is wrapped as {localizationSettings:{defaultLanguage}}, which the backend resolveLocalizationSettingsPayload handles. The panel is added to the dashboard second-row order. No new CSS — it inherits the DDD-token-based styling (incl. light-dark() dark mode) from the existing panelType: "fields" rendering path.
  • AppHaxBackendAPI.jsgetLocalizationSettings (GET) and saveLocalizationSettings (PATCH) system call aliases, matching the PHP OpenAPI operationIds.

Consistency across repos

  • Field name: defaultLanguage
  • Panel key: configuration / section key: localization
  • API route: v1/configuration/localization (GET → get, PATCH → save)
  • Storage: localization block on _config/config.json (single source of truth)

Validation

  • node -c on both modified files: PASS.
  • No optional chaining (?.); no window references (uses globalThis).
  • No build/ubiquity scripts run; no build/ files modified.
  • DDD / dark-mode compliance: reuses existing token-based panelType: "fields" rendering; no raw hex, inline styles, or Polymer-era constructs introduced.

Refs haxtheweb/issues#2974

Co-Authored-By: Warp agent@warp.dev

Adds a new "Configuration" panel (panelType: "fields") to haxcms-system-
settings for the system-wide default language, backed by the
v1/configuration/localization API (getLocalizationSettings /
saveLocalizationSettingsPatch) shared by the PHP and NodeJS backends.

- haxcms-system-settings.js: new configuration panel with a localization
  section containing a defaultLanguage select (32 BCP-47 tags matching the
  backend curated list). Load/save helpers mirror the existing media panel
  pattern; payload wrapped as {localizationSettings:{defaultLanguage}} which
  the backend resolveLocalizationSettingsPayload handles. Panel added to the
  dashboard second-row order. DDD-token-based styling inherited via the
  existing panelType:"fields" rendering path (light-dark() dark mode); no raw
  hex / inline styles / Polymer-era constructs added.
- AppHaxBackendAPI.js: getLocalizationSettings (GET) and
  saveLocalizationSettings (PATCH) system call aliases, matching the PHP
  OpenAPI operationIds.

Field name (defaultLanguage), panel key (configuration), section key
(localization), and API route (v1/configuration/localization) match the PHP
and NodeJS backends exactly.

Refs haxtheweb/issues#2974

Co-Authored-By: Warp <agent@warp.dev>
Copilot AI lite review requested due to automatic review settings September 8, 2026 15:12
@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
webcomponents Ready Ready Preview Sep 8, 2026 3:13pm UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The new panel and API aliases follow the established media-settings pattern in this codebase and appear internally consistent with the existing simple-fields/HAXFields wiring.

Pull request overview

Adds a new “Configuration” panel to the AppHax system settings dashboard to manage system-wide localization defaults (currently: default language), backed by new AppHaxBackendAPI system-call aliases for the shared v1/configuration/localization API.

Changes:

  • Added getLocalizationSettings (GET) and saveLocalizationSettings (PATCH) system call aliases to AppHaxBackendAPI.
  • Introduced a new configuration admin panel (panelType: fields) with a defaultLanguage select, plus load/save plumbing mirroring the existing media settings flow.
  • Updated dashboard ordering and copy to include the new configuration defaults panel.
File summaries
File Description
elements/app-hax/lib/v2/AppHaxBackendAPI.js Adds localization settings GET/PATCH call aliases used by the admin UI.
elements/app-hax/lib/v2/admin/haxcms-system-settings.js Adds the Configuration panel UI plus normalization + load/save methods for default language settings.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@btopro
btopro merged commit 5792d9a into master Sep 8, 2026
6 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants