Skip to content

fix(sms): keep line breaks in conversation bubbles - #228

Merged
MengMengCode merged 1 commit into
MengMengCode:masterfrom
Tardisyuan:fix/sms-bubble-line-breaks
Nov 27, 2026
Merged

MengMengCode merged 1 commit into
MengMengCode:masterfrom
Tardisyuan:fix/sms-bubble-line-breaks

Conversation

@Tardisyuan

@Tardisyuan Tardisyuan commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

SMS conversation bubbles in the web UI collapse line breaks into spaces. A message such as

Dearest Kate
Congratulations on reaching this milestone...
Much love
Grandma Maria

shows as one run-on paragraph. Outgoing messages typed with Enter in the composer are shown the same way. The stored text does keep the line breaks: the push notifications for the same message (built from the same content) show them correctly.

Cause

The bubble in web/src/components/sms/ThreadPanel.tsx renders the text with the default white-space: normal, which folds \n into a space.

Fix

Add whitespace-pre-wrap break-words to the bubble. pre-wrap keeps the sender's line breaks while still wrapping long lines; break-words stops long unbroken strings (URLs, codes) from overflowing the bubble. One line changed.

Testing

  • cd web && npm test: 47/47 pass.
  • cd web && npm run build: type-check and build pass, and .whitespace-pre-wrap is in the generated CSS.
  • Not done: I have not looked at the change in a running VoCat instance.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • SMS messages now preserve sender-entered line breaks and wrap long words for easier reading.

Message bubbles used the default white-space, so the line breaks in a
received SMS (and in one the user typed with Enter) were folded into
spaces. Notifications already show them, since the stored text keeps
them. Use whitespace-pre-wrap and break-words on the bubble.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

SMS message bodies now preserve sender-entered line breaks and wrap long words. The existing message bubble styling remains.

Changes: SMS message rendering

Layer / File(s) Summary
Message body whitespace and wrapping
web/src/components/sms/ThreadPanel.tsx
The message body styling preserves line breaks and wraps long words. A comment documents the line-break behavior.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Suggested reviewers: mengmengcode

Merge Risk: Minimal · up to 2b55a

This change preserves line breaks in SMS bubbles and wraps long words. It is a small styling change with no identified risk and is safe to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the actual change: SMS conversation bubbles now keep sender-entered line breaks. The raw summary confirms the edit to ThreadPanel.tsx applies whitespace-pre-wrap and break-words to the…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the actual change: SMS conversation bubbles now keep sender-entered line breaks. The raw summary confirms the edit to ThreadPanel.tsx applies whitespace-pre-wrap and break-words to the message body, and the objectives describe the same intent. The title is short, specific, and follows a conventional commit style. It does not mention the wrapping of long unbroken strings, which is a secondary aspect and does not need to appear in the title.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9a9fe10f-ec15-4ea2-a8b1-a33d83ba292b
Commits

Reviewing files that changed from the base of the PR and between 6cfc2fc and 2b55a02.

Files selected for processing: 1

  • web/src/components/sms/ThreadPanel.tsx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@MengMengCode
MengMengCode merged commit 3db888b into MengMengCode:master Nov 27, 2026
4 checks passed
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.

2 participants