Skip to content

fix(jsonforms-renderers): NumberControl honours minimum, exclusiveMinimum and multipleOf - #119

Merged
ginaxu1 merged 1 commit into
mainfrom
fix/jsonforms-numbercontrol-min-step
Oct 16, 2026
Merged

ginaxu1 merged 1 commit into
mainfrom
fix/jsonforms-numbercontrol-min-step

Conversation

@ginaxu1

@ginaxu1 ginaxu1 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Split out of #112 so release notes can list this separately from the conditional-required asterisk work.

NumberControl reads minimum / exclusiveMinimum / multipleOf for min / step. When the bound is >= 0, it blocks - / + / e / E on keydown and paste. getErrorMessage rewrites exclusiveMinimum / minimum / multipleOf AJV messages into clearer wording.

Type of change

  • Bug fix

Changes made

  • NumberControl: min / step from schema; block signed/exponent keys and pastes when bound >= 0
  • getErrorMessage: clearer exclusiveMinimum / minimum / multipleOf messages
  • Playground number fixture: add an assessedAmount field with exclusiveMinimum: 0 and multipleOf: 0.01

Testing

  • pnpm test in jsonforms-renderers
  • Number fixture: assessed amount rejects - / + / e and shows readable constraint errors

Release notes

Number fields with a minimum/exclusiveMinimum >= 0 no longer accept -, +, e or E, and use min/step from the schema. Error messages now read "X must be greater than 0" instead of "must be > 0".

@ginaxu1 ginaxu1 added Type/Bug Something isn't working as expected Package/jsonforms-renderers Changes to packages/jsonforms-renderers labels Oct 15, 2026
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 072f36d6-16a6-42cd-956c-00b0194527fc
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

sthanikan2000
sthanikan2000 previously approved these changes Oct 16, 2026

@sthanikan2000 sthanikan2000 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Tests pass, and the key/paste test fails when onKeyDown/onPaste are removed, so it pins the behaviour. The release note is accurate.

Merge note: #112 and #119 both add NumberControl.test.tsx, so the second one to merge gets one add/add conflict. Keep main's file and add this PR's it to its describe, using renderForm({ reviewOutcome: 'approve' }). I tried #112 + #117 + #119 together and all 578 tests pass. Suggested order: #112, #117, then #119.

@sthanikan2000
sthanikan2000 force-pushed the fix/jsonforms-numbercontrol-min-step branch from a68d219 to bec063a Compare October 16, 2026 05:28
…leOf

Drive NumberControl min/step from the schema, block signed and exponent keys
when the bound is non-negative, and clarify constraint error messages.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ginaxu1
ginaxu1 force-pushed the fix/jsonforms-numbercontrol-min-step branch from bec063a to ad04c6f Compare October 16, 2026 05:41
@ginaxu1

ginaxu1 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased onto main after #112. PTAL @sthanikan2000

@ginaxu1
ginaxu1 requested a review from sthanikan2000 October 16, 2026 05:49

@sthanikan2000 sthanikan2000 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Re-checked after the rebase onto main. Your conflict resolution matches what I suggested: the test file keeps main's asterisk test and adds the key/paste one. The new afterEach debounce flush looks right. I ran the file five times with no flakiness, and the key/paste test still fails when onKeyDown/onPaste are removed. The full suite passes (586) and type-check is clean. Approving.

@ginaxu1
ginaxu1 merged commit 86f4702 into main Oct 16, 2026
5 checks passed
@ginaxu1
ginaxu1 deleted the fix/jsonforms-numbercontrol-min-step branch October 16, 2026 06:21
@ginaxu1 ginaxu1 self-assigned this Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Package/jsonforms-renderers Changes to packages/jsonforms-renderers Type/Bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants