Repository navigation
fix(web): a markdown table column no longer shrinks to one letter per line - #866
Conversation
… line Rendered markdown sets `overflow-wrap: anywhere` so that a long path in prose wraps, and table cells inherited it. With `anywhere`, the browser counts every letter as a break point when it computes a cell's minimum width. The header cells never wrap, so in a table whose headers fill the width, the column under an empty header got only its minimum width, and its labels stood one letter per line. Table cells now use `overflow-wrap: break-word`. A cell still breaks a word that is wider than its column, but its minimum width is its longest word. In Chromium, the label column of a five-column table went from 36 px to 74 px and wraps between words. A table with an unbreakable cell wider than the view scrolls sideways inside its wrapper, which the wrapper already allows. The Response Viewer and the File Viewer's markdown view share these rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first commit left one case of the same squeeze. Codeman turns the paths in an answer into links, and a linked path keeps `word-break: break-all` so that it can wrap anywhere. That lets the browser count every letter as a break point when it sizes the column, so in a table whose headers fill the width, a column of paths shrank to three or four letters per line. A cell that holds a linked path now has a minimum width of 6em. Other cells keep their natural width, so a narrow column such as row numbers stays narrow. On a 390 px view in Firefox and Chromium, a path column went from 48 px to 83 px, and a `#` column kept its 32 px. The comment on the cell rule also said wrongly that a cell breaks a word wider than its column. In automatic table layout a column is never narrower than its longest word, so that never happens, and the comment now says that. The test reads every rule that names a selector, in styles.css and mobile.css, with comments removed first, so a later override fails it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for this fix, and for the careful write-up with measurements. The PR stops a markdown table column in the Response Viewer and the File Viewer from collapsing to one letter per line, by giving table cells One thing needs a change before merge. URLs, inline code and hashes in a cell no longer wrap in Chromium ( The description says a long URL still wraps because browsers break after
The same applies to path links in the File Viewer's markdown view: Your path approach handles this when it is extended to inline code and links. Replacing the .rv-table-wrap td :is(code, a:not(.rv-path-link)) { overflow-wrap: anywhere; }
.rv-table-wrap td:has(code, a:not(.rv-path-link)) { min-width: 6em; }keeps both of your improvements (label column 74 px, path column 116 px with its 80 px floor, Nit ( Checks run here: typecheck, lint, frontend syntax, format, public assets and the browser-exclude check all pass. The new test passes, and 5 of its 6 cases fail against master's stylesheet, as you said. All 70 gate test files that read the stylesheets pass. Your question about letting headers wrap is still open; keep this PR to the cell rules. With the cell rules updated, this is ready to merge. |
Chromium never breaks a line after `/`, so under the cells' `break-word` a URL, an identifier or a hash in backticks set its column's width, and the whole table scrolled sideways on a phone. Inline code and links in a cell now break anywhere, and a cell holding one gets the 6em floor that cells with a linked path had. In a 360 px column in Chromium and Firefox, URL, identifier and hash tables fit as they did on master. Two costs remain. A code-only column such as `-v` grows from 52 px to 80 px. CSS cannot tell an autolink from a link with a prose label, so a long word in a label can break mid-word in a narrow column. The test's selector lookup now splits a selector list only on commas outside parentheses, so it can find the `:is()` and `:has()` rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Claude:
|
|
Thanks for the follow-up commit, and for checking it in Firefox. This PR stops a markdown table column in the Response Viewer and the File Viewer from collapsing to one letter per line. Cells now wrap between words, while inline code and links in a cell still break anywhere and their cell gets a 6em floor. The third commit is what the last review asked for. I measured it again in headless Chromium 156 at 360 px with the real You don't need to change anything. This is ready to merge once CI finishes green. Thanks again for the careful measurements. |
Replaces the four PR changesets (claude-starts-under-root, installer-headless-sudo, trusted-proxy-sign-in, upload-html-documents) and names #850, #859, #860 and #866, which brought none. Patch: #854's changeset asked for minor, which is the owner's call at COM. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged, and shipped in Codeman 1.52.1. Nothing was changed on top. Table columns in the response viewer and the file preview now wrap between words, and inline code, links and paths in a cell still break where they need to. Your measurements in two browsers made this an easy one to land. Thank you! |
In the Response Viewer and the File Viewer's markdown view, a table can squeeze one of its columns to a single letter per line. It happens when the header cells fill the width, and the column under an empty header is the one that shrinks.
The screenshots show a sample table rendered with the real stylesheet in Firefox, before and after this change.
Before

After

Cause
Rendered markdown sets
overflow-wrap: anywhereon.rv-textso that a long path in prose wraps, and table cells inherit it. Withanywhere, the browser counts every letter as a break point when it computes a cell's minimum width. The header cells arewhite-space: nowrap, so they claim their full width, and the remaining column gets only its minimum width, which is one letter.Fix
Table cells now set
overflow-wrap: break-word, so a cell wraps between words and its column is never narrower than its longest word. Prose outside tables keepsanywhere. In the sample table, the label column went from 35 px, one letter per line, to 75 px, wrapped between words.That alone lets one long token set its column's width. Chromium finds no break point inside a URL, an identifier or a hash, because it never breaks a line after
/, so a table holding one scrolled sideways on a phone. Inline code and links in a cell therefore keep breaking anywhere, as Codeman's linked paths (a.rv-path) already do throughword-break: break-all. Breaking anywhere lets a column shrink again, so a cell that holds inline code or a link gets a minimum width of6em, about ten characters. Other cells keep their natural width, so a narrow column such as row numbers stays narrow.In a 360 px column in Chromium and Firefox, tables with URLs, identifiers and hashes fit as they did on master, and a column of linked paths went from 48 px to 80 px.
Two costs remain:
-v, grows from 52 px to 80 px..rv-path-link) is the exception and keeps breaking between words.The PR has three commits. The second and third came out of reviews of the first.
Tests
test/response-viewer-table-cells.test.tspins the declarations:break-wordon the cells,anywhereon inline code and links in a cell, the minimum width on a cell that holds one, andanywhereon prose. It reads every rule that names a selector, instyles.cssandmobile.css, so a later override fails it. jsdom has no layout, so the test can't measure the columns; the widths above come from headless Firefox and Chromium. Against master's stylesheet, 5 of its 6 cases fail.I also checked the fix in my own Firefox, on the table where I first saw the problem. Its label column now wraps between words.
The label column is still narrow, because the headers never wrap. Letting headers wrap would change how every table looks, so this PR leaves them alone. Ark0N, say if you'd like that changed too.
🤖 Generated with Claude Code