Skip to content

feat(gui): add cost display badge to Chat UI#12039

Open
roland779 wants to merge 3 commits intocontinuedev:mainfrom
roland779:feature/cost-display-badge
Open

feat(gui): add cost display badge to Chat UI#12039
roland779 wants to merge 3 commits intocontinuedev:mainfrom
roland779:feature/cost-display-badge

Conversation

@roland779
Copy link
Copy Markdown

@roland779 roland779 commented Apr 5, 2026

  • Add CostBadge component that shows total session cost
  • Display cost badge above chat input in compact format
  • Uses existing useTotalUsage hook and calculateRequestCost
  • Color-coded based on cost level (green/yellow/red)

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Summary by cubic

Add a compact cost badge to the Chat UI that shows total session cost, color-coded by spend. It appears above the chat input and hides when cost is $0.

  • New Features
    • Added CostBadge component using useLLMLog and useTotalUsage.
    • Right-aligned badge above the input; minimal UI.
    • Tiered cost formatting for readability; hides at $0.
    • Green/yellow/red coloring based on total cost using VS Code chart colors.

Written for commit 4c805dd. Summary will update on new commits.

- Add CostBadge component that shows total session cost
- Display cost badge above chat input in compact format
- Uses existing useTotalUsage hook and calculateRequestCost
- Color-coded based on cost level (green/yellow/red)
@roland779 roland779 requested a review from a team as a code owner April 5, 2026 08:49
@roland779 roland779 requested review from sestinj and removed request for a team April 5, 2026 08:49
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

@roland779
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@roland779 roland779 marked this pull request as draft April 5, 2026 09:09
@roland779 roland779 marked this pull request as ready for review April 5, 2026 09:11
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Add vscode mock to setupTests.ts to fix 'vscode is not defined' errors in chat tests.
This allows the tests to run without the VS Code extension context.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant