Skip to content

Show context window usage inline in the status bar#7607

Merged
jh-block merged 4 commits into
mainfrom
jhugo/context-window-status-bar
Apr 15, 2026
Merged

Show context window usage inline in the status bar#7607
jh-block merged 4 commits into
mainfrom
jhugo/context-window-status-bar

Conversation

@jh-block
Copy link
Copy Markdown
Collaborator

@jh-block jh-block commented Mar 2, 2026

Moves context window information from a hidden popover into the status bar for always-visible usage tracking.

Changes

  • New ContextWindowIndicator component — displays token usage inline (e.g. 12.4k / 128k), color-coded grey normally, orange at 75-90%, red above 90%
  • Alert popover moved from the model name to the context window indicator — hover/click the usage text to access auto-compact threshold settings and the compact button
  • Removed redundant progress visualization (dot bar, token counts, percentage) from the popover since that info is now always visible in the status bar

Files changed

File Change
ui/desktop/src/components/bottom_menu/ContextWindowIndicator.tsx New component
ui/desktop/src/components/ChatInput.tsx Wire in new component, move alerts prop
ui/desktop/src/components/settings/models/bottom_bar/ModelsBottomBar.tsx Remove alerts prop and popover
ui/desktop/src/components/alerts/AlertBox.tsx Remove progress dots/token counts
ui/desktop/src/components/alerts/__tests__/AlertBox.test.tsx Update tests

Screenshots

image image

@jh-block jh-block requested a review from DOsinga March 2, 2026 20:56
Copy link
Copy Markdown
Collaborator

@DOsinga DOsinga left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator

@DOsinga DOsinga left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +38 to +40
<BottomMenuAlertPopover alerts={alerts} />
{tokenLimit > 0 && (
<span className={`text-xs font-mono cursor-default ${colorClass}`}>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

https://github.com/block/goose/blob/66038b331a5c7891d95cdd12ec7470adef6720c5/ui/desktop/src/components/bottom_menu/BottomMenuAlertPopover.tsx#L241
P2 Badge 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".

@jh-block jh-block force-pushed the jhugo/context-window-status-bar branch from 66038b3 to 6ff9ee3 Compare March 26, 2026 19:14
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment thread ui/desktop/src/api/core/params.gen.ts Outdated
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) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@jh-block jh-block force-pushed the jhugo/context-window-status-bar branch from 6ff9ee3 to df20e98 Compare March 26, 2026 19:25
- 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>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment thread ui/desktop/src/components/bottom_menu/BottomMenuAlertPopover.tsx
Signed-off-by: jh-block <jhugo@block.xyz>
@jh-block jh-block added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit 2d3e2df Apr 15, 2026
19 checks passed
@jh-block jh-block deleted the jhugo/context-window-status-bar branch April 15, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants