GeezerVison is showing github.com — fix(web): ODT footnotes no longer split the paragraph in previews by only21mil · Pull Request #44624 · pingdotgg/t3code
Conversation
Problem
An ODT preview splits a sentence wherever it has a footnote or endnote. The note's paragraph is emitted inside the surrounding one, so Left on Monday<note>Check the seals.</note> and arrived. renders as three blocks, with the mark as a plain "1" glued to the word. The DOCX preview lays notes out at the page bottom, and #44366 handled notes in attachment text, but the web ODT preview had no case for text:note.
Change
odfHtml now handles text:note (ODF 1.3 §6.3.2–6.3.4). The citation stays inline as <sup>. The note body is collected and added after the page behind an <hr>, starting with the same mark: inside its first paragraph, or on its own line when the note starts with a heading, list or table. Leading whitespace from indented XML is ignored. An ODT preview is one page, so footnotes and endnotes both land at its end, in document order. <sup> and <hr> are already allowed by the sanitizer. The body is moved, not copied, and everything the note list adds, including the second copy of the mark, counts against the existing markup budget.
Scope
A small fix for an obvious rendering bug in any ODT file with a footnote, so it needs no issue. It touches only extendedDocumentPreview.ts and its ODT tests.
Verification
- The existing
reads odt text test now puts a footnote and a heading-only endnote in a paragraph. On base production code it fails with <p>Field notes1\n <p>Sourced on site</p> todayi<h2>Appendix</h2></p>…. On this branch it passes with <p>Field notes<sup>1</sup> today<sup>i</sup></p>…<hr><p><sup>1</sup>Sourced on site</p><p><sup>i</sup></p><h2>Appendix</h2>.
- A new test gives a footnote a citation whose escaped mark is just over half the 16 MiB preview limit. It expects
rendered-too-large, because the mark appears twice. It fails on base and on a version that counted only the inline mark, and passes here (68/68).
vp run check:changed passes.
Setup: T3 Code web dev server, Chromium, light theme, 1280×800, fresh isolated data on each commit, and a synthetic ODT with two footnotes and one endnote placed mid-sentence. The server is named "Test machine".
Steps: open the project → Files → field-report.odt → maximize the panel → hide the file explorer.
Before (0f8aa4c6) |
After (da5d6d90) |
 |
 |
| Each sentence is cut in two around its footnote text, with marks shown as plain characters |
Each sentence stays whole with superscript marks, and the notes follow a rule at the end |
Not shown
- Dark theme, the desktop and mobile shells, and ODP files. ODP pages go through the same page loop, but Impress does not write
text:note footnotes.
- Marks and notes are not linked to each other. The preview's sanitizer strips
href and id.
Generated with Gemini 4 Neon in T3 Code Nightly
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
ODF previews now render footnote and endnote citations inline and append note bodies to page HTML. The renderer resets collected notes for each document and applies the rendered-markup size limit to note content.
Changes: ODF Note Rendering
| Layer / File(s) |
Summary |
Collect and render ODF notes apps/web/src/components/files/extendedDocumentPreview.ts, apps/web/src/components/files/FilePreviewPanel.test.ts |
The renderer displays note citations as superscript and appends note bodies after a separator. It resets collected notes for each document and applies the rendered-markup size limit. Tests cover footnotes, endnotes, and oversized citations. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: michel-liao, iamshadmantaqi, geezoria
Merge Risk: Minimal · up to da5d6
-
ODT previews now show footnotes and endnotes inline and below the text instead of splitting paragraphs. The change is limited to the preview renderer, is covered by tests, and I found no concrete risk that blocks merging.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: ODT footnotes no longer split the paragraph in previews. This matches the raw summary, which says note bodies are moved out of the paragraph flow and citations stay in… |
| Description check |
 |
The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section gives the expected behavior and a reproduction example. The Change section explains how the… |
| 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: ODT footnotes no longer split the paragraph in previews. This matches the raw summary, which says note bodies are moved out of the paragraph flow and citations stay inline in extendedDocumentPreview.ts. The title is a conventional commit with a clear scope, so it is specific enough for a teammate scanning history.
Full details: Description check
-
Explanation
The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section gives the expected behavior and a reproduction example. The Change section explains how the fix works. The Scope section explains why no issue is linked and cites #44366 as related prior work. The Verification section lists specific tests, results, and a before/after comparison with screenshots. The description does not include the template's agent-model footer in the required form. It does include 'Generated with Gemini 4 Neon in T3 Code Nightly', which partly meets that line. The 'Not shown' section lists what was not checked. Overall the description is mostly complete.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 4765c96 and da5d6d9.
Files selected for processing: 2
-
apps/web/src/components/files/FilePreviewPanel.test.ts
apps/web/src/components/files/extendedDocumentPreview.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks for this. Main already has the change, as of 29886e2.
This change is already on main in 29886e2. It includes the inline citations, collected note bodies, and markup-limit regression coverage from your submission.
Your pull request has already been merged, so no further submission or review handoff is needed.
Closing as superseded.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|