Repository navigation
fix(ui): fit bordered panels and the status bar inside the terminal - #115
Merged
Merged
Conversation
lipgloss v1 sizes Width/Height without the border, so every bordered block handed the full size rendered two cells wider and taller than asked and the renderer clipped it: - the result panel always lost its right and bottom edges - compare mode ran its second pane off the right of the screen - the sidebar pushed the main area one cell past the right edge framedPanel now subtracts the frame from the style itself, and the sidebar gives its right border the last of sidebarWidth. The status bar wrapped whenever its hints (or a long DSN) did not fit, growing the view and losing its tail to the MaxHeight crop. Hints are now cut first and the whole bar is truncated to one row as a guard. With the panels sized correctly, two more leftovers became visible: editorHeight/resultsHeight reserved two rows for JoinVertical newlines that add no rows, leaving the bottom of the screen blank, and the editor was given fullWidth-4 although textarea.SetWidth already counts its own border. Both now use the full space. TestViewFitsTerminal asserts every line is exactly the terminal width and the view exactly its height across sizes and modes; all 16 cases failed before this change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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 changed
internal/ui/result.go: newframedPanelhelper. It renders a bordered result panel that takes exactly w×h cells, border included. It gets the border size from the style (GetHorizontalBorderSize/GetVerticalBorderSize). Both result-panel paths use it.internal/ui/compare.go: both compare panes useframedPanel.internal/ui/sidebar.go: the sidebar's content is one cell narrower, so the sidebar plus its right border takes exactlysidebarWidth.internal/ui/statusbar.go: the status bar always stays one row.….internal/ui/model.go:editorHeight/resultsHeightnow splitm.height-1, via the newbodyHeight. They used to splitm.height-3.fullWidth. It used to getfullWidth-4.internal/ui/layout_test.go: two new tests.TestViewFitsTerminal: across 4 sizes × 4 modes (insert / normal / sidebar / compare), the view must be exactly the terminal height, every line exactly the terminal width, and the results' bottom-right corner must be visible.TestStatusBarStaysOneRow: the status bar must be exactly 1 row and exactly the terminal width for every width from 1 to 200.LESSONS.md/NOTES.md: one lesson entry, and one index line forframedPanel.Why
In lipgloss v1,
WidthandHeightdo not include the border. A bordered block given the full size therefore rendered two cells wider and taller than the space it had, and the renderer cut off the extra. Measured in a 120×30 terminal (tmuxcapture-pane):Once the panels had the correct size, two more problems became visible:
fullWidth-4, buttextarea.SetWidthalready counts its own border. So the editor ended 4 cells short of the result panel.Notes for reviewers
resultsHeight-4) andvisibleColumnRange(contentWidth-8) are unchanged. They were already conservative for the new, smaller inner size.TestViewFitsTerminalcases andTestStatusBarStaysOneRowfail. With them, everything passes.go vet ./...,go test ./..., andbash e2e/run.sh(8/8 passed).🤖 Generated with Claude Code