Skip to content

Declare typed Stimulus values for chart parameters - #3168

Merged
tabuna merged 1 commit into
masterfrom
fix/chart-typed-values
Oct 22, 2026
Merged

tabuna merged 1 commit into
masterfrom
fix/chart-typed-values

Conversation

@tabuna

@tabuna tabuna commented Oct 22, 2026

Copy link
Copy Markdown
Member

The chart controller hid its entire contract in a single config: Object value. Stimulus could not decode individual options, expose their presence, or apply the Platform defaults independently.

Replace it with explicit typed Stimulus Values for every supported chart parameter. Declare the existing line/250 defaults and require labels/datasets attributes. Preserve optional library defaults through has…Value checks. Choose the chart builder with an explicit switch and call its known methods directly.

Render separate escaped HTML attributes from PHP. Transport gradients as a Boolean and optional numeric opacity endpoints. Validate PHP option types and gradient endpoints before Stimulus can coerce them. Keep dataset, marker and region records as Array values, with nested data validated by the charts library.

Validation: 17 real-Stimulus integration tests; 718 PHP tests with 2637 assertions; Pint and Prettier; production JS build with matching manifest integrity. Chromium with the actual charts package verified typed data updates, target removal/restoration and reconnect without errors. Independent review returned PASS+NOTES. No unrelated local working files were modified.

@tabuna
tabuna merged commit ec7d7b9 into master Oct 22, 2026
58 of 64 checks passed
@tabuna
tabuna deleted the fix/chart-typed-values branch October 22, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant