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
When a table cell holds a wrapped Arabic or Hebrew word, or a wrapped mixed-direction word (RTL letters with digits), Copy as PNG draws those lines too far right—overlapping the next column and clipping at the edge.
The export started each wrapped line at its first character (the right edge in RTL text) and drew mixed-direction lines as one piece.
Change
Each piece of a wrapped or mixed-direction word is drawn at its layout rectangle using that run's visual direction, so trailing punctuation stays where layout placed it. Across a soft wrap inside an Arabic word, zero-width joiners preserve cursive shaping so wrapped letters fit without overlapping neighbors. One browser test in tablePng.browser.test.ts covers wrapped RTL text, a mid-word Arabic wrap beside digits, and trailing punctuation on a split RTL run.
Scope
Bug fix for table PNG rendering and clipping touching one production file plus one browser regression test; needs no separate issue.
Verification
Setup: Ubuntu 26.04.1 LTS (Linux x86_64), Chromium 158 (Browser panel), Light theme, 1280×800, fresh isolated data per commit (local Replay table; not a live model run). After PNG captured on 2de371e09899, whose tablePng.ts is byte-identical to f847ab834404 (only the browser test changed).
Steps: Start dev server → open table thread → Copy table → Copy as PNG → paste PNG (1352×512).
…ide cells
When a word wrapped across lines or mixed directions in table PNG export, each segment started from its first character rect instead of the full run rect, shifting right-to-left lines rightward out of their cells. Measure each contiguous run from layout, pass its visual direction to canvas, and preserve Arabic cursive joining across soft line breaks so wrapped pieces stay aligned inside their cells.
Macroscope's review found this PR approvable — Improves wrapped RTL and mixed-direction text placement and Arabic letter joining in copied table PNGs. The change is confined to export rendering, with no material operational or data-handling impact.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between f847ab8 and 34a2293.
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
renderTablePng now tracks direction across visual text runs and handles Arabic joining across soft line breaks. Browser tests check wrapped RTL and mixed-direction text placement and rendering.
Changes: Wrapped text-run rendering
Layer / File(s)
Summary
Track direction and Arabic joining across wrapped runs apps/web/src/components/chat/tablePng.ts, apps/web/src/components/chat/tablePng.browser.test.ts
pushBrokenWord groups graphemes by visual line and direction. It inserts a zero-width joiner across soft line breaks when Arabic characters join on both sides. Browser tests check rendered ink, cell gaps, and punctuation placement.
This change fixes wrapped right-to-left and mixed-direction text in Copy as PNG so it stays inside its table cells. It is limited to one rendering file and has a regression test. The risk of merging is minimal.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: Copy as PNG now keeps wrapped RTL and mixed-direction words inside table cells. It follows conventional commit form with the fix(web) scope and matches the tablePng.ts…
Description check
The description fills every template section: Problem, Change, Scope, and Verification. It gives a clear problem statement, explains the layout-rectangle and zero-width-joiner fix, links the issue-fre…
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 main change: Copy as PNG now keeps wrapped RTL and mixed-direction words inside table cells. It follows conventional commit form with the fix(web) scope and matches the tablePng.ts changes and the browser test in the summary and objectives.
Full details: Description check
Explanation
The description fills every template section: Problem, Change, Scope, and Verification. It gives a clear problem statement, explains the layout-rectangle and zero-width-joiner fix, links the issue-free scope rationale, and reports concrete before/after screenshots, test red/green output, and a check:changed run. It also lists what was not verified (macOS/Windows shells, mobile, dark theme). The template's optional HTML comments are not present, which does not affect completeness. One minor gap: the PR does not state whether a maintainer requested the change, though the scope section allows an obvious-bug explanation instead.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Environment: Linux web client, scenario runner browser at 1280×800, light theme, isolated fresh state with dev seeding disabled; identical Replay data and actions on both commits.
On fresh databases on both commits, created a scratch project and a Replay answer containing Word | Status | Owner | Notes with long unbroken Arabic (العربيةالمتقدمةللاختبار ×8), long unbroken Hebrew, 12345مستقبلمتصل, مرحبا-123, and 12345 plus the long Arabic word. Opened the thread, captured the rendered table, then clicked Copy table → Copy as PNG. Captured and displayed the actual blob passed to navigator.clipboard.write (also forwarding the write to the real clipboard). Inspected both PNG captures and both interaction recordings.
Scenario: Copied PNG keeps wrapped RTL words in their table cells
Visual inspection: base exports shift wrapped Arabic/Hebrew runs across adjacent columns and clip them at the right edge. Head exports keep those runs inside Word, matching the browser layout and leaving Status, Owner and Notes readable.
Not shown:
The separate narrow-cell single-word punctuation case was not exercised; this proof uses the reported five-row table, including its single-line مرحبا-123 row. Fine Arabic joining across soft wraps was visually inspected but not independently compared glyph by glyph.
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:M30-99 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in 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
When a table cell holds a wrapped Arabic or Hebrew word, or a wrapped mixed-direction word (RTL letters with digits), Copy as PNG draws those lines too far right—overlapping the next column and clipping at the edge.
The export started each wrapped line at its first character (the right edge in RTL text) and drew mixed-direction lines as one piece.
Change
Each piece of a wrapped or mixed-direction word is drawn at its layout rectangle using that run's visual direction, so trailing punctuation stays where layout placed it. Across a soft wrap inside an Arabic word, zero-width joiners preserve cursive shaping so wrapped letters fit without overlapping neighbors. One browser test in
tablePng.browser.test.tscovers wrapped RTL text, a mid-word Arabic wrap beside digits, and trailing punctuation on a split RTL run.Scope
Bug fix for table PNG rendering and clipping touching one production file plus one browser regression test; needs no separate issue.
Verification
2de371e09899, whosetablePng.tsis byte-identical tof847ab834404(only the browser test changed).1352×512).616ed6a1b4f9)f847ab834404)Wrapped RTL text shifts over Status and clips right
Wrapped RTL text stays inside its cell
apps/web/src/components/chat/tablePng.browser.test.tsapps/webtablePng.ts)Copy as PNGis web/desktop only)Automated test and check output
Regression test red on base
616ed6a1b4f9:Regression test green on candidate
f847ab834404:vp run check:changed 616ed6a1b4f994baead9bc31da526ecaee6bf9a8onf847ab834404:Generated with Gemini 4 Neon in T3 Code Nightly