fix(usage): reduce price input step to 0.0001 for sub-cent precision (#2793)

The step was 0.01, preventing input of prices like DeepSeek's cache read
cost ($0.0028/million tokens). Extract step value to a constant and apply
to all four price fields.

Closes #2503
This commit is contained in:
Roger Deng
2026-05-18 11:38:32 +08:00
committed by GitHub
parent 5ae9c2605d
commit 6e8ee094f1
2 changed files with 99 additions and 4 deletions
+6 -4
View File
@@ -16,6 +16,8 @@ interface PricingEditModalProps {
onClose: () => void;
}
const PRICE_INPUT_STEP = "0.0001";
export function PricingEditModal({
open,
model,
@@ -151,7 +153,7 @@ export function PricingEditModal({
<Input
id="inputCost"
type="number"
step="0.01"
step={PRICE_INPUT_STEP}
min="0"
value={formData.inputCost}
onChange={(e) =>
@@ -168,7 +170,7 @@ export function PricingEditModal({
<Input
id="outputCost"
type="number"
step="0.01"
step={PRICE_INPUT_STEP}
min="0"
value={formData.outputCost}
onChange={(e) =>
@@ -188,7 +190,7 @@ export function PricingEditModal({
<Input
id="cacheReadCost"
type="number"
step="0.01"
step={PRICE_INPUT_STEP}
min="0"
value={formData.cacheReadCost}
onChange={(e) =>
@@ -208,7 +210,7 @@ export function PricingEditModal({
<Input
id="cacheCreationCost"
type="number"
step="0.01"
step={PRICE_INPUT_STEP}
min="0"
value={formData.cacheCreationCost}
onChange={(e) =>