Skip to content

feat: AddColumns(TableColumn[]) overload, remove Shrink toggle, fix Grow column rendering#14

Merged
StevenTCramer merged 3 commits into
masterfrom
Cramer/2025-12-22/dev
Feb 22, 2026
Merged

feat: AddColumns(TableColumn[]) overload, remove Shrink toggle, fix Grow column rendering#14
StevenTCramer merged 3 commits into
masterfrom
Cramer/2025-12-22/dev

Conversation

@StevenTCramer
Copy link
Copy Markdown
Contributor

Summary

  • Add AddColumns(params TableColumn[]) overload to TableBuilder and internal Table — allows passing a pre-configured TableColumn[] array directly instead of calling .AddColumn() per element
  • Remove Shrink toggle from public API — shrinking to fit terminal width is now always-on behavior; Shrink(false) never had a useful interactive use case (overflow just wraps uglily)
  • Fix Grow column bug: when fixed columns exceed terminal width, Grow columns now correctly get zero width and zero-width columns are skipped in rendering (border junctions and cell padding omitted)
  • Rewrite Example 13 (Grow column) in sample with honest flex-grow semantics and three visually distinct scenarios

StevenTCramer and others added 3 commits February 22, 2026 13:56
**Bug:** When terminal was narrower than fixed columns + grow column natural
width, Grow columns were being forced to MinWidth (default 4) instead of
keeping their natural width. This caused branch names like
"Cramer-2025-12-22-dev" to truncate to "C..." when they should display
full content.

**Fix:**
1. Removed forced MinWidth assignment when availableForGrow <= 0
2. Excluded Grow columns from general shrink logic - they keep natural width
3. Added regression test Should_keep_grow_column_natural_width_when_no_remaining_space

**Testing:**
- All 8 Grow column tests pass
- All 23 test suites pass (207+ tests)

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
The Shrink property and builder method are removed because shrinking to fit
terminal width is the only sensible default. Allowing overflow caused visual
corruption and had no legitimate use case. Grow columns now correctly collapse
to zero width when fixed columns exhaust all available space.

Also adds AddColumns() convenience method to avoid repetitive AddColumn() chains.

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
@StevenTCramer StevenTCramer merged commit 79bc3d0 into master Feb 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant