Skip to content

fix: wrap long text on multiple rows#216

Open
v-alexmoraru wants to merge 12 commits intomicrosoft:mainfrom
v-alexmoraru:dev/v-alexmoraru/fix-table-width-visibility
Open

fix: wrap long text on multiple rows#216
v-alexmoraru wants to merge 12 commits intomicrosoft:mainfrom
v-alexmoraru:dev/v-alexmoraru/fix-table-width-visibility

Conversation

@v-alexmoraru
Copy link
Copy Markdown
Member

When print_output_format rendered a table with show_headers=True and long column values, rows exceeded the terminal width causing headers and values to appear misaligned or off-screen.

  • Added _wrap_text helper that splits text into lines respecting visual width
  • Updated _format_unix_style_field and _format_unix_style_entry to return list[str] — one line per wrapped row — instead of a single potentially overflowing string
  • Updated print_entries_unix_style to cap column widths proportionally to fit the terminal and print each new row

@v-alexmoraru v-alexmoraru changed the title Fix: wrap long text on multiple rows fix: wrap long text on multiple rows Apr 17, 2026
@v-alexmoraru v-alexmoraru marked this pull request as ready for review April 27, 2026 11:21
@v-alexmoraru v-alexmoraru requested a review from a team as a code owner April 27, 2026 11:21
Copilot AI review requested due to automatic review settings April 27, 2026 11:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/fabric_cli/utils/fab_ui.py Outdated
Comment thread src/fabric_cli/utils/fab_ui.py
Comment thread src/fabric_cli/utils/fab_ui.py
Comment thread src/fabric_cli/utils/fab_ui.py
Comment thread tests/conftest.py
Copilot AI review requested due to automatic review settings April 30, 2026 06:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

if header:
widths = [
max(len(field), max(get_visual_length(entry, field) for entry in _entries))
max(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a new function recently added - fab_utils.truncate_columns maybe you can try reuse it to fix the issue

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.

3 participants