Skip to content

Comments

fix(ui): display only first line of multi-line notes in table cells#432

Merged
cpcloud merged 4 commits intomainfrom
fix/423-multiline-notes-display
Feb 21, 2026
Merged

fix(ui): display only first line of multi-line notes in table cells#432
cpcloud merged 4 commits intomainfrom
fix/423-multiline-notes-display

Conversation

@cpcloud
Copy link
Owner

@cpcloud cpcloud commented Feb 21, 2026

Summary

  • Multi-line notes in table cells rendered with raw newlines, producing garbled output because ansi.Truncate and lipgloss.Width don't handle embedded newlines
  • Display only the first line in the cell, with a right-aligned grayed-out +N indicator showing how many additional lines exist
  • Full multi-line content remains accessible via the Enter-key preview overlay
  • Extract shared decimalDigits helper, reusing the log10 digit-counting pattern from sortIndicatorWidth

Steps to reproduce (before fix)

  1. Create a document with a multi-line Notes field (e.g. "Changed the filter\nand checked pressure")
  2. Navigate to the Docs tab
  3. Observe the Notes column renders garbled text with embedded newlines

Closes #423

Multi-line notes passed raw newlines through renderCell and
naturalWidths, producing garbled table output because ansi.Truncate
and lipgloss.Width don't handle embedded newlines. Replace
strings.TrimSpace with a new firstLine helper that extracts the first
line and appends "..." when additional lines exist. The full text
remains accessible via the Enter-key preview overlay.

closes #423
Consistent with ansi.Truncate which already uses U+2026, and saves
two columns of width compared to "...".
Show a subtle "+N" indicator right-aligned in the notes cell when the
note has multiple lines. The first line is displayed as the cell text
and the indicator tells the user how many more lines are available in
the preview overlay.

Also extract a shared decimalDigits helper, reusing the log10 digit-
counting pattern from sortIndicatorWidth.
Append a unicode ellipsis to the first line text so the cell reads
"Changed the filter…              +1" rather than just the bare first
line with a count. The ellipsis signals truncated content while the
count tells the user how much more there is.
@cpcloud cpcloud merged commit 3098121 into main Feb 21, 2026
12 checks passed
@cpcloud cpcloud deleted the fix/423-multiline-notes-display branch February 21, 2026 12:31
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.

bug: multi-line Notes in Docs displayed incorrectly

1 participant