mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 06:04:51 +00:00
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:
parent
186169a820
commit
66517b72e9
2 changed files with 7 additions and 10 deletions
|
|
@ -1,7 +1,8 @@
|
||||||
# Development Rules
|
# Development Rules
|
||||||
|
|
||||||
## First Message
|
## 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/ai/README.md
|
||||||
- packages/tui/README.md
|
- packages/tui/README.md
|
||||||
- packages/agent/README.md
|
- packages/agent/README.md
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,7 @@ export class SelectList implements Component {
|
||||||
|
|
||||||
let line = "";
|
let line = "";
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
// Use arrow indicator for selection
|
// Use arrow indicator for selection - entire line uses selectedText color
|
||||||
const prefix = this.theme.selectedPrefix("→ ");
|
|
||||||
const prefixWidth = 2; // "→ " is 2 characters visually
|
const prefixWidth = 2; // "→ " is 2 characters visually
|
||||||
const displayValue = item.label || item.value;
|
const displayValue = item.label || item.value;
|
||||||
|
|
||||||
|
|
@ -88,20 +87,17 @@ export class SelectList implements Component {
|
||||||
|
|
||||||
if (remainingWidth > 10) {
|
if (remainingWidth > 10) {
|
||||||
const truncatedDesc = item.description.substring(0, remainingWidth);
|
const truncatedDesc = item.description.substring(0, remainingWidth);
|
||||||
const selectedText = this.theme.selectedText(truncatedValue);
|
// Apply selectedText to entire line content
|
||||||
const descText = this.theme.description(spacing + truncatedDesc);
|
line = this.theme.selectedText("→ " + truncatedValue + spacing + truncatedDesc);
|
||||||
line = prefix + selectedText + descText;
|
|
||||||
} else {
|
} else {
|
||||||
// Not enough space for description
|
// Not enough space for description
|
||||||
const maxWidth = width - prefixWidth - 2;
|
const maxWidth = width - prefixWidth - 2;
|
||||||
const selectedText = this.theme.selectedText(displayValue.substring(0, maxWidth));
|
line = this.theme.selectedText("→ " + displayValue.substring(0, maxWidth));
|
||||||
line = prefix + selectedText;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// No description or not enough width
|
// No description or not enough width
|
||||||
const maxWidth = width - prefixWidth - 2;
|
const maxWidth = width - prefixWidth - 2;
|
||||||
const selectedText = this.theme.selectedText(displayValue.substring(0, maxWidth));
|
line = this.theme.selectedText("→ " + displayValue.substring(0, maxWidth));
|
||||||
line = prefix + selectedText;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const displayValue = item.label || item.value;
|
const displayValue = item.label || item.value;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue