Skip to content

feat(desktop): show session tokens and cost on the session view - #53785

Open
usrnk1 wants to merge 4 commits into
v2from
context-button
Open

usrnk1 wants to merge 4 commits into
v2from
context-button

Conversation

@usrnk1

@usrnk1 usrnk1 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

No linked issue.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

  • Shows compact used tokens and session cost next to the context ring: 101k · $4.55.
  • Hides the cost and dot for free models. Paid models retain $0.00 before usage starts; previous paid session cost stays visible after switching to a free model.
  • Replaces the header's usage breakdown tooltip with “Toggle session context”.
  • Matches the hover and held-press states from the design. Opening Context doesn't leave the button pressed.

Design. Uses the existing usage/cost data and shared button components.

How did you verify your code works?

  • bun run check and bun run lint:changed passed.
  • Verified token/cost formatting, tooltip, click and keyboard toggling in a production build.
  • Production session-switch benchmark passed before and after (3 samples each).
  • Review suite: 19 passed; the image-loading case also fails with the original control on v2.
  • Pricing regression covers free/paid models, paid zero cost, unknown pricing, output-only pricing and mixed-cost sessions; confirmed it fails before the fix. Focused context tests pass.

Screenshots / recordings

Header control

Before After
Before: context ring only After: context ring, used tokens and session cost

Hover tooltip

Before After
Before: usage breakdown tooltip After: Toggle session context tooltip

Context open

The header control keeps its normal appearance while the Context tab is open.

Context open without persistent pressed styling

Free models and paid sessions before usage

Free model Paid model, no usage yet
Free model: usage only Paid model: keep the zero-cost slot

Context control state atlas

All four frames from Paper, documenting current behavior.

Data availability

Context control: data availability

Usage and cost ranges

Context control: usage and cost ranges

Pointer, keyboard and panel states

Context control: pointer, keyboard and panel states

Formats, themes and tab indicator

Context control: formats, themes and tab indicator

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@usrnk1 usrnk1 changed the title feat(desktop): show tokens and cost in context button feat(desktop): show session tokens and cost on the session view Oct 7, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant