fix(tui): use consistent accent color for entire selected line in file selector

Previously, the selected line in @ fuzzy search and Tab completion used
accent color for prefix/label but muted color for description. Now the
entire selected line uses the accent color for better visual consistency.
This commit is contained in:
Mario Zechner 2025-11-29 01:02:08 +01:00
parent 186169a820
commit 66517b72e9
2 changed files with 7 additions and 10 deletions

View file

@ -1,7 +1,8 @@
# Development Rules
## First Message
Read README.md, then ask which module(s) to work on. Read those README.md files in parallel:
If the user did not give you a concrete task in their first message,
read README.md, then ask which module(s) to work on. Based on the answer, read the relevant README.md files in parallel.
- packages/ai/README.md
- packages/tui/README.md
- packages/agent/README.md

View file

@ -71,8 +71,7 @@ export class SelectList implements Component {
let line = "";
if (isSelected) {
// Use arrow indicator for selection
const prefix = this.theme.selectedPrefix("→ ");
// Use arrow indicator for selection - entire line uses selectedText color
const prefixWidth = 2; // "→ " is 2 characters visually
const displayValue = item.label || item.value;
@ -88,20 +87,17 @@ export class SelectList implements Component {
if (remainingWidth > 10) {
const truncatedDesc = item.description.substring(0, remainingWidth);
const selectedText = this.theme.selectedText(truncatedValue);
const descText = this.theme.description(spacing + truncatedDesc);
line = prefix + selectedText + descText;
// Apply selectedText to entire line content
line = this.theme.selectedText("→ " + truncatedValue + spacing + truncatedDesc);
} else {
// Not enough space for description
const maxWidth = width - prefixWidth - 2;
const selectedText = this.theme.selectedText(displayValue.substring(0, maxWidth));
line = prefix + selectedText;
line = this.theme.selectedText("→ " + displayValue.substring(0, maxWidth));
}
} else {
// No description or not enough width
const maxWidth = width - prefixWidth - 2;
const selectedText = this.theme.selectedText(displayValue.substring(0, maxWidth));
line = prefix + selectedText;
line = this.theme.selectedText("→ " + displayValue.substring(0, maxWidth));
}
} else {
const displayValue = item.label || item.value;