Make OpenRouter color-bar preview use the standard resolver path#855
Open
willytop8 wants to merge 1 commit intosteipete:mainfrom
Open
Make OpenRouter color-bar preview use the standard resolver path#855willytop8 wants to merge 1 commit intosteipete:mainfrom
willytop8 wants to merge 1 commit intosteipete:mainfrom
Conversation
Previously the color-bar preview for OpenRouter read usedPercent directly instead of going through IconRemainingResolver, which meant key-quota state had no effect on the preview color. This change routes the preview through the same resolvedPercents(_:style:showUsed:) call that the live icon uses. - When no key limit is configured (noLimitConfigured) or key data is unavailable, resolvedPercents returns nil for primary, matching the live icon behavior and leaving the color bar unrendered - When a key limit is set, the key-usage percent drives the preview as expected - Adds tests covering the unavailable, no-limit, and key-quota cases, each verifying both the resolved percent and the menu-bar display text Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3d42a90 to
be7d96a
Compare
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.
The color-bar preview was reading
usedPercentdirectly instead of going throughIconRemainingResolver.resolvedPercents. Key-quota state (no limit configured, key data unavailable) had no effect — the preview always showed a non-nil percent even when the live icon renders no color bar.Routes the preview through the same resolver the live icon uses:
nilprimary, no color barnilprimary, no color barAdds tests for all three cases, each asserting both the resolved percent and the menu-bar display text.