fix(ui): stop the English admin models header from asserting a currency - #169
Merged
Merged
Conversation
The English column headers admin.models.col.in/out read "Input $" / "Output $",
but the values rendered underneath are each model's price in its OWN currency
(raw input_per_m/output_per_m, unconverted) and the table marks the currency
nowhere. config.toml ships a mixed catalog (10 CNY + 4 USD models), so the $
was simply wrong for the CNY rows — and it was wrong from the day it was added:
the commit that introduced it already had 3 CNY vs 7 USD models.
The Chinese source text (输入价/输出价) asserts no currency, as does the
prototype, so this is a translation-introduced defect: drop the symbol and align
the wording with the sibling form labels ("Input price" / "Output price").
English values only — the zh pack is byte-identical, and no key changed.
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.
Summary
The English column headers in the admin model management table read
Input $/Output $. The values rendered underneath are each model's price in its own currency —renderAdminModels()printsm.input_per_m/m.output_per_mraw, unconverted, in raw units — and the table marks the currency nowhere.config/config.tomlships a mixed catalog (10 CNY + 4 USD models), so the$was simply wrong for the CNY rows:deepseek-v4-flashrendered as1.5under anInput $header is not 1.5 dollars.It was wrong from the day it was added:
git log -S'"Input $"'→98a7a9b(PR #97, the commit that introduced this table), whosedata/models.example.jsonalready carried 3 CNY vs 7 USD models.The Chinese source text —
admin.models.col.in/out=输入价/输出价, and the prototype header — asserts no currency. The$exists only in the English translation of the header (it is the only currency symbol in the whole 775-key pack), so this is a translation-introduced defect rather than a currency-modelling one: the fix is to stop asserting a currency, not to change how currencies are stored.Scope: English values only, 2 keys, wording aligned with the sibling form labels (
admin.models.form.in/out=Input price (/M tokens)). No key added or removed, no code changed, and the zh pack is byte-identical (md5ef2d416b550a47dd97f5f1dbb319bb32before and after).Related Issue
Changes
admin.models.col.in:Input $→Input priceadmin.models.col.out:Output $→Output price?v=20260911-13→?v=20260911-14inui/index.html(5 refs)Tests
cargo test全部通过 — 148 passed / 0 failedcargo fmt --check通过cargo clippy --all-targets无新增 warningi18n gates (values read from the real module's pack objects, not parsed by regex):
Input price/Output price, no$输入价/输出价Runtime A/B (both trees built by one generator; baseline =
git show HEAD:ui/..., fixed = work tree; cache-bust neutralized so it is not a variable). Rendered the admin models table in a headless browser against a stub/api/admin/modelscarrying one CNY and one USD model:Provider, Model, **Input $, Output $**, Context, …Provider, Model, **Input price, Output price**, Context, …deepseek-v4-flash 1.5 4.5/gpt-5.6-sol 5 30$is asserted present in the EN baseline, so "gone after" is not vacuous输入价 / 输出价) and both ZH data rows are byte-identical across trees — only the EN pack movedChecklist
fix/admin-models-currency-header)