Skip to content

fix(webview-ui): break long unbroken text in markdown table cells - #2651

Open
C0d3N1nja97342 wants to merge 2 commits into
MoonshotAI:mainfrom
C0d3N1nja97342:fix/webui-table-overflow-v2
Open

fix(webview-ui): break long unbroken text in markdown table cells#2651
C0d3N1nja97342 wants to merge 2 commits into
MoonshotAI:mainfrom
C0d3N1nja97342:fix/webui-table-overflow-v2

Conversation

@C0d3N1nja97342

Copy link
Copy Markdown

Related Issue

Resolve #2560

Problem

Markdown tables rendered in the Web UI lack width constraints for long unbroken text (URLs, base64 strings, tokens). The table wrapper has overflow-x-auto but the cells (td/th) had no word-breaking, so long unbroken runs expanded the column indefinitely, stretching the table past the chat container and creating a global horizontal scrollbar.

Solution

Add Tailwind's break-all (word-break: break-all) to both td and th elements in the markdown renderer. This forces long unbroken text to wrap inside the cell, keeping the table within the container width. The overflow-x-auto wrapper still handles wide multi-column tables by scrolling horizontally.

Verification

  • Long unbroken text (URLs, base64) now wraps inside table cells instead of stretching the table
  • Normal prose tables still render correctly (short cells unaffected)
  • Wide multi-column tables still scroll inside the overflow-x-auto wrapper

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Markdown tables with long continuous text (URLs, base64, tokens)
stretched the table past the chat container, creating a global
horizontal scrollbar. The table wrapper has overflow-x-auto but the
cells had no word-breaking, so long unbroken runs expanded the column
indefinitely. Add break-all to td/th so the text wraps inside the cell.

Fixes MoonshotAI#2560
@changeset-bot

changeset-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 634b66f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e33ea78ba2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

td: ({ children }) => <td className="border border-border px-2 py-1">{enrich(children)}</td>,
th: ({ children }) => <th className="border border-border bg-muted px-2 py-1 text-left font-medium">{enrich(children)}</th>,
td: ({ children }) => <td className="border border-border px-2 py-1 break-all">{enrich(children)}</td>,
th: ({ children }) => <th className="border border-border bg-muted px-2 py-1 text-left font-medium break-all">{children}</th>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve enrichment in table headers

When a markdown table header contains a detected local path or color literal and enableEnrichment is on, this now bypasses enrich, so headers no longer get clickable file links or color swatches even though body cells still do. This looks accidental while adding break-all; keep {enrich(children)} in the th just like td.

Useful? React with 👍 / 👎.

@C0d3N1nja97342

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 634b66f2ec

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

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.

[UI Bug] Markdown table stretches page horizontally with long text in Web UI

1 participant