Skip to content

feat: add persistent word-wrap setting for chat code blocks and tables#3480

Open
imabdulazeez wants to merge 3 commits into
pingdotgg:mainfrom
imabdulazeez:feat/chat-code-block-word-wrap
Open

feat: add persistent word-wrap setting for chat code blocks and tables#3480
imabdulazeez wants to merge 3 commits into
pingdotgg:mainfrom
imabdulazeez:feat/chat-code-block-word-wrap

Conversation

@imabdulazeez

@imabdulazeez imabdulazeez commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

What Changed

Added a Wrap code blocks and tables client setting that controls whether long content in chat messages wraps by default — covering both code blocks and tables.

  • New chatWordWrap boolean in the client settings schema (ClientSettingsSchema + ClientSettingsPatch), defaulting to true. (Renamed from the earlier chatCodeBlockWordWrap now that it governs more than code blocks.)
  • MarkdownCodeBlock seeds its per-block wrapped state from this setting instead of always starting unwrapped.
  • MarkdownTable now seeds its expanded (wrap) state from the same setting, so wide tables render with wrapped cells by default instead of truncating. The footer expand/collapse toggle still works for ad-hoc overrides.
  • Added a Wrap code blocks and tables row to the General settings panel (Switch + per-setting reset button), and wired it into the settings restore/reset flow and the "modified settings" summary.
  • Removed the orphaned data-wrap table CSS; tables wrap via the existing [data-expanded="true"] styling.
  • Updated the desktop ClientSettings test fixture to the renamed field.

Why

Long, unwrapped lines in chat code blocks and wide table cells force horizontal scrolling, which is awkward to read. Previously each block/table started in its non-wrapped state with users having to toggle every one individually. This adds a single, persisted preference so users can make wrapping the default across both content types, while keeping the per-element toggle for exceptions. Default is true so the more readable behavior is on out of the box.

Screenshots

Settings → General — new "Wrap code blocks and tables" toggle

image

Chat code block + table with wrap default applied

image image

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (after only)
  • I included a video for animation/interaction changes

- adds `chatCodeBlockWordWrap` client setting (default: true)
- uses persisted setting as default wrap state in code blocks
- adds toggle in general settings panel with reset support
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ad6441ac-fa0a-4e09-a237-a87fa0201665

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jun 21, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

Unable to check for correctness in b5275c6.

You can customize Macroscope's approvability policy. Learn more.

- extends wrap setting to cover table cells as well as code blocks
- updates setting key, UI labels, and reset logic
@imabdulazeez imabdulazeez changed the title feat: add persistent markdown word-wrap setting for chat feat: add persistent word-wrap setting for chat code blocks and tables Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant