Skip to content

Make completion menu colors skin-aware instead of hardcoded - #5353

Closed
StarrWulfe wants to merge 1 commit into
NousResearch:mainfrom
StarrWulfe:fix/adaptive-terminal-skin-colors
Closed

Make completion menu colors skin-aware instead of hardcoded#5353
StarrWulfe wants to merge 1 commit into
NousResearch:mainfrom
StarrWulfe:fix/adaptive-terminal-skin-colors

Conversation

@StarrWulfe

Copy link
Copy Markdown

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:

  • Light terminal themes (dark text on dark bg = invisible/unselectable)
  • Users of pywal, matugen, or stylix for adaptive terminal theming
  • Any custom skin that doesn't use dark backgrounds

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 backgrounds
  • completion_text, completion_active_text — text colors
  • completion_meta, completion_meta_active — description/meta text

Skins 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:

  1. Adaptive terminal color detection: Many of us use pywal, matugen, or stylix to auto-generate terminal colors from our wallpaper. An auto skin type that reads from ~/.cache/wal/colors or 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.

  2. 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.

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
@StarrWulfe

Copy link
Copy Markdown
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.

@teknium1

Copy link
Copy Markdown
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!

@teknium1 teknium1 closed this Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants