feat: fill the terminal width and redraw on resize#15
Merged
Conversation
The list was a fixed ~99-column table, so it ignored most of a wide terminal and didn't reflow when the window changed size. The TOPIC column now flexes to absorb the full terminal width (topicColWidth derives from m.width), the title/search lines span the width too, and a WindowSizeMsg returns tea.ClearScreen so shrinking the window doesn't leave stale wider rows behind. The hand-synced column widths are now named constants shared by the header and rows.
This was referenced Jun 22, 2026
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
The list was a fixed ~99-column table, so on a wide terminal it left most of the screen empty, and it didn't reflow when you resized the window.
topicColWidth()derives the topic column fromm.widthafter the fixed columns, so the list spans the whole terminal. The title and search/count lines span the full width too.WindowSizeMsghandler now returnstea.ClearScreen, so shrinking the window doesn't leave stale wider rows behind.colDate,colProject, …) shared by the header and both row formats, so there's one source of truth.Tests
TestTopicColWidthFlexes- the topic column grows with terminal width and clamps to a minimum on tiny terminals.TestFormatListItemFillsWidth- a rendered row's length is exactlywidth - indentat 80/120/200 columns (i.e. it fills the screen).formatListItem/marker tests updated to set a realistic width.go test -cover= 71.5%.Note: the resize visual behaviour (clear + reflow) is exercised by the width math in tests; I can't headlessly drive a real terminal resize, but the dynamic widths +
tea.ClearScreenare the standard bubbletea approach.