From 3627b4173580ed08afcceba381dd34df66077bd0 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 22 Apr 2026 13:16:42 +0000 Subject: [PATCH] fix(ui): clear screen on tab switch to prevent ghost text Returning tea.ClearScreen on Tab/ShiftTab forces bubbletea to erase the alt-screen buffer and do a full repaint before rendering the new tab. This eliminates stale cursor-indicator lines (e.g. cirruslabs/cli) that persisted when switching from a short-list tab (Taps) to a longer-list tab (macOS Prefs). Root cause: bubbletea v1.1.0 was written against charmbracelet/x/ansi v0.2.3 but openboot resolves to v0.4.2, which swapped the argument order of MoveCursor(col, row). In alt-screen mode this places the cursor at (row=1, col=N) instead of (row=N, col=0) after each flush, causing the renderer's erase loop to stay clamped at row=1 and never clear rows below it on the next render. https://claude.ai/code/session_01BRAD9BubM3QKwbm5BUFLL5 --- internal/ui/snapshot_editor.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/ui/snapshot_editor.go b/internal/ui/snapshot_editor.go index 0208eb7..04b896e 100644 --- a/internal/ui/snapshot_editor.go +++ b/internal/ui/snapshot_editor.go @@ -208,11 +208,13 @@ func (m SnapshotEditorModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { //nolint m.activeTab = (m.activeTab + 1) % len(m.tabs) m.cursor = 0 m.scrollOffset = 0 + return m, tea.ClearScreen case key.Matches(msg, keys.ShiftTab), key.Matches(msg, keys.Left): m.activeTab = (m.activeTab - 1 + len(m.tabs)) % len(m.tabs) m.cursor = 0 m.scrollOffset = 0 + return m, tea.ClearScreen case key.Matches(msg, keys.Up): if m.cursor > 0 {