fix: context percentage labels reflect used/remaining state#311
Open
huangguang1999 wants to merge 1 commit intosirmalloc:mainfrom
Open
fix: context percentage labels reflect used/remaining state#311huangguang1999 wants to merge 1 commit intosirmalloc:mainfrom
huangguang1999 wants to merge 1 commit intosirmalloc:mainfrom
Conversation
Previously the Context % and Context % (usable) widgets always rendered the static label "Ctx: " / "Ctx(u): ", so a user looking at "Ctx: 9.3%" could not tell whether 9.3% was used or remaining without opening the editor to check the inverse toggle. Now the label reflects the current state: - default (used): "Ctx Used: X%" / "Ctx(u) Used: X%" - inverse (left): "Ctx Left: X%" / "Ctx(u) Left: X%" The existing (u) keybind "(u)sed/remaining" and modifier text "(remaining)" already named these states; this just surfaces the same distinction in the rendered status line output. Tests updated to match. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
Context %andContext % (usable)widgets currently render a staticCtx:/Ctx(u):label regardless of whether the value shown is used or remaining (via the(u)keybind that togglesinverse). So a user glancing atCtx: 9.3%can't tell whether that's 9.3% used or 9.3% remaining without opening the editor to check the inverse modifier.This PR makes the label reflect the current state:
Ctx Used: X%/Ctx(u) Used: X%Ctx Left: X%/Ctx(u) Left: X%The existing keybind label
(u)sed/remainingand the editor modifier text(remaining)already communicate these two states; this change just surfaces the same distinction in the rendered output. TheCtx/Ctx(u)prefix is kept so the two widgets remain visually distinguishable from one another and fromContext Length'sCtx: 18.6knumeric label.This is a small UX polish — no behavior change beyond the label string.
Test plan
bun test— 731 / 731 pass (including the updatedContextPercentage.test.ts/ContextPercentageUsable.test.ts)bun run lint— cleanccstatusline setup, add both Context % widgets, toggle each one via(u), confirm the rendered label flips betweenUsedandLeftNotes
Happy to adjust the exact label wording (e.g.
Rem:instead ofLeft:) if you'd prefer something shorter — I went withUsed/Leftbecause they match the mental model of "how much is used" vs "how much is left" and are symmetric in length.🤖 Generated with Claude Code