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): ODS preview keeps shape text out of cell values - #44770
The ODS preview shows the text of a shape anchored to a cell as part of that cell's value.
Steps (Linux, LibreOffice Calc, no sign-in):
In Calc type "Apples" in A2 and "42" in B2.
Insert > Shape > Rectangle over B2, double-click it, type "Recount on Monday".
Right-click the shape > Anchor > To Cell, then save as .ods.
Open the file in the T3 Code file preview: B2 reads "42" with "Recount on Monday" on a second line. A text box over an empty cell shows the box text as that cell's value.
Calc itself shows 42 in B2 and its CSV export of the same file gives Apples,42.
Cause
Calc stores a cell-anchored shape inside the cell's table:table-cell (a draw:custom-shape or draw:frame). In extendedDocumentPreview.ts, the ods branch of openDocument takes the cell value with find(cell, "text:p", "office:annotation"). find walks every child, so it skips comments on purpose but also reaches the text inside the shape.
Change
The cell's paragraphs are now taken from its direct children, skipping office:annotation as before and any draw: element, and still looking inside other children such as text:list. Nine lines added, one removed, in one file.
The shape text is left out of the cell value because it is not cell content. Calc draws the shape as a floating object above the sheet, and the cell's own value (what formulas, sorting and CSV export see) stays 42. The grid preview has no place for floating objects, so this does not drop cell content, it stops mixing a separate object into the cell. The ODT preview already keeps floating shapes apart from the paragraph text in the same way.
Scope
Small fix of an obvious bug, steps reproduce it, so it needs no issue.
Verification
New case in FilePreviewPanel.test.ts, "keeps the text of shapes anchored to an ODS cell out of its value": one cell holds 42 plus a draw:custom-shape with text, and another empty cell holds a draw:frame text box. It expects [["Apples", "42"], ["Pears"]].
Reviewing files that changed from the base of the PR and between 2f97764 and b030d40.
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
ODS cell text extraction now excludes annotation and drawing content. A regression test checks that cell-anchored shape and frame text does not appear in parsed rows.
Changes: ODS Cell Text Extraction
Layer / File(s)
Summary
Cell extraction and regression test apps/web/src/components/files/extendedDocumentPreview.ts, apps/web/src/components/files/FilePreviewPanel.test.ts
Cell extraction skips office:annotation and draw:* children, then collects paragraph text from remaining children. The test checks that cell-anchored shape and frame text is excluded while ordinary cell contents remain.
ODS previews now keep text from cell-anchored shapes out of cell values, and the change is small and covered by a regression test. No actionable merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: ODS preview output no longer puts text from cell-anchored shapes into cell values. It follows the conventional commit format the template suggests. The title matches t…
Description check
The description covers every template section. Problem gives reproduction steps and expected behavior. Change explains the fix and why floating-shape text is excluded. Scope says the fix is small and …
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: ODS preview output no longer puts text from cell-anchored shapes into cell values. It follows the conventional commit format the template suggests. The title matches the changeset, which excludes draw:* children and office:annotation from cell text extraction in extendedDocumentPreview.ts and adds a test in FilePreviewPanel.test.ts.
Full details: Description check
Explanation
The description covers every template section. Problem gives reproduction steps and expected behavior. Change explains the fix and why floating-shape text is excluded. Scope says the fix is small and obvious, so it needs no issue. Verification lists a new focused test, the failing and passing results, the check run, and what was not verified. The model and harness are named at the end, as the template asks. The description has no screenshots, which the template asks for only in UI changes. This fix changes preview output, so the gap is minor and the check passes.
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; 4 remain after this review.
Opened the same LibreOffice-generated stock.ods through Files on fresh app state on each commit. B2 contains numeric 42 with an anchored rectangle saying “Recount on Monday”; B3 is empty with an anchored text box saying “Supplier late”. Web Chromium, 1280×800, light theme.
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: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
The ODS preview shows the text of a shape anchored to a cell as part of that cell's value.
Steps (Linux, LibreOffice Calc, no sign-in):
.ods.Calc itself shows 42 in B2 and its CSV export of the same file gives
Apples,42.Cause
Calc stores a cell-anchored shape inside the cell's
table:table-cell(adraw:custom-shapeordraw:frame). InextendedDocumentPreview.ts, theodsbranch ofopenDocumenttakes the cell value withfind(cell, "text:p", "office:annotation").findwalks every child, so it skips comments on purpose but also reaches the text inside the shape.Change
The cell's paragraphs are now taken from its direct children, skipping
office:annotationas before and anydraw:element, and still looking inside other children such astext:list. Nine lines added, one removed, in one file.The shape text is left out of the cell value because it is not cell content. Calc draws the shape as a floating object above the sheet, and the cell's own value (what formulas, sorting and CSV export see) stays 42. The grid preview has no place for floating objects, so this does not drop cell content, it stops mixing a separate object into the cell. The ODT preview already keeps floating shapes apart from the paragraph text in the same way.
Scope
Small fix of an obvious bug, steps reproduce it, so it needs no issue.
Verification
New case in
FilePreviewPanel.test.ts, "keeps the text of shapes anchored to an ODS cell out of its value": one cell holds42plus adraw:custom-shapewith text, and another empty cell holds adraw:frametext box. It expects[["Apples", "42"], ["Pears"]].Test commit alone, fails on main b4ce58b:
With the fix,
FilePreviewPanel.test.ts: 82 passed (82).vp run check:changed: format, lint, knip, typecheck (2 packages), test (1 file) and React Compiler (1 file) all pass.Not verified: I did not open a real LibreOffice-saved file in the running app; the test uses the XML layout Calc writes for a cell-anchored shape.
Model: Claude Opus 5.5. Harness: Claude Code in T3 Code.