You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): copying a chat table as CSV keeps a space at line breaks - #43358
Copy table → Copy as CSV on an assistant message read each cell's raw textContent. A <br> inside a cell, which GFM tables use for line breaks, adds no text there. So the words on either side ran together in the copied CSV.
Deterministic repro on origin/main (fc1f1bafde): the assistant message must contain this table. A message sent with t3 thread send renders as a user message, which shows <br> as literal text and does not reproduce the bug.
| Step | Tool | Result || --- | --- | --- || Test |`execute`| 12 passed<br>0 failed |
Click Copy table → Copy as CSV and paste.
Observed: Test,execute,12 passed0 failed
Expected: Test,execute,12 passed 0 failed
To reproduce with the free Replay provider, put that <br> in the table row of the final agent_message_chunk in apps/server/scripts/dev-replay/showcase_transcript.ndjson. Then run a showcase turn.
Change
csvCellText now collects cell text with collectHtmlCellText, the helper that Copy as HTML already uses. CSV turns each line break or block edge it marks into a space, so a cell stays on one line. The helper also outputs formulas as TeX, as the old code did. It skips the hidden UI chrome that the Markdown and HTML copies already skip. The serializer exists only in the web app, and desktop runs the same code. Mobile has no table copy.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
Real app: I ran an e2e scenario against the real server and web app. It used the free Replay showcase turn, with its table edited locally as above. The scenario clicked Copy table → Copy as CSV and pasted the system clipboard into the composer with Ctrl+V. Base pasted 12 passed0 failed. Head pasted 12 passed 0 failed.
Base
Head
Unit: I added a case, copying a table as CSV, to apps/web/src/markdown-clipboard.test.ts. On the base source it fails with line 1line 2,para 1para 2. On head it passed on 3 consecutive runs (39/39 tests in the file).
I did not check the desktop (Electron) build by hand. It runs the same web serializer.
The edited Replay transcript and the scenario were throwaway files and are not committed, so CI does not run this real-app check.
The unit case also checks that hidden elements (.sr-only, aria-hidden) are left out. I found no chat-rendered table cell where hidden text reaches the copy, so I don't claim that as a user-visible bug.
Authored by Claude Opus 5.5 (Model Hub); reviewed by GPT-6.1 Sol (Codex).
The CSV copy read each cell's raw textContent, so a `<br>` inside a cell
ran its words together ("12 passed0 failed"). It now collects cell text
with the helper Copy as HTML uses and turns each line break or block edge
into a space. That helper also skips hidden UI chrome, matching the
Markdown and HTML copies.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewing files that changed from the base of the PR and between 312025d and 29f2dd1.
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
No actionable comments were generated in the recent review.
Walkthrough
The CSV serializer now collects cell text through the HTML-cell text collector and converts block-edge and line-break markers to spaces. Tests cover header and row output, hidden content, and quoting fields that contain commas.
Changes: CSV cell text serialization
Layer / File(s)
Summary
Collect and validate CSV cell text apps/web/src/markdown-clipboard.ts, apps/web/src/markdown-clipboard.test.ts
csvCellText uses the HTML-cell text collector and replaces block-edge and line-break markers with spaces. Tests check headers, rows, hidden content, and comma quoting.
Copying a table as CSV now keeps separate spaces where cells contain line breaks, so values like "12 passed" and "0 failed" are no longer run together. The change is small, web-only and covered by unit tests. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the fix and the affected behavior: copying a chat table as CSV kept a space at line breaks. The changeset replaces raw textContent collection in csvCellText with collectHtmlCellText, w…
Description check
The description follows the repository template closely. It covers the Problem (raw textContent drops the space at , with a deterministic repro and expected versus observed output), the Change (us…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the fix and the affected behavior: copying a chat table as CSV kept a space at line breaks. The changeset replaces raw textContent collection in csvCellText with collectHtmlCellText, which turns line breaks and block edges into spaces, and adds a CSV test case. The title matches the main change and uses the repo's conventional commit form.
Full details: Description check
Explanation
The description follows the repository template closely. It covers the Problem (raw textContent drops the space at <br>, with a deterministic repro and expected versus observed output), the Change (use of collectHtmlCellText, TeX formulas, hidden-chrome skipping, and the web-only and desktop scope), Scope (small obvious bug, no issue needed under CONTRIBUTING.md), and Verification (real-app e2e with before/after images, unit test results, check:changed exit code, and a list of what was not checked). It also ends with the model and harness line the template requests. Minor gap: the Scope section does not link an issue or a maintainer request, but it gives the reason for omitting one, as the template allows.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between fc1f1ba and 312025d.
Files selected for processing: 2
apps/web/src/markdown-clipboard.test.ts
apps/web/src/markdown-clipboard.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
Evidence: real web app, Chromium, 1280×800, light theme, fresh synthetic data on both commits. Replayed the showcase table with 12 passed<br>0 failed, clicked Copy table → Copy as CSV, then pasted into the composer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:S10-29 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Copy table → Copy as CSV on an assistant message read each cell's raw
textContent. A<br>inside a cell, which GFM tables use for line breaks, adds no text there. So the words on either side ran together in the copied CSV.Deterministic repro on
origin/main(fc1f1bafde): the assistant message must contain this table. A message sent witht3 thread sendrenders as a user message, which shows<br>as literal text and does not reproduce the bug.Click Copy table → Copy as CSV and paste.
Test,execute,12 passed0 failedTest,execute,12 passed 0 failedTo reproduce with the free Replay provider, put that
<br>in the table row of the finalagent_message_chunkinapps/server/scripts/dev-replay/showcase_transcript.ndjson. Then run ashowcaseturn.Change
csvCellTextnow collects cell text withcollectHtmlCellText, the helper that Copy as HTML already uses. CSV turns each line break or block edge it marks into a space, so a cell stays on one line. The helper also outputs formulas as TeX, as the old code did. It skips the hidden UI chrome that the Markdown and HTML copies already skip. The serializer exists only in the web app, and desktop runs the same code. Mobile has no table copy.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
Real app: I ran an e2e scenario against the real server and web app. It used the free Replay showcase turn, with its table edited locally as above. The scenario clicked Copy table → Copy as CSV and pasted the system clipboard into the composer with Ctrl+V. Base pasted
12 passed0 failed. Head pasted12 passed 0 failed.Unit: I added a case,
copying a table as CSV, toapps/web/src/markdown-clipboard.test.ts. On the base source it fails withline 1line 2,para 1para 2. On head it passed on 3 consecutive runs (39/39 tests in the file).vp run check:changedexited 0 (format, lint, knip, typecheck, affected tests, React Compiler).Transcript: https://gist.github.com/saphid/a4d2b09958297ecf722eefd11fd30bbd
Not shown:
.sr-only,aria-hidden) are left out. I found no chat-rendered table cell where hidden text reaches the copy, so I don't claim that as a user-visible bug.Authored by Claude Opus 5.5 (Model Hub); reviewed by GPT-6.1 Sol (Codex).