Show context window usage inline in the status bar#7607
Conversation
DOsinga
left a comment
There was a problem hiding this comment.
Resolved merge conflicts with main (which added /// props to ) and fixed a secondary issue: was gating behind , which would hide the alert bell when the token limit wasn't yet known. Now the popover always renders; only the token count text is conditional.
DOsinga
left a comment
There was a problem hiding this comment.
Resolved merge conflicts with main (which added sessionModel/sessionProvider/onModelChanged/sessionLoaded props to ModelsBottomBar) and fixed a secondary issue: ContextWindowIndicator was gating BottomMenuAlertPopover behind the tokenLimit check, which would hide the alert bell when the token limit was not yet known. Now the popover always renders; only the token count text is conditional on tokenLimit > 0.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21aeb1614f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <BottomMenuAlertPopover alerts={alerts} /> | ||
| {tokenLimit > 0 && ( | ||
| <span className={`text-xs font-mono cursor-default ${colorClass}`}> |
There was a problem hiding this comment.
Make context usage text open the alert popover
The new inline usage indicator renders the token text as a passive span (cursor-default) while the popover trigger remains the tiny dot from BottomMenuAlertPopover, so users cannot hover/click the usage text to reach auto-compact settings. In practice this makes the moved controls much harder to discover/use and breaks the intended “usage text is the entry point” interaction for this feature.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
https://github.com/block/goose/blob/66038b331a5c7891d95cdd12ec7470adef6720c5/ui/desktop/src/components/bottom_menu/BottomMenuAlertPopover.tsx#L241
Prevent opening an empty alert popover
Because this component now renders whenever children is present, the trigger is visible even when alerts is empty, but the click/hover handlers still set isOpen unconditionally; that path renders the popover shell with zero AlertBox rows. In practice, users can get a blank floating panel during the initial load window (before the context alert is added) or immediately after clearAlerts(), which is confusing and looks broken.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
66038b3 to
6ff9ee3
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ff9ee3ce1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const stripEmptySlots = (params: Params) => { | ||
| for (const [slot, value] of Object.entries(params)) { | ||
| if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) { | ||
| if (value && typeof value === 'object' && !Object.keys(value).length) { |
There was a problem hiding this comment.
Preserve empty array request bodies in param cleanup
stripEmptySlots now deletes any empty object-like value, but arrays are objects with zero keys when empty, so a valid body like [] gets removed from the request. This changes API semantics for endpoints that accept an empty array payload (the body is omitted entirely), and this regression was introduced by dropping the !Array.isArray(value) guard in this commit.
Useful? React with 👍 / 👎.
6ff9ee3 to
df20e98
Compare
- Resolved merge conflict in AlertBox.test.tsx: kept PR's removal of progress dots/token count tests while adopting main's renderWithIntl wrapper - Fixed empty popover issue: guard click/hover handlers in BottomMenuAlertPopover to not open when alerts array is empty, preventing a blank floating panel during initial load or after clearAlerts() Signed-off-by: jh-block <jhugo@block.xyz>
Signed-off-by: jh-block <jhugo@block.xyz>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4dc8004f75
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: jh-block <jhugo@block.xyz>
Moves context window information from a hidden popover into the status bar for always-visible usage tracking.
Changes
ContextWindowIndicatorcomponent — displays token usage inline (e.g.12.4k / 128k), color-coded grey normally, orange at 75-90%, red above 90%Files changed
ui/desktop/src/components/bottom_menu/ContextWindowIndicator.tsxui/desktop/src/components/ChatInput.tsxui/desktop/src/components/settings/models/bottom_bar/ModelsBottomBar.tsxui/desktop/src/components/alerts/AlertBox.tsxui/desktop/src/components/alerts/__tests__/AlertBox.test.tsxScreenshots