fix(ui): scroll tree selector viewport instead of dumping every row - #34
Merged
Conversation
The tree selector rendered every scan result unconditionally, so a scan with more rows than fit the terminal height broke bubbletea's redraw math - cursor position and checkbox state visually desynced once the terminal started scrolling on its own. Render rows through a bubbles/viewport that scrolls to keep the cursor row visible, and run the selector in the alt screen so bubbletea owns the full frame. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012jb9mxkG51dbLmRxPsYfLJ
The blank line between the viewport and the footer used two newlines, one line more than chromeLines(7) accounts for, so the frame overflowed the terminal height by one row on every render. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012jb9mxkG51dbLmRxPsYfLJ
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.
무엇이 바뀌나
tree selector가 전체 항목을 뷰포트 없이 그대로 출력하던 것을,
bubbles/viewport로커서 행을 항상 화면 안에 유지하도록 스크롤 렌더링으로 교체. alt screen 모드로 실행.
왜
스캔 결과가 터미널 높이를 넘으면 커서 위치와 체크박스 표시가 화면과 어긋나는 버그 보고.
검증
$ go build ./... && go test ./...
ok github.com/ohing504/devclean/internal/ui 3.455s
(전체 패키지 통과)
$ golangci-lint run ./internal/ui/...
0 issues.
🤖 Generated with Claude Code
https://claude.ai/code/session_012jb9mxkG51dbLmRxPsYfLJ