Make TUI views fit terminal width dynamically#18
Merged
wesm merged 7 commits intoroborev-dev:mainfrom Jan 9, 2026
Merged
Conversation
3a9b76c to
6b775b4
Compare
Collaborator
|
Nice. I'll rebase this and merge it, stand by |
Replaces fixed column widths with dynamic sizing based on terminal width. Changes: - Added columnWidths struct to track dynamic widths for ref, repo, agent - Added calculateColumnWidths() to distribute available space proportionally - Updated renderJobLine() to accept and use dynamic column widths - Increased separator line max width to 200 chars Column distribution: Ref (40%), Repo (35%), Agent (25%) of available space Fixed columns (Status, Queued, Elapsed, Addr'd) maintain constant widths This allows the TUI to properly utilize wide terminals while maintaining readability on narrow terminals. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tests calculateColumnWidths() at various terminal widths and renderJobLine() truncation behavior with long/short values. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
6b775b4 to
11f488a
Compare
- Fix wrapWidth to clamp to terminal width instead of using max(80, ...) - Fix Addr'd column width calculation (6 chars, not 5) - Scale column widths proportionally on narrow terminals to prevent overflow - Update tests to verify total width doesn't exceed terminal width Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use git range instead of SHA to test ref truncation (shortRef reduces SHA to 7 chars, bypassing the truncation logic) - Add TestTUIRenderJobLineLength to verify total line length respects column widths Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove artificial floor on availableWidth that caused overflow - Scale columns proportionally to fit available space - Fix wrapWidth to clamp to terminal width (was using max instead of min) - Update tests to document expected behavior: >= 80 cols should fit, narrower terminals may overflow (user should widen terminal) Co-Authored-By: Claude Opus 4.5 <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.
Replaces fixed column widths with dynamic sizing based on terminal width.
Changes:
This allows the TUI to properly utilize wide terminals while maintaining readability on narrow terminals.