Draft
Conversation
Extend the Widget interface with getEffectiveColor() and getDiscreteValues() so widgets can resolve their own foreground color based on current value. Model widget maps color per model family (Sonnet, Opus, Haiku) using either explicit colorMap metadata or a hash-based fallback. ThinkingEffort maps color per effort level (low=green, medium=yellow, high=brightRed, max=red). Adds color utilities: getThresholdColor for percent-based coloring, hashStringToColor for deterministic color assignment, and a DISCRETE_COLOR_PALETTE of visually distinct ANSI colors. The renderer now calls resolveWidgetFgColor() in both standard and powerline paths, checking getEffectiveColor before falling back to the configured or default color.
Usage widgets in progress mode now change color based on usage percent: green below 50%, yellow between 50-80%, red above 80%. Thresholds are configurable via metadata (thresholdLow, thresholdHigh). Adds a (t)hreshold colors toggle keybind in the widget editor to let users disable the behavior. Threshold colors are enabled by default.
The color menu now cycles through a "Dynamic" option for widgets that support discrete values. Pressing Enter on a dynamic widget opens a per-value color editor where each value (e.g. Sonnet, Opus, Haiku) can be assigned an individual color via left/right arrow keys. Adds cycleWithDynamic to handle the extended color list and setDiscreteValueColor/clearDiscreteValueColor mutation helpers.
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.
No description provided.