fix: numeric input + non-negative for per-config pricing fields #62

Merged
rcsheets merged 1 commit from fix/admin-form-numeric-pricing into main 2026-05-05 08:42:17 +00:00
Owner

Per-config input_per_mtok / output_per_mtok inputs were type=text
with placeholder examples, parsed via strconv.ParseFloat with the
error silently discarded. Locale-y input like "3,00" or a typo would
just blank the field with no feedback to the operator.

Switch the two pricing fields (in both the create and edit forms)
to type=number step=0.0001 min=0, which lets the browser reject
non-numeric input and negative values before submit. Server-side
ParseFloat failures still log a Warn line — same semantics as
before, just no longer mute, in case a non-browser client posts
malformed data.

Temperature stays type=text since it has its own existing range
copy and isn't part of the spend rollup; revisit separately if
desired.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Per-config input_per_mtok / output_per_mtok inputs were type=text with placeholder examples, parsed via strconv.ParseFloat with the error silently discarded. Locale-y input like "3,00" or a typo would just blank the field with no feedback to the operator. Switch the two pricing fields (in both the create and edit forms) to type=number step=0.0001 min=0, which lets the browser reject non-numeric input and negative values before submit. Server-side ParseFloat failures still log a Warn line — same semantics as before, just no longer mute, in case a non-browser client posts malformed data. Temperature stays type=text since it has its own existing range copy and isn't part of the spend rollup; revisit separately if desired. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fix: numeric input + non-negative for per-config pricing fields
Some checks failed
ci / check (pull_request) Has been cancelled
5055b01d1e
Per-config input_per_mtok / output_per_mtok inputs were type=text
with placeholder examples, parsed via strconv.ParseFloat with the
error silently discarded. Locale-y input like "3,00" or a typo would
just blank the field with no feedback to the operator.

Switch the two pricing fields (in both the create and edit forms)
to type=number step=0.0001 min=0, which lets the browser reject
non-numeric input and negative values before submit. Server-side
ParseFloat failures still log a Warn line — same semantics as
before, just no longer mute, in case a non-browser client posts
malformed data.

Temperature stays type=text since it has its own existing range
copy and isn't part of the spend rollup; revisit separately if
desired.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator

Automated review by pr-reviewer v0.28.0 | Safety Check | Claude Sonnet 4 | tracking id r-f9ac62-5fe0ee
This is an AI-genrated review and may contain mistakes.

Status: Pending


Running a quick safety check on this PR using Claude Sonnet 4. This is just a sanity check — for a full review, assign me as a reviewer or comment @pr-reviewer-bot review.

*Automated review by [pr-reviewer](https://git.brooktrails.org/brooktrails/pr-reviewer) v0.28.0 | Safety Check | Claude Sonnet 4 | tracking id `r-f9ac62-5fe0ee`* *This is an AI-genrated review and may contain mistakes.* **Status:** ⏳ Pending --- Running a quick **safety check** on this PR using `Claude Sonnet 4`. This is just a sanity check — for a full review, assign me as a reviewer or comment `@pr-reviewer-bot review`.
rcsheets force-pushed fix/admin-form-numeric-pricing from 5055b01d1e
Some checks failed
ci / check (pull_request) Has been cancelled
to 33e6ce4aa4
All checks were successful
ci / check (pull_request) Successful in 43s
2026-05-05 08:38:23 +00:00
Compare
rcsheets deleted branch fix/admin-form-numeric-pricing 2026-05-05 08:43:37 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
brooktrails/pr-reviewer!62
No description provided.