feat(ui): honor schema multipleOf as step/decimals on number fields#971
Merged
Conversation
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>
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.
Problem
Number config fields always render with 5 decimal places (e.g.
0.00000).FormNumberInputderives the number of decimals from itsstepprop (decimals = ceil(log10(1/step)), default 5 when no step), butEditControlonly ever passesstepfor theintegercase (hardcodedstep={1}→ 0 decimals). Fortype: "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
EditControlnow reads the schema's standardmultipleOfand passes it assteptoFormNumberInputfor thenumbercase. A field can then declare"multipleOf": 0.1to render one decimal (step 0.1). Fields withoutmultipleOfare unchanged (still the 5-decimal default), so this is backward compatible.Regenerated the embedded frontend bundle (
autogen/frontend_files.h).🤖 Generated with Claude Code