fix(formatters): expand streaming table to fill terminal width#314
Merged
Conversation
StreamingTable computed column widths from hint rows, which are short placeholder data. When the total intrinsic width was less than the terminal width, fitColumns returned those narrow widths as-is — the table rendered ~72 columns wide instead of filling the terminal. After fitColumns, expand the last column to absorb remaining space. This is scoped to StreamingTable only; renderTextTable uses real data and doesn't need expansion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Api
Other
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
Codecov Results 📊✅ 2268 passed | Total: 2268 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 3235 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 80.05% 80.06% +0.01%
==========================================
Files 120 120 —
Lines 16218 16224 +6
Branches 0 0 —
==========================================
+ Hits 12983 12989 +6
- Misses 3235 3235 —
- Partials 0 0 —Generated by Codecov Action |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
PRE:

POST:

Summary
The
sentry logs --followstreaming table rendered ~72 columns wide even on wide terminals. The Message column wrapped unnecessarily despite ample space.fitColumnsonly shrinks columns — when hint rows (short placeholder data) produce intrinsic widths below the terminal width, it returns them as-is with no expansion. AfterfitColumns, theStreamingTableconstructor now expands the last column to absorb remaining space.renderTextTableis unaffected since it uses real data.Test plan
bun test test/lib/formatters/text-table.test.ts— 32 tests passbun test test/lib/formatters/log.test.ts— 34 tests passsentry logs --followfills terminal widthsentry issue listtable unaffected