Clear screen when switching tabs in snapshot editor#45
Merged
fullstackjam merged 1 commit intomainfrom Apr 22, 2026
Merged
Conversation
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
|
👋 Thanks for opening this pull request! Before merging:
@fullstackjam will review this soon. Thanks for contributing! 🚀 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
fullstackjam
pushed a commit
that referenced
this pull request
Apr 22, 2026
PR #45 forced a full repaint via tea.ClearScreen on Tab/Shift-Tab to mask a ghost-text bug whose actual root cause was bubbletea v1.1.0 silently miscalling x/ansi v0.4.2's MoveCursor and EraseEntireDisplay after MVS upgraded the latter via lipgloss. With bubbletea bumped to v1.3.0 in the previous commit, the renderer uses ansi.CursorPosition and ansi.EraseEntireScreen directly, so incremental diff rendering now clears rows correctly. The forced full repaint is therefore redundant (just extra flicker on every tab switch). Removing it.
4 tasks
fullstackjam
added a commit
that referenced
this pull request
Apr 22, 2026
…47) * fix(deps): upgrade bubbletea v1.1.0 → v1.3.0 to repair tab-switch ghost text Root cause of the cirruslabs/cli ghost row on the macOS Prefs tab: bubbletea v1.1.0 was written against x/ansi v0.2.3, but MVS resolved x/ansi v0.4.2 via lipgloss v1.0.0. v0.4.2 silently broke two APIs that v1.1.0's standard renderer depends on: 1. MoveCursor(row, col) → MoveCursor(col, row) — arguments swapped. The post-flush "return cursor to last row" call landed the cursor at row=1 instead of row=linesRendered, so the next render's bottom-up EraseEntireLine/CursorUp1 loop could only clear row 1. 2. EraseEntireDisplay constant changed from "\x1b[2J" (clear visible) to "\x1b[3J" (clear scrollback only). tea.ClearScreen therefore left the alt-screen buffer untouched, making the PR #45 workaround a no-op on the visible frame. bubbletea v1.3.0 calls ansi.CursorPosition(col, row) and ansi.EraseEntireScreen directly, matching the v0.4+ API. Tab switching now clears and redraws correctly; the row-one-only erase artefact is gone at its source. * refactor(ui): drop tea.ClearScreen workaround on tab switch PR #45 forced a full repaint via tea.ClearScreen on Tab/Shift-Tab to mask a ghost-text bug whose actual root cause was bubbletea v1.1.0 silently miscalling x/ansi v0.4.2's MoveCursor and EraseEntireDisplay after MVS upgraded the latter via lipgloss. With bubbletea bumped to v1.3.0 in the previous commit, the renderer uses ansi.CursorPosition and ansi.EraseEntireScreen directly, so incremental diff rendering now clears rows correctly. The forced full repaint is therefore redundant (just extra flicker on every tab switch). Removing it. --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add screen clearing when navigating between tabs in the snapshot editor to prevent visual artifacts.
Why?
When switching tabs using Tab/Shift+Tab or arrow keys, the screen wasn't being cleared, which could leave remnants of the previous tab's content visible. This change ensures a clean visual transition between tabs by calling
tea.ClearScreenafter updating the active tab and resetting the cursor/scroll position.Testing
go vet ./...passesNotes for reviewer
The fix is minimal and focused—it simply adds the missing screen clear command to both tab navigation code paths (forward and backward). This is consistent with proper TUI practices for tab switching.
https://claude.ai/code/session_01BRAD9BubM3QKwbm5BUFLL5