Make completion menu colors skin-aware instead of hardcoded - #5353
Closed
StarrWulfe wants to merge 1 commit into
Closed
Make completion menu colors skin-aware instead of hardcoded#5353StarrWulfe wants to merge 1 commit into
StarrWulfe wants to merge 1 commit into
Conversation
The completion menu in get_prompt_toolkit_style_overrides() has hardcoded dark backgrounds (bg:#1a1a2e, bg:#333355) that ignore the active skin's color settings. This makes the completion menu unusable for users with light terminal themes or those using pywal/matugen/stylix for adaptive terminal theming. Replace hardcoded values with skin.get_color() calls, falling back to the existing colors as defaults so this change is fully backwards compatible. New skin color keys supported: completion_bg, completion_active_bg completion_text, completion_active_text completion_meta, completion_meta_active
Author
|
Also this was something I worked through with the help of my local AI agent, so YMMV-- I don't expect a merge, just wanted to bring it to the maintainer's attention for consideration. Appreciate all the fine work you real programmers do as I learn over here. |
Collaborator
|
Superseded by PR #9461, which makes completion menu colors skin-configurable with 6 granular color keys (completion_menu_bg, completion_menu_current_bg, completion_menu_meta_bg, completion_menu_meta_current_bg, status_bar_bg, voice_status_bg) — covering and extending the approach in this PR. Your early identification of the hardcoded completion menu issue helped validate the direction. Thanks! |
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 completion menu in
get_prompt_toolkit_style_overrides()has hardcoded dark backgrounds (bg:#1a1a2e,bg:#333355) that ignore the active skin's color settings. This makes the completion menu unusable for:This change
Replaces hardcoded completion menu colors with
skin.get_color()calls:New skin color keys (all backwards-compatible with existing defaults):
completion_bg,completion_active_bg— menu backgroundscompletion_text,completion_active_text— text colorscompletion_meta,completion_meta_active— description/meta textSkins that don't define these keys get the existing values as defaults, so this is a zero-breaking-change improvement.
A note on adaptive terminal theming from a NixOS user (SSH'd from a workstation with pywal/matugen/stylix):
It would be great to consider these directions for future development:
Adaptive terminal color detection: Many of us use pywal, matugen, or stylix to auto-generate terminal colors from our wallpaper. An
autoskin type that reads from~/.cache/wal/colorsor similar caches to derive the full UI palette — including the completion menu — would make the TUI adapt naturally when switching between light and dark terminal themes. Bonus points for WCAG contrast enforcement.Customizable TUI layouts: Tools like opencode and kilo let users pick or code their own panel layouts. The skin system today only affects colors. Consider exposing the Rich layout configuration so users can customize panel arrangements, status bar style, or prompt layout without forking.
Thanks for an excellent project. The skin system is one of its best features — this change makes it work for everyone.