Skip to content

Pad list widget output to allocated height#263

Merged
jeremy merged 2 commits intomainfrom
list-height-padding
Mar 11, 2026
Merged

Pad list widget output to allocated height#263
jeremy merged 2 commits intomainfrom
list-height-padding

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 11, 2026

Summary

  • List View() emitted fewer lines than l.height when results didn't fill the viewport, causing content area collapse and blank space / chrome bleed-through (most visible in search with few results)
  • Wrap all return paths through a single lipgloss.Height(l.height) render at the end of View(), matching the existing kanban pattern

Test plan

  • TestList_ScrollIndicator_NoOverflow still passes (output now exactly fills height)
  • TUI: search with few results — no blank space or chrome bleed below results — verified via TestList_HeightPadding_FewItems, TestList_HeightPadding_NoMatchesFilter
  • TUI: empty list states (loading, no items, no matches) fill their allocated height — verified via TestList_HeightPadding_Empty, TestList_HeightPadding_Loading

List.View() emitted fewer lines than l.height when results didn't
fill the viewport, causing content area collapse and chrome
bleed-through. Wrap all return paths through a single
lipgloss.Height(l.height) render, matching the kanban pattern.
@jeremy jeremy requested a review from a team as a code owner March 11, 2026 05:11
Copilot AI review requested due to automatic review settings March 11, 2026 05:11
@github-actions github-actions bot added the tui Terminal UI label Mar 11, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a TUI rendering issue where the list widget could emit fewer lines than its allocated height, causing the surrounding layout/content area to collapse and reveal underlying chrome (notably when searching with few results). It aligns List.View() with the existing widget pattern (as used by Kanban) by always rendering to the widget’s configured height.

Changes:

  • Refactors List.View() to build output via a single strings.Builder across all branches.
  • Ensures the final rendered output is padded/clamped to l.height (and l.width) via a single lipgloss render at the end of View().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Cover few-items, empty, loading, and no-matches-filter states to
verify the viewport always fills its allocated height.
@github-actions github-actions bot added tests Tests (unit and e2e) bug Something isn't working labels Mar 11, 2026
@jeremy jeremy merged commit 19d5cbd into main Mar 11, 2026
26 checks passed
@jeremy jeremy deleted the list-height-padding branch March 11, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working tests Tests (unit and e2e) tui Terminal UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants