Commit 2be3c42c73
Unsigned
Layout: unified · split
internal/selection_menu.go +11 −10
| @@ -49,13 +49,16 @@ var ( | |||
| 49 | Foreground(lipgloss.Color("#98FB98")) // Pale green | 49 | Foreground(lipgloss.Color("#98FB98")) // Pale green |
| 50 | 50 | ||
| 51 | selectedItemStyle = lipgloss.NewStyle(). | 51 | selectedItemStyle = lipgloss.NewStyle(). |
| 52 | Foreground(lipgloss.Color("#000000")). // Black text | 52 | Foreground(lipgloss.Color("#FFFFFF")). // White text |
| 53 | Background(lipgloss.Color("#7CB9E8")). // Light blue background | 53 | Background(lipgloss.Color("#4A90E2")). // Softer blue background |
| 54 | Bold(true). | 54 | Bold(true). |
| 55 | Padding(0, 1) | 55 | Padding(0, 1). |
| 56 | Border(lipgloss.NormalBorder(), false, false, false, true). // Left border only | ||
| 57 | BorderForeground(lipgloss.Color("#FFFFFF")) // White border | ||
| 56 | 58 | ||
| 57 | regularItemStyle = lipgloss.NewStyle(). | 59 | regularItemStyle = lipgloss.NewStyle(). |
| 58 | Foreground(lipgloss.Color("#E6E6FA")) // Light lavender | 60 | Foreground(lipgloss.Color("#E6E6FA")). // Light lavender |
| 61 | Padding(0, 1) | ||
| 59 | 62 | ||
| 60 | noMatchesStyle = lipgloss.NewStyle(). | 63 | noMatchesStyle = lipgloss.NewStyle(). |
| 61 | Foreground(lipgloss.Color("#FF6B6B")). // Coral red | 64 | Foreground(lipgloss.Color("#FF6B6B")). // Coral red |
| @@ -145,14 +148,12 @@ func (m Model) View() string { | |||
| 145 | quitHintStyle.Render("Ctrl+C") + " to quit):\n") | 148 | quitHintStyle.Render("Ctrl+C") + " to quit):\n") |
| 146 | 149 | ||
| 147 | b.WriteString(filterLabelStyle.Render("Filter: ") + | 150 | b.WriteString(filterLabelStyle.Render("Filter: ") + |
| 148 | filterTextStyle.Render(m.filter) + "\n") | 151 | filterTextStyle.Render(m.filter) + "\n\n") // Added extra newline for spacing |
| 149 | 152 | ||
| 150 | if len(m.filteredKeys) == 0 { | 153 | if len(m.filteredKeys) == 0 { |
| 151 | b.WriteString("\n" + noMatchesStyle.Render("No matches found.") + "\n") | 154 | b.WriteString(noMatchesStyle.Render("No matches found.") + "\n") |
| 152 | } else { | 155 | } else { |
| 153 | visibleItems := m.visibleItemsCount() | 156 | visibleItems := m.visibleItemsCount() |
| 154 | |||
| 155 | // Determine the slice of items to display based on scroll offset | ||
| 156 | start := m.scrollOffset | 157 | start := m.scrollOffset |
| 157 | end := start + visibleItems | 158 | end := start + visibleItems |
| 158 | if end > len(m.filteredKeys) { | 159 | if end > len(m.filteredKeys) { |
| @@ -162,9 +163,9 @@ func (m Model) View() string { | |||
| 162 | // Render the options within the visible range | 163 | // Render the options within the visible range |
| 163 | for i := start; i < end; i++ { | 164 | for i := start; i < end; i++ { |
| 164 | if i == m.selected { | 165 | if i == m.selected { |
| 165 | b.WriteString(selectedItemStyle.Render("▶ "+m.filteredKeys[i].Label) + "\n") | 166 | b.WriteString(selectedItemStyle.Render(m.filteredKeys[i].Label) + "\n") |
| 166 | } else { | 167 | } else { |
| 167 | b.WriteString(regularItemStyle.Render(" "+m.filteredKeys[i].Label) + "\n") | 168 | b.WriteString(regularItemStyle.Render(m.filteredKeys[i].Label) + "\n") |
| 168 | } | 169 | } |
| 169 | } | 170 | } |
| 170 | } | 171 | } |