fix: wrap long text on multiple rows#216
Open
v-alexmoraru wants to merge 12 commits intomicrosoft:mainfrom
Open
fix: wrap long text on multiple rows#216v-alexmoraru wants to merge 12 commits intomicrosoft:mainfrom
v-alexmoraru wants to merge 12 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Improves print_output_format table rendering in unix-style output by wrapping long cell values across multiple lines and introducing terminal-width-aware column sizing to prevent misaligned/off-screen output.
Changes:
- Added text wrapping and multi-line row rendering for unix-style tables.
- Introduced terminal-width-based column width capping to keep tables within the visible viewport.
- Updated test harness/recordings and added a changelog entry for the fix.
Reviewed changes
Copilot reviewed 22 out of 157 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_commands/recordings/test_commands/test_jobs/test_run_schedule_rm_success[SparkJobDefinition].yaml | Updated recorded HTTP interactions affected by output formatting/version changes. |
| tests/test_commands/recordings/test_commands/test_jobs/test_run_schedule_rm_invalid_param_types_failure.yaml | Updated recorded HTTP interactions affected by output formatting/version changes. |
| tests/test_commands/recordings/test_commands/test_jobs/test_run_sch_notebook_no_params_failure.yaml | Updated recorded HTTP interactions affected by output formatting/version changes. |
| tests/test_commands/recordings/test_commands/test_jobs/test_run_job_notebook_timeout_zero_sec.yaml | Updated recorded HTTP interactions affected by output formatting/version changes. |
| tests/test_commands/recordings/test_commands/test_jobs/test_run_job_notebook.yaml | Updated recorded HTTP interactions affected by output formatting/version changes. |
| tests/test_commands/recordings/test_commands/test_jobs/test_job_run_failure_with_timeout_exits_with_code_1_success.yaml | Updated recorded HTTP interactions affected by output formatting/version changes. |
| tests/test_commands/recordings/test_commands/test_jobs/test_job_run_exits_with_code_1_success.yaml | Updated recorded HTTP interactions affected by output formatting/version changes. |
| tests/test_commands/recordings/test_commands/test_jobs/class_setup.yaml | Updated recorded setup interactions (User-Agent, IDs, etc.) aligning with new runs/version. |
| tests/conftest.py | Forces a wide terminal in tests to avoid truncation from new column-width capping logic. |
| src/fabric_cli/utils/fab_ui.py | Implements wrapping + multi-line printing and caps column widths to terminal size. |
| .changes/unreleased/fixed-20260427-142055.yaml | Adds changelog entry for wrapping long text across multiple lines. |
Co-authored-by: Copilot <copilot@github.com>
aviatco
reviewed
Apr 30, 2026
| if header: | ||
| widths = [ | ||
| max(len(field), max(get_visual_length(entry, field) for entry in _entries)) | ||
| max( |
Collaborator
There was a problem hiding this comment.
there is a new function recently added - fab_utils.truncate_columns maybe you can try reuse it to fix the issue
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.
When
print_output_formatrendered a table withshow_headers=Trueand long column values, rows exceeded the terminal width causing headers and values to appear misaligned or off-screen._wrap_texthelper that splits text into lines respecting visual width_format_unix_style_fieldand_format_unix_style_entryto return list[str] — one line per wrapped row — instead of a single potentially overflowing stringprint_entries_unix_styleto cap column widths proportionally to fit the terminal and print each new row