Avoid NaN numeric field emissions - #9
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
More reviews will be available in 49 minutes and 57 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
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. Comment |
🤖 Augment PR SummarySummary: This PR prevents numeric subfields from emitting Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
| "types:check": "attw --pack . --profile esm-only --no-summary", | ||
| "typecheck": "tsc --noEmit" | ||
| "typecheck": "tsc --noEmit", | ||
| "test": "npm run build && node --test tests/*.test.mjs" |
There was a problem hiding this comment.
| } | ||
| if (target instanceof HTMLInputElement && target.type === "number") { | ||
| return target.value === "" ? undefined : Number(target.value); | ||
| return parseNumericInput(target.value, type === "integer" ? "integer" : "number"); |
There was a problem hiding this comment.
Because parseNumericInput() returns undefined for non-finite/invalid strings, controlled <Input type="number"> edits that temporarily produce values like "-" (common while typing negative numbers) will be normalized to "" and can effectively prevent entering some valid numbers interactively.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Motivation
NaNfor empty, invalid, or non-finite inputs instead of the established empty valueundefined.numberandintegersubfields consistently emitundefinedfor empty/invalid input while preserving valid numeric behavior.Description
parseNumericInput(value: string, type: "number" | "integer")to normalize empty, invalid, non-finite, and non-integer integer inputs toundefinedand return finite numbers otherwise.parseNumericInputinreadInputValuefortype="number"|"integer"subfields and pass the subfieldtypeinto the input change handler.tests/numeric-input.test.mjswith focused Node tests for empty, invalid, integer, decimal, and boundary inputs.npm testscript that builds the package and runs the new numeric parsing tests.Testing
npm testwhich builds the package and executestests/*.test.mjs, all tests passed (4/4).npm run typecheck(tsc --noEmit) which completed with no type errors.Closes #4
Codex Task