Fix: Correct List selection and focus rendering

- Selected items: dimmed background (20% opacity) + accent text (NO dot)
- Focused items: pulsing dot indicator (no background)
- Unfocused items: plain text with padding
- Selection and focus are now visually distinct
- 618 tests passing
This commit is contained in:
phranck
2026-02-06 21:10:54 +01:00
parent df5a6ea71c
commit d2ce696d74
+8 -7
View File
@@ -373,17 +373,18 @@ extension List: Renderable {
context: RenderContext,
palette: Palette
) -> String {
// Selection: background bar (full width)
// Selected: dimmed background, accent text (no dot, full width bar)
if isSelected {
let selectedBg = ANSIRenderer.colorize(
let dimmedBg = palette.accent.opacity(0.2)
let selectedRow = ANSIRenderer.colorize(
rowText,
foreground: palette.background,
background: palette.accent
foreground: palette.accent,
background: dimmedBg
)
return selectedBg
return selectedRow
}
// Focused but not selected: simple text with pulsing dot prefix
// Focused but not selected: pulsing dot indicator
if isFocused {
let dimAccent = palette.accent.opacity(0.35)
let dotColor = Color.lerp(dimAccent, palette.accent, phase: context.pulsePhase)
@@ -391,7 +392,7 @@ extension List: Renderable {
return styledDot + " " + rowText
}
// Unfocused and not selected: just text
// Unfocused and not selected: just text with padding
return " " + rowText
}
}