Skip to content

Flip context window circle to represent context remaining#13097

Merged
harryalbert merged 4 commits into
masterfrom
factory/context-window-circle-color-flip
Jun 28, 2026
Merged

Flip context window circle to represent context remaining#13097
harryalbert merged 4 commits into
masterfrom
factory/context-window-circle-color-flip

Conversation

@warp-dev-github-integration

@warp-dev-github-integration warp-dev-github-integration Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Description

The context-window usage circle (the small segmented ring shown in the agent input footer and the conversation usage footer) used its solid/white marks to represent the context used, while the tooltip already read "X% context remaining". The result was confusing: a nearly-full context window showed a mostly-white/full circle even though little context remained, so the circle read as "used", not "remaining".

This flips the color semantics so the white marks represent the context remaining (the tooltip is unchanged):

  • empty conversation → all-white circle, "100% context remaining"
  • full context window → all-grey circle, "0% context remaining"

Both surfaces that render the circle funnel through the pure icon_for_context_window_usage (selected by remaining = 1 - usage). To keep the exact original icon, pattern, and fill direction and invert only the dark/light colors, the segmented-ring SVG assets have their per-segment fill-opacity swapped (0.40.9); because the icon renders monochrome (per-segment luminance is the mask), this makes each state the precise dark/light inverse of the original glyph — same boundary and sweep direction, colors swapped. The static placeholder icons default to the full-white (100% remaining) state, and the >= 80%-used red warning tint is preserved.

This implements the change agreed in the linked thread.

Linked Issue

Slack thread: https://warpdev.slack.com/archives/C0BCE7AELJ2/p1782490201740159?thread_ts=1782490201.740159&cid=C0BCE7AELJ2

Testing

  • Added regression unit tests in app/src/ai/blocklist/usage/mod_tests.rs covering the empty (→ ContextRemaining100), full (→ ContextRemaining0), and intermediate mappings, plus a monotonicity check (more usage never brightens the circle). All pass.

  • cargo clippy clean on the affected crate; ./script/format applied.

  • Verified live with computer use on a locally built Warp (see screenshots below).

  • I have manually tested my changes locally

Screenshots / Videos

Captured live on a locally built Warp via computer-use verification.

Empty conversation → full (white) circle, tooltip "100% context remaining":

Empty conversation: full circle, 100% context remaining

Empty conversation circle (zoom)

Partial context window (70% used, temporarily forced for verification) → ~30% white arc on the correct (far) side, tooltip "30% context remaining":

Partial: ~30% white arc, 30% context remaining

Partial circle (zoom)

(Screenshots are hosted on the factory/assets/context-window-circle-13097 branch so they render here without adding binary files to this PR's code diff.)

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Conversation: https://staging.warp.dev/conversation/d51f56ed-8dae-44f7-8184-cbb3e6a42dd3
Run: https://oz.staging.warp.dev/runs/019f04b2-049e-7e13-b025-45139520cac3

This PR was generated with Oz.

The context-window usage circle's solid (white) marks previously
represented the amount of context *used*, while the tooltip already read
"X% context remaining" — so a near-full context window showed a mostly
white/full circle labeled with a low remaining %, which read as
"used", not "remaining".

Flip the color semantics so the white marks represent the context
*remaining*:
- empty conversation -> all-white circle, "100% context remaining"
- full context window -> all-grey circle, "0% context remaining"

The tooltip text is unchanged (it was already remaining-based). Both
surfaces that show the circle (the agent input footer and the
conversation usage footer) funnel through the pure
`icon_for_context_window_usage`, so the single mapping change fixes both;
the static placeholder icons default to the full-white (100% remaining)
state. The >= 80%-used red warning tint is preserved.

Co-Authored-By: Warp <agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Jun 26, 2026
@oz-for-oss

oz-for-oss Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@warp-dev-github-integration[bot]

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overview

This PR flips the context-window circle so the bright segments represent context remaining, updates placeholder icons, and adds unit coverage for the icon mapping.

Concerns

  • For this user-facing change, please include screenshots or a screen recording demonstrating it working end to end. The description lists manual verification, but it does not attach visual evidence required for UI-impacting changes.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@warp-dev-github-integration

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Addressed the visual-evidence request: I've added before/after screenshots to the PR description (Screenshots / Videos section), captured live via computer-use verification on a locally built Warp — an empty conversation shows a full circle with "100% context remaining", and a near-full context window (90% used, temporarily forced) shows a mostly-grey circle with "10% context remaining". The images are hosted on a separate factory/assets/context-window-circle-13097 branch so they render without adding binary files to this PR's code diff.

oz-agent and others added 2 commits June 26, 2026 17:59
Per review feedback, align the asset and icon-enum names with how the
circle is displayed (context remaining). Rename the SVG assets
conversation-context-{0..100}.svg -> context-remaining-{0..100}.svg and
the Icon::ConversationContext{0..100} variants ->
Icon::ContextRemaining{0..100}, and update all references. The number
denotes the bright fill level, which now maps directly to the percentage
of context remaining (e.g. context-remaining-100 = full white circle on
an empty conversation). Pure rename — no behavior or rendering change.

Co-Authored-By: Warp <agent@warp.dev>

Copy link
Copy Markdown
Contributor

This stack of pull requests is managed by Graphite. Learn more about stacking.

The previous approach flipped which icon was shown per state, which
reversed the ring's sweep direction (it depleted the wrong way round).
Per review feedback, keep the exact same icon / pattern / fill direction
as the original and only invert the dark/light colors.

Since the icon is rendered monochrome (per-segment luminance from the
SVG's white fill-opacity acts as the mask), invert each segment's
dark/light by swapping fill-opacity 0.4<->0.9 in the assets. Combined
with the existing remaining-based selection, this renders the exact
dark/light inverse of the original glyph at every state: empty
conversation = full white ring, darkening in the same rotational
direction the original filled, ending all-grey at 0% remaining.
Verified by mapping bright segments to clock positions (each new asset
is the precise color-inverse of the original at the same state) and on
the running app via computer use.

Co-Authored-By: Warp <agent@warp.dev>

@harryalbert harryalbert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@harryalbert harryalbert enabled auto-merge (squash) June 28, 2026 22:01
@harryalbert harryalbert merged commit 178fe89 into master Jun 28, 2026
46 of 48 checks passed
@harryalbert harryalbert deleted the factory/context-window-circle-color-flip branch June 28, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants