fix(ui): display only first line of multi-line notes in table cells#432
Merged
fix(ui): display only first line of multi-line notes in table cells#432
Conversation
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.
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.
Summary
ansi.Truncateandlipgloss.Widthdon't handle embedded newlines+Nindicator showing how many additional lines existdecimalDigitshelper, reusing the log10 digit-counting pattern fromsortIndicatorWidthSteps to reproduce (before fix)
Closes #423