From ec5ef42d3a529c7ff2157a1f6b21b6c2b61748e5 Mon Sep 17 00:00:00 2001 From: Renz Date: Fri, 7 Nov 2025 11:54:08 +0000 Subject: [PATCH] Fix: Operation history navigation now visible with arrow keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FIXED: - Removed unused cursor variable that was always a space - Arrow up/down now visibly highlights selected item - Added position counter (Viewing X/Y) - Changed selection indicator from ">" to "→" - Explicit cursor initialization to 0 RESULT: - ↑/↓ keys now work and show visual feedback - Current selection clearly visible with highlight - Position indicator shows which item is selected --- internal/tui/history.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/tui/history.go b/internal/tui/history.go index 942174b..e8a015a 100644 --- a/internal/tui/history.go +++ b/internal/tui/history.go @@ -35,6 +35,7 @@ func NewHistoryView(cfg *config.Config, log logger.Logger, parent tea.Model) His logger: log, parent: parent, history: loadHistory(cfg), + cursor: 0, // Start at first item } } @@ -125,19 +126,19 @@ func (m HistoryViewModel) View() string { s.WriteString(infoStyle.Render("📭 No backup history found")) s.WriteString("\n\n") } else { - s.WriteString(fmt.Sprintf("Found %d backup operations:\n\n", len(m.history))) + s.WriteString(fmt.Sprintf("Found %d backup operations (Viewing %d/%d):\n\n", + len(m.history), m.cursor+1, len(m.history))) for i, entry := range m.history { - cursor := " " - line := fmt.Sprintf("%s [%s] %s - %s (%s)", - cursor, + line := fmt.Sprintf("[%s] %s - %s (%s)", entry.Timestamp.Format("2006-01-02 15:04"), entry.Type, entry.Database, entry.Status) if m.cursor == i { - s.WriteString(selectedStyle.Render("> " + line)) + // Highlighted selection + s.WriteString(selectedStyle.Render("→ " + line)) } else { s.WriteString(" " + line) }