Skip to content

feat(site): clarify that chat costs are estimates - #32415

Merged
tracyjohnsonux merged 3 commits into
mainfrom
chat-cost-estimate-tooltip
Nov 19, 2026
Merged

tracyjohnsonux merged 3 commits into
mainfrom
chat-cost-estimate-tooltip

Conversation

@tracyjohnsonux

@tracyjohnsonux tracyjohnsonux commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Removes any odd cost message that appears below the $. Adds an icon with a tooltip next to chat cost in the chat summary panel and the project chats list, so users know the figure is provisional while agents run (DES-22256). Also provides context if model costs aren't configured correctly.

  • Info icon: "Estimated. Updates in increments and may lag slightly."
  • Warning icon, when some requests have no configured pricing: "3 requests used a model without configured pricing, so cost may be underreported." This replaces the "Excludes unpriced usage from N requests" line under the cost in the summary panel.

In the project chats list, the cost badge and PR icon move out of the row link, because the tooltip trigger is a button and can't sit inside an anchor. The rest of the row still opens the chat.

Preview in Storybook: ChatSummary > Cost Estimate Tooltip / Partial Cost Tooltip, and ProjectChatsListView > Populated / Partial Cost.

Decision log
  • One shared ChatCostTooltip built on InfoTooltip, used in both places. The warning variant replaces the info variant rather than appearing alongside it.
  • Icons use a new xsmall (10px) InfoTooltip size. Each message has a max width (max-w-48 for the estimate, max-w-68 for the warning, which stays on two lines for counts up to four digits) so it wraps into two even lines. Text style matches other tooltips (Geist 12px/500).
  • Tooltips open on top, matching the default and most common placement in AgentsPage.
  • In the list, the icon sits inside the cost badge. Badge gives svgs py-0.5 at size-icon-xs, which shrank the glyph and left extra space on the right. The badge now uses svgSize={null} and [&_svg]:p-0, so the icon renders at its own size and the padding is even on both sides.
  • The amount uses text-box: trim-both cap alphabetic so items-center centers the digits instead of the font's line box. The digits sit 0.375px below center (previously 0.625px above). Chromium snaps baselines to whole pixels, so this is the closest it can get. Browsers without text-box support render as before.
  • The warning copy names a request count, not "this model", because a chat tree's cost can span several models through subagents. The chat overview card's own "Excludes unpriced usage" subtitle is unchanged in this PR.
  • The project list test no longer asserts that the cost text is part of the link name, since the cost is now outside the link.

Generated by Coder Agents on behalf of @tracyjohnsonux.

image image image image

Add an info or warning icon with a tooltip next to chat cost in the chat summary panel and the project chats list.
export type InfoTooltipType = "info" | "warning";

type InfoTooltipSize = "small" | "medium";
type InfoTooltipSize = "xsmall" | "small" | "medium";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: weird that this is xsmall instead of xs, small instead of sm, etc 🤨

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, InfoTooltip is the only component using long names (Badge, Button, Loader use sm/md). I kept xsmall here to match its existing sizes and will rename all of them to xs/sm/md in a separate PR so this one stays focused.

Generated by Coder Agents on behalf of @tracyjohnsonux.

@tracyjohnsonux
tracyjohnsonux merged commit 72a36f2 into main Nov 19, 2026
45 checks passed
@tracyjohnsonux
tracyjohnsonux deleted the chat-cost-estimate-tooltip branch November 19, 2026 00:34
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 19, 2026

This branch had an error being deployed

1 failed and 1 inactive deployments
docs-preview — 6039c162 Deployed Nov 19, 2026 by tracyjohnsonux via cleanup #237
main — 6039c162 Deployed Nov 19, 2026 by tracyjohnsonux via cla #259984
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants