🤖 feat: show model pricing on hover in chat-input picker#3366
Open
Neppkun wants to merge 1 commit into
Open
Conversation
Hovering a row in the chat-input model selector now shows a tooltip with the model's pricing (input/output/cache-read/cache-write per 1M tokens), context window, and max output. The pricing body is extracted into a shared ModelPricingTooltip component reused by Settings → Models so the two views stay visually identical.
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
Hovering a model row in the chat-input picker now shows a tooltip with that model's pricing (input / output / cache-read / cache-write per 1M tokens), context window, and max output. No delay — the tooltip appears as soon as the cursor lands on a row.
Background
Users frequently want to know what a model costs before they pick it, but today that info is only available two extra clicks away in Settings → Models. Surfacing it right in the picker turns "switch model" into a decision that includes cost without any context switch.
Implementation
ModelRow.tsxinto a new shared componentModelPricingTooltip(src/browser/components/ModelPricingTooltip/ModelPricingTooltip.tsx). The markup, Tailwind classes, andformatCostPerMillion/formatTokenCounthelpers are moved verbatim so the Settings tooltip is byte-identical to before.ModelSelector.tsxwith a RadixTooltip(delayDuration={0}, portaledTooltipContentonside="right"withcollisionPadding={12}so it flips at the viewport edge). Pricing is looked up inline with the existing pure, renderer-localgetModelStats(model)— no IPC, no prop threading, no async loading.getModelStatsreturnsnull(e.g. Ollama, custom providers with no metadata) the shared component renders the existing "No pricing data available" copy.Net product LoC: roughly +25 (most of the new file is text moved from
ModelRow.tsx).Validation
make typecheck— clean on both project configs.make lint—ESLint checks passed!.bun test src/browser/features/Settings/Sections/— 65 pass / 0 fail (coversModelRowand the suites that mockModelSelector).bun test src/common/utils/tokens/modelStats.test.ts— 19 pass (pricing data layer untouched, sanity check).Risks
Low. The Settings tooltip is the same JSX with the same classes, just imported from a new module; the new picker tooltip is additive and uses the same Radix primitive already in use inside this scrollable list for the Eye/Star buttons. If anything goes wrong the visible blast radius is "tooltip doesn't appear" rather than anything affecting model selection.
Generated with
mux• Model:anthropic:claude-opus-4-7• Thinking:high• Cost:$4.36