Skip to content

feat(ui): honor schema multipleOf as step/decimals on number fields#971

Merged
mairas merged 1 commit into
mainfrom
feat/number-field-decimals
Jun 3, 2026
Merged

feat(ui): honor schema multipleOf as step/decimals on number fields#971
mairas merged 1 commit into
mainfrom
feat/number-field-decimals

Conversation

@mairas

@mairas mairas commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Problem

Number config fields always render with 5 decimal places (e.g. 0.00000). FormNumberInput derives the number of decimals from its step prop (decimals = ceil(log10(1/step)), default 5 when no step), but EditControl only ever passes step for the integer case (hardcoded step={1} → 0 decimals). For type: "number" no step is passed, so it always falls back to 5 decimals. There was no way for a config to request, say, one decimal.

Fix

EditControl now reads the schema's standard multipleOf and passes it as step to FormNumberInput for the number case. A field can then declare "multipleOf": 0.1 to render one decimal (step 0.1). Fields without multipleOf are unchanged (still the 5-decimal default), so this is backward compatible.

Regenerated the embedded frontend bundle (autogen/frontend_files.h).

🤖 Generated with Claude Code

Number config fields always showed 5 decimals because EditControl never
passed a step to FormNumberInput for the number case (only integer got
step=1). Pass the schema's multipleOf through as step, so a field can declare
e.g. multipleOf: 0.1 to render one decimal. Fields without multipleOf are
unchanged. Regenerated the embedded frontend bundle.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mairas mairas merged commit 6222dfe into main Jun 3, 2026
32 of 44 checks passed
@mairas mairas deleted the feat/number-field-decimals branch June 3, 2026 20:17
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