Skip to content

Collapse multiline text in table cells#251

Merged
jeremy merged 2 commits intomainfrom
fix-multiline-table-cells
Mar 11, 2026
Merged

Collapse multiline text in table cells#251
jeremy merged 2 commits intomainfrom
fix-multiline-table-cells

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 11, 2026

Summary

  • singleLine (presenter path) now joins all non-empty lines with spaces instead of returning only the first line. This affects all schema-backed list rows.
  • formatCell (generic renderer path) collapses \n/\r via strings.Fields before truncation.
  • Existing test expectations updated to match collapse-not-truncate semantics.

Test plan

  • bin/ci passes
  • basecamp campfire messages — multiline content renders on one line
  • basecamp messages list — multiline subjects render on one line

singleLine previously returned only the first non-empty line, silently
dropping the rest. Now it joins all non-empty lines with spaces so table
cells show the full content compressed to one line.

formatCell in the generic renderer gets the same treatment via
strings.Fields for cells that contain \n or \r.
@jeremy jeremy requested a review from a team as a code owner March 11, 2026 03:34
Copilot AI review requested due to automatic review settings March 11, 2026 03:34
@github-actions github-actions bot added tests Tests (unit and e2e) output Output formatting and presentation bug Something isn't working labels Mar 11, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Copy link
Copy Markdown

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

Updates table-cell text rendering so multiline strings are collapsed into a single line (space-separated) instead of being effectively truncated at the first line, improving readability across schema-backed presenter output and the generic output renderer.

Changes:

  • presenter.singleLine now joins all non-empty lines with spaces instead of returning only the first non-empty line.
  • output.formatCell collapses \n/\r (and surrounding whitespace) to spaces before truncation.
  • Presenter tests updated/added to reflect the new collapse semantics.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
internal/presenter/format.go Changes singleLine behavior to collapse multiline text into one line.
internal/output/render.go Collapses newline/carriage-return-containing strings before truncation in table cells.
internal/presenter/presenter_test.go Updates/extends tests to match collapse-not-truncate behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Normalize \r\n and bare \r to \n before splitting so carriage returns
don't leak into table cells. Add test for bare-CR and mixed line
endings. Drop unused require import from this commit (child PRs re-add
it when they add tests that need it).
@jeremy jeremy merged commit 0ac56cb into main Mar 11, 2026
26 checks passed
@jeremy jeremy deleted the fix-multiline-table-cells branch March 11, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working output Output formatting and presentation tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants