Repository navigation
Studio: compact context usage ring when the chat header is squeezed - #12355
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Two notes on the red checks here:
|
…er icons - The compact face is the ring alone; the tooltip keeps the exact percentage. Without a known window the token count still stands in. - The ring is icon sized, matching the temporary chat and sidebar icons. - The header squeezes a wrapper, and the button inside takes only the face it shows, so hover, focus and the tooltip cover just the ring.
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
When the chat column gets narrow (for example with a side panel open), the context usage button in the chat header wraps "177 / 35.3k" onto two lines next to a squashed bar. The icon buttons beside it also shrink and can get clipped.
The button now steps down cleanly as space runs out:
44 / 131.1kwith the usage bar, as today.Only after the ring is fully compact does the model name start to truncate, and the header icons never shrink. Hover, focus and the tooltip cover only the face that is showing, so a squeezed button has no dead hover area around the ring. The tooltip content is unchanged.
Changes
context-usage-bar.tsxminmax(compact, full)track. The full width is exact inch, since the wrapper and face are in the mono font.clamp()to the full face when it fits, else to the compact one (an icon-sized square for the ring). Both layouts share the button's grid cell and only the matching one has width. It is all CSS, with no resize observers.contextUnboundedWhenBatchedandparallelSlotsbeing dropped before they reachedderiveContextUsageBar, so the unenforced limit advice now shows for batched servers.context-usage-bar-state.ts: addscompactFace, the text shown instead of the ring when there is no window to fill (null shows the ring).chat-page.tsx, header only:basis-0 grow min-w-min max-w-max). Only the model selector shrinks, and only once the context button can't get any smaller.shrink-0.Testing
tests/context-usage-compact.test.tscovers the compact face for each state, the prop forwarding and the header classes.npm run typecheckis clean andnpm testpasses, apart from the existing More menu test that also fails onmain.