|
19 | 19 | styleDim = lipgloss.NewStyle().Faint(true) |
20 | 20 | styleWhite = lipgloss.NewStyle().Foreground(lipgloss.Color("7")) |
21 | 21 |
|
22 | | - selLine = lipgloss.NewStyle().Bold(true).Reverse(true) |
| 22 | + selLine = lipgloss.NewStyle().Bold(true).Background(lipgloss.Color("236")) |
23 | 23 | helpStyle = lipgloss.NewStyle().Faint(true) |
24 | 24 |
|
25 | 25 | // Palette of distinguishable ANSI-256 colors for repo/author hashing. |
@@ -169,12 +169,8 @@ func (m *model) reclassify() { |
169 | 169 | m.cols = computeColumns(m.items) |
170 | 170 | } |
171 | 171 |
|
172 | | -func hideCursorCmd() tea.Msg { |
173 | | - return tea.HideCursor() |
174 | | -} |
175 | | - |
176 | 172 | func (m model) Init() tea.Cmd { |
177 | | - cmds := []tea.Cmd{hideCursorCmd} |
| 173 | + cmds := []tea.Cmd{tea.HideCursor} |
178 | 174 | if m.loading { |
179 | 175 | cmds = append(cmds, fetchDataCmd(m.org, m.limit)) |
180 | 176 | } |
@@ -276,34 +272,31 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { |
276 | 272 | return m, nil |
277 | 273 | } |
278 | 274 |
|
279 | | -const hideCursor = "\033[?25l" |
280 | | - |
281 | 275 | func (m model) View() string { |
282 | 276 | if m.loading { |
283 | | - return hideCursor + "Fetching PRs...\n" |
| 277 | + return "Fetching PRs...\n" |
284 | 278 | } |
285 | 279 | if m.errMsg != "" { |
286 | 280 | msg := strings.ReplaceAll(m.errMsg, "\n", " ") |
287 | 281 | if len(msg) > 200 { |
288 | 282 | msg = msg[:200] + "..." |
289 | 283 | } |
290 | | - return hideCursor + fmt.Sprintf("Error: %s\n\nPress r to retry, q to quit.\n", msg) |
| 284 | + return fmt.Sprintf("Error: %s\n\nPress r to retry, q to quit.\n", msg) |
291 | 285 | } |
292 | 286 |
|
293 | 287 | if m.showHelp { |
294 | | - return hideCursor + m.renderLegend() |
| 288 | + return m.renderLegend() |
295 | 289 | } |
296 | 290 |
|
297 | 291 | vis := m.visibleItems() |
298 | 292 | if len(vis) == 0 { |
299 | 293 | if m.showAuthor { |
300 | | - return hideCursor + "No open PRs authored by you. Press a to switch to reviewer mode.\n" |
| 294 | + return "No open PRs authored by you. Press a to switch to reviewer mode.\n" |
301 | 295 | } |
302 | | - return hideCursor + "No PRs match current filters. Press s/m to adjust, or a for author mode.\n" |
| 296 | + return "No PRs match current filters. Press s/m to adjust, or a for author mode.\n" |
303 | 297 | } |
304 | 298 |
|
305 | 299 | var b strings.Builder |
306 | | - b.WriteString(hideCursor) |
307 | 300 | maxLines := m.height - 3 // reserve for header + help bar |
308 | 301 | if maxLines <= 0 { |
309 | 302 | maxLines = len(vis) |
|
0 commit comments