Skip to content

Conversation

@ibetitsmike
Copy link
Contributor

Summary

Adds a horizontal context usage progress bar to the ChatInput component, positioned to the left of the Exec/Plan mode selector. This replaces the need for the 20px collapsed sidebar view that was previously used to show context usage when the right sidebar auto-collapsed on small screens.

Changes

New Components

  • ContextUsageIndicatorButton - 80px horizontal progress bar in ChatInput

    • Shows current context window usage with colored segments
    • Hover shows tooltip with ContextUsageBar component
    • Click opens popover with detailed usage + auto-compaction threshold slider
    • Hidden when no token data available (totalTokens === 0)
  • ContextUsageBar - Shared horizontal bar component (also used in CostsTab)

    • Displays "Context Usage" title with token counts
    • Includes threshold slider when autoCompaction prop provided

Modified Behavior

  • Right sidebar now fully hides on small screens instead of showing 20px collapsed meter

    • Same hysteresis logic (collapse at ≤800px, expand at ≥1100px)
    • Returns null when hidden - no DOM element rendered
    • Context usage info still visible via ChatInput indicator
  • TokenMeter - Added trackClassName prop for customizable background track color (bg-dark used in ChatInput for better contrast)

Screenshots

The indicator appears as a small progress bar next to the mode selector, showing context usage at a glance without taking up sidebar space.


Generated with mux • Model: anthropic:claude-opus-4-5 • Thinking: high

…put)

- Remove 20px collapsed sidebar view since context usage is now shown in ChatInput
- Remove chatAreaRef prop and hysteresis collapse/expand logic
- Remove RIGHT_SIDEBAR_COLLAPSED_KEY storage constant
- Simplify SidebarContainer to only handle width via customWidth/wide props
- Vertical meter still shows on Review tab for continuity
Instead of showing a 20px collapsed sidebar, now fully hides the sidebar
when chat area width falls below threshold. Context usage is shown in
ChatInput so no information is lost.

- Restore chatAreaRef prop and useResizeObserver for width detection
- Restore hysteresis collapse logic (800px collapse, 1100px expand)
- Return null when hidden instead of showing collapsed meter view
- Restore RIGHT_SIDEBAR_COLLAPSED_KEY storage constant
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@ibetitsmike ibetitsmike added this pull request to the merge queue Dec 16, 2025
Merged via the queue into main with commit b2aa99e Dec 16, 2025
20 checks passed
@ibetitsmike ibetitsmike deleted the mike/context-usage-indicator branch December 16, 2025 13:38
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.

1 participant