Skip to content

fix(cloud-agent-next): reflow hard-wrapped commit message bodies - #7268

Merged
eshurakov merged 1 commit into
mainfrom
kilo/long-base-iwz
Oct 8, 2026
Merged

eshurakov merged 1 commit into
mainfrom
kilo/long-base-iwz

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

Problem

Commit message bodies in the Cloud Agent chat are hard-wrapped at ~72 columns in git. The commit details popover rendered them verbatim with whitespace-pre-wrap inside a narrow 384px (w-96) panel, so every stored line wrapped a second time mid-sentence. This left orphaned fragments like sanitized, and, repository, diagnostics, and observability on their own lines.

Fix

In CommitDetails, normalize the body before rendering:

  • Normalize CRLF to LF.
  • Collapse single newlines inside a paragraph into spaces so the text reflows to the container width.
  • Preserve blank lines as paragraph breaks.

This matches how git/GitHub present commit bodies and removes the double-wrap artifact. Message content stays plain text and HTML-escaped.

Verification

  • ConversationMessages.test.ts: all 79 tests pass, including a new case asserting hard-wrapped lines are joined and paragraph breaks are preserved.
  • oxlint on changed files: 0 warnings / 0 errors.
  • Web tsgo typecheck: passes.

Note: the full web Jest suite requires PostgreSQL; it was not reachable in this environment, so the focused component suite was run with a temporary config that skips the DB setup hooks.

Commit message bodies are hard-wrapped at ~72 columns in git. The commit details popover rendered them with whitespace-pre-wrap in a narrow 384px panel, so each stored line wrapped again mid-sentence, leaving orphaned words on their own lines.

Collapse single newlines within a paragraph into spaces so the body reflows to the container width, while keeping blank lines as paragraph breaks.
@kilo-code-bot

kilo-code-bot Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Reviewed the commit-body reflow change in CommitDetails. The normalization handles CRLF, collapses single newlines per paragraph, filters empty paragraphs, and preserves blank-line paragraph breaks while keeping content plain-text/escaped. The new test asserts the joined-line and preserved-break behavior, and existing assertions (escaping, Body substring, truncation) remain consistent with the new output. No memory-leak surface is added (pure render, no subscriptions or listeners).

Files Reviewed (2 files)
  • apps/web/src/components/cloud-agent-next/CommitCard.tsx
  • apps/web/src/components/cloud-agent-next/ConversationMessages.test.ts

Reviewed by deepseek-v4.1-flash · Input: 35.8K · Output: 4.7K · Cached: 174.3K

Review guidance: REVIEW.md from base branch main

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