feat(table): add OverflowRow option to disable overflow row#705
Closed
xbrxr03 wants to merge 1 commit into
Closed
Conversation
When a table has more rows than can fit in its configured height, lipgloss renders an overflow row with ellipsis (…) in each column to indicate that more rows exist below. This is useful for scrollable views but unwanted when implementing custom pagination. Add OverflowRow(bool) setter and GetOverflowRow() getter. Default is true to preserve existing behavior. Set to false to suppress the overflow row. Closes charmbracelet#557
Author
|
Closing this PR due to lack of maintainer engagement. I'm happy to reopen if there's interest. Thanks for the great project. |
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.
Problem
When a table has more data rows than can fit in its configured
Height, lipgloss renders an overflow row with…in each column. This tells the user there are more rows below. But if you're implementing pagination, that overflow row is redundant — you already know there are more pages.Reported in #557.
Fix
Added
OverflowRow(bool)andGetOverflowRow()toTable. Default istrue(preserve existing behavior). Set tofalseto suppress the overflow row entirely.The change is minimal: a
boolfield onTable, a setter, a getter, and one condition inString()that gates the overflow row rendering. No changes to the height/scroll calculation logic.Tests
4 new sub-tests under
TestOverflowRowDisabled:overflow_enabled_default: confirms…appears with default settingsoverflow_disabled: confirms…is gone whenOverflowRow(false)overflow_disabled_shows_all: confirms output is identical when all rows fit regardless of settinggetter: confirmsGetOverflowRow()returns correct defaults and after mutationFull test suite:
ok charm.land/lipgloss/v2/table 0.279sCloses #557