feat(ui): format large token counts in billions for readability#6449
Merged
feat(ui): format large token counts in billions for readability#6449
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves token count readability in the Sessions Insights view by introducing a formatting helper that displays values >= 1 billion as billions (B) instead of millions (M).
Changes:
- Added
formatTokenshelper function to handle billion/million formatting with appropriate unit suffixes - Replaced inline token formatting with the new helper function for cleaner, more maintainable code
Display token counts with human-readable units: - >= 1B: '1.23B' - >= 1M: '1.23M' - >= 1K: '1.5K' - < 1K: raw number This improves clarity, e.g., '1234M' now displays as '1.23B'.
076f94e to
1dbc7c2
Compare
The-Best-Codes
approved these changes
Jan 12, 2026
alexhancock
approved these changes
Jan 12, 2026
Collaborator
alexhancock
left a comment
There was a problem hiding this comment.
and now we wait to coin the first 1 trillion token goose user
DOsinga
reviewed
Jan 13, 2026
| {insights?.totalTokens && insights.totalTokens > 0 | ||
| ? `${(insights.totalTokens / 1000000).toFixed(2)}M` | ||
| : '0.00M'} | ||
| {formatTokens(insights?.totalTokens)} |
Collaborator
There was a problem hiding this comment.
you can just use:
Intl.NumberFormat('en', { notation: 'compact', maximumFractionDigits: 2 }).format(insights?.totalTokens)
(possibly with || 0)
Collaborator
Author
There was a problem hiding this comment.
duh, thanks, this is obviously the way! 😄
#6466
zanesq
added a commit
that referenced
this pull request
Jan 13, 2026
…ased * 'main' of github.com:block/goose: (23 commits) Use Intl.NumberFormat for token formatting in SessionsInsights (#6466) feat(ui): format large and small token counts for readability (#6449) fix: apply subrecipes when using slash commands (#6460) Fix: exclude platform_schedule_tool in CLI (#6442) Fix: Small update in how ML-based prompt injection determines final result (#6439) docs: remove SSE transport and rename to Streamable HTTP (#6319) fix: correct Cloudinary extension command and env variable (#6453) fix: add gap between buttons in MacDesktopInstallButtons.js (#6452) refactor: include hidden dotfiles folders in file picker search (#6315) upgraded safe npm packages (#6450) chore(deps): bump react-router and react-router-dom in /ui/desktop (#6408) chore(deps): bump lru from 0.12.5 to 0.16.3 (#6379) chore(deps-dev): bump @modelcontextprotocol/sdk from 1.24.0 to 1.25.2 in /ui/desktop (#6375) fix: inconsistent API url requirement between desktop and CLI versions (#6419) feat(vertexai): Add streaming support (#6409) fix deeplink recipe launch cold start (#6210) Spell check setting (#6446) File bug directly (#6413) fix(cli): incorrect bin name in shell completions (#6444) Use crunchy from crates instead of git fork (#6415) ...
wpfleger96
added a commit
that referenced
this pull request
Jan 13, 2026
* main: (41 commits) Allow customizing the new line keybinding in the CLI (#5956) Ask for permission in the CLI (#6475) docs: add Ralph Loop tutorial for multi-model iterative development (#6455) Remove gitignore fallback from gooseignore docs (#6480) fix: clean up result recording for code mode (#6343) fix(code_execution): handle model quirks with tool calls (#6352) feat(ui): support prefersBorder option for MCP Apps (#6465) fixed line breaks (#6459) Use Intl.NumberFormat for token formatting in SessionsInsights (#6466) feat(ui): format large and small token counts for readability (#6449) fix: apply subrecipes when using slash commands (#6460) Fix: exclude platform_schedule_tool in CLI (#6442) Fix: Small update in how ML-based prompt injection determines final result (#6439) docs: remove SSE transport and rename to Streamable HTTP (#6319) fix: correct Cloudinary extension command and env variable (#6453) fix: add gap between buttons in MacDesktopInstallButtons.js (#6452) refactor: include hidden dotfiles folders in file picker search (#6315) upgraded safe npm packages (#6450) chore(deps): bump react-router and react-router-dom in /ui/desktop (#6408) chore(deps): bump lru from 0.12.5 to 0.16.3 (#6379) ...
lifeizhou-ap
added a commit
that referenced
this pull request
Jan 14, 2026
* main: fix: require auth when running goose on non loopback address (#6478) chore(deps): bump hono from 4.11.3 to 4.11.4 in /ui/desktop (#6485) feat(cli): graceful fallback for keyring failures (#5808) fix: support global .gooseignore and negation patterns (#6157) docs: manual config for jetbrains (#6490) fix: Recipe slash command doesn't work with single optional parameter (#6235) fix(openrouter): Handle Gemini thoughtSignature for tool calls (#6370) docs: fix extensions page (#6484) Allow customizing the new line keybinding in the CLI (#5956) Ask for permission in the CLI (#6475) docs: add Ralph Loop tutorial for multi-model iterative development (#6455) Remove gitignore fallback from gooseignore docs (#6480) fix: clean up result recording for code mode (#6343) fix(code_execution): handle model quirks with tool calls (#6352) feat(ui): support prefersBorder option for MCP Apps (#6465) fixed line breaks (#6459) Use Intl.NumberFormat for token formatting in SessionsInsights (#6466) feat(ui): format large and small token counts for readability (#6449) fix: apply subrecipes when using slash commands (#6460)
fbalicchia
pushed a commit
to fbalicchia/goose
that referenced
this pull request
Jan 23, 2026
…6449) Signed-off-by: fbalicchia <fbalicchia@cuebiq.com>
raj-subhankar
pushed a commit
to raj-subhankar/goose
that referenced
this pull request
Feb 14, 2026
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
Improves the display of token counts in the Sessions Insights view by formatting values with appropriate units (B, M, K) for better readability.
Problem
When token counts exceed 1 billion, displaying them in millions becomes less readable. For example,
1234Mis harder to quickly parse than1.23B.Solution
Added a
formatTokenshelper function that formats token counts with human-readable units:>= 1B:1.23B>= 1M:1.23M>= 1K:1.5K< 1K: raw numberTesting
Manual testing in the Sessions Insights view.