From c99535c2d719589aedc35186dd4997b2f3439123 Mon Sep 17 00:00:00 2001 From: bikraj2 Date: Fri, 16 Jan 2026 19:28:32 +0530 Subject: [PATCH] fix(history): prevent adding multiple history entries with same path when scanning --- cmd/analyze/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/analyze/main.go b/cmd/analyze/main.go index 59fe79a..7749d24 100644 --- a/cmd/analyze/main.go +++ b/cmd/analyze/main.go @@ -971,7 +971,9 @@ func (m model) enterSelectedDir() (tea.Model, tea.Cmd) { } selected := m.entries[m.selected] if selected.IsDir { - m.history = append(m.history, snapshotFromModel(m)) + if len(m.history) == 0 || m.history[len(m.history)-1].Path != m.path { + m.history = append(m.history, snapshotFromModel(m)) + } m.path = selected.Path m.selected = 0 m.offset = 0