feat(ui): show context usage details#100264
Conversation
|
Codex review: needs changes before merge. Reviewed July 5, 2026, 8:49 AM ET / 12:49 UTC. Summary Reproducibility: yes. for the blocking interaction bug from source: clicks inside the static popover body bubble to the composer focus handler and do not match the interactive guard. I did not run a live touch/mobile repro in this read-only review. Review metrics: 2 noteworthy metrics.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the Control UI details panel, absorb or exempt popover-body interactions from composer focus, remove the manual CHANGELOG.md line, and rerun the focused UI/i18n proof. Do we have a high-confidence way to reproduce the issue? Yes for the blocking interaction bug from source: clicks inside the static popover body bubble to the composer focus handler and do not match the interactive guard. I did not run a live touch/mobile repro in this read-only review. Is this the best way to solve the issue? No as currently implemented. The details panel is the right UI owner boundary, but it needs the popover-body focus fix and release-owned changelog cleanup before it is the best merge shape. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 601b80c5f4c1. Label changesLabel justifications:
Evidence reviewedAcceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (4 earlier review cycles)
|
|
Fixed the i18n finding in 6cfae71: all five Fresh exact-head proof on Blacksmith Testbox
The prior desktop and short-landscape Chrome proof remains attached in #100264 (comment). Exact-head hosted CI is running now. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6cfae7195a
ℹ️ 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".
| </svg> | ||
| <span class="context-ring__pct">${model.pct}%</span> | ||
| </summary> | ||
| <section class="context-usage__popover" aria-label=${t("chat.composer.contextUsage.title")}> |
There was a problem hiding this comment.
Stop popover clicks from focusing the composer
When the context sheet is open, tapping or trying to scroll inside this non-interactive <section> bubbles to the .agent-chat__input click-to-focus handler, and none of the popover's static div/dl content matches COMPOSER_CHROME_INTERACTIVE_SELECTOR. On touch/mobile this can focus the textarea and bring up the keyboard over the very sheet the user is trying to read, so the popover should absorb clicks/pointer events or be treated as interactive by the composer chrome handler.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ceb90c64cf
ℹ️ 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".
| return; | ||
| } | ||
| selectedDecision = decision; | ||
| allowDecisionArmed = decision !== "deny"; |
There was a problem hiding this comment.
Require confirmation after selecting allow decisions
When an approval offers both deny and an allow choice, the selector starts on Deny, and moving the highlight to allow-once/allow-always triggers onSelectionChange; this line sets allowDecisionArmed before the user has seen or acknowledged the confirmation text, so the very first Enter on the allow option resolves the approval. The two-Enter guard still works for allow-only prompts, but it is bypassed for the common allow/deny approval prompts, including the default decision set.
Useful? React with 👍 / 👎.
|
🦞🧹 I asked ClawSweeper to review this item again. |
b1a41a9 to
e0bbe17
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0bbe17ac2
ℹ️ 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".
|
|
||
| ### Changes | ||
|
|
||
| - **Control UI context usage:** show context-window progress, latest-run input/output tokens, and the active model when the chat context ring is opened. |
There was a problem hiding this comment.
Remove this normal PR entry from CHANGELOG
This feature commit adds a manual release note to CHANGELOG.md, but the repo guide says CHANGELOG.md is release-only and normal PRs/direct fixes should carry release-note context in the PR body or squash message instead. This is also inserted into the versioned 2026.7.1 section rather than Unreleased, so merging it rewrites a finalized release section and can make generated release notes duplicate or misattribute this change.
Useful? React with 👍 / 👎.


What Problem This Solves
The Control UI chat composer shows context pressure as a compact ring, but opening that control did not reveal the numbers behind it. Users had to infer the current context window and could not see the latest run's token split or active model in place.
Why This Change Was Made
The context ring now opens a keyboard-accessible details panel with the fresh context snapshot, latest-run input/output tokens, and active model. The panel uses the existing session-list data, preserves the compact recommendation path, closes on Escape or outside interaction, and becomes a viewport sheet on narrow or short-landscape screens.
The Control UI mock server also loads the external UI package aliases used by production, keeping live visual verification on the real route. AI-assisted with Codex; two fresh autoreview passes were completed, with the final pass reporting no actionable findings.
User Impact
Users can click the composer context ring to understand current context usage without leaving chat. The same panel stays readable on desktop, portrait mobile, and short landscape layouts.
Evidence
tbx_01kwrrh4nm6b1857st4y4s1cx2:pnpm test ui/src/pages/chat/chat-composer.test.ts— 8/8 passed.tbx_01kwrrh4nm6b1857st4y4s1cx2:pnpm test ui/src/e2e/chat-flow.e2e.test.ts— 20/20 passed, including open/dismiss usage coverage.tbx_01kwrrh4nm6b1857st4y4s1cx2:pnpm ui:i18n:checkandpnpm ui:build— passed.packages/speech-core/node_modules/openclawlint fan-out; exact-head hosted CI remains the merge gate.