Skip to content

fix(web): ODT previews no longer print an index's title twice or its entry separators - #40509

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
Michel-Liao:fix/odt-index-source-text
Nov 21, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
Michel-Liao:fix/odt-index-source-text

Conversation

@Michel-Liao

Copy link
Copy Markdown
Contributor

Problem

The Files preview of an OpenDocument text file prints an index's source as if it were content. Open LibreOffice's Tabs-in-TOC.odt test document in Files: "Table of Contents" appears twice. In BibliographyEntryField.odt, the bibliography is preceded by a line of Bibliography: , , : , , : , , ….

ODF stores an index in two parts: the source it is generated from (text:table-of-content-source and its siblings), then the generated body (text:index-body). The source holds a title template and the entry templates, whose fixed separator strings are character data. odfHtml emits the text of any element it does not skip, so it prints the title template before the real title and the entry templates' separators as a run of punctuation. ODF 1.3 part 3 §8.2.1 says the source "contains the information necessary to generate the index content"; the body holds the content.

Change

odfHtml now skips the seven index source elements (table of contents, illustration, table, object, user, alphabetical, bibliography), next to the elements it already skips. That is the complete set in ODF 1.3. The generated body, which holds the title and the entries, is rendered as before.

Limit: an index with a source and no generated body now shows nothing, where main showed the bare template title. pandoc's ODT template writes its table of contents that way, to be generated when the file is opened in a word processor. textutil also prints nothing for it. None of the 77 indexes in the documents I compared lacks a body.

Scope

Small fix for a directly reproducible preview bug, so there is no separate issue. Web and desktop share this reader and mobile has none. Presentations and drawings go through the same function and are unchanged; spreadsheets do not use it. I searched open and closed PRs and issues for ODT indexes, tables of contents, bibliographies and odfHtml and found nothing covering this. Open PR #38542 touches the server's extractor only.

Verification

I found this by running the web reader and textutil -convert txt over LibreOffice's ODT test documents and looking at files where the preview had text that textutil did not.

  • Files panel, web dev client (Chromium, macOS), main and this branch:
Before After
Tabs-in-TOC.odt Files preview with Table of Contents printed twice Files preview with Table of Contents printed once
BibliographyEntryField.odt Files preview with a line of separators before the bibliography Files preview with the bibliography only

The preview's HTML for the first file changed from …<p>c</p>Table of Contents<p>Table of Contents</p>… to …<p>c</p><p>Table of Contents</p>….

  • Real documents: ran main's reader and this one over 1,866 .odt/.ott files (1,176 from LibreOffice's tests, 690 from the ODF Toolkit and pandoc tests) and 930 presentation, drawing and spreadsheet files.
    • 49 ODT outputs change; no other format changes. Every change is a deletion of bare text with identical markup, equal to running main's reader on the same XML with the index sources cut out.
    • 47 of the 49 lose a duplicate of a title that is still shown in the body; 6 lose separator runs; no file loses a title that existed only in the source.
    • Checked against textutil on all 49: 47 match the fixed output. In one of the other two the index sits in a text box and textutil itself prints the title twice; in the other the indexes sit in a footnote, which textutil omits.
  • Test: the existing ODT case now includes all seven index kinds and asserts the page's HTML. It fails on main (<p>Field notes</p>Index: <p>Index</p>… where <p>Field notes</p><p>Index</p>… is expected), fails if any one of the seven names is removed, and passes here. vp test run src/components/files/FilePreviewPanel.test.ts passes 43/43.
  • vp run check:changed passes: format, lint, knip, typecheck, tests and the React compiler check.
  • Not checked: ODT files exported by Word, Google Docs or Pages (the Word-written files in the corpus contain no index, and textutil writes none), and the packaged desktop app. The server's text extractor shows the same duplicate title for attachments; this PR does not touch it.

Written by Claude Fable 5.2 in Claude Code, run from T3 Code.

🤖 Generated with Claude Code

…entry separators

An OpenDocument index (table of contents, bibliography, table of figures
and the other four kinds) is stored as two parts: the source it is
generated from, then the generated body. The ODT preview printed the text
of both, so a LibreOffice table of contents showed "Table of Contents"
twice, and a bibliography was preceded by a run of the separators from
its entry templates (": , , : , , ...").

The reader now skips the seven index source elements and shows only the
index body, which already holds the title and the entries.

Claude Fable 5.2 in Claude Code, running in T3 Code.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d2d90d5 and d0cfc80.

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 ODT preview conversion now omits seven ODF index and bibliography source elements. The ODT test adds fixtures for those types and checks the expected output. ODP assertions remain unchanged.

Changes: ODT index source filtering

Layer / File(s) Summary
Filter index source elements and verify ODT output
apps/web/src/components/files/extendedDocumentPreview.ts, apps/web/src/components/files/FilePreviewPanel.test.ts
odfHtml omits seven ODF index and bibliography source elements. The ODT test adds fixtures for those types and asserts the expected output. The ODP assertions remain unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • pingdotgg/t3code#21469: Adds OpenDocument preview rendering in the web file viewer, which includes the odfHtml path changed here.

Suggested labels: bugfix

Suggested reviewers: geezoria, stienswout, macroscopeapp

Merge Risk: Minimal · previous review d2d90

ODT previews will no longer show an index's title twice or its template separators. The one stated limitation is that an index with no generated body now renders nothing. The change is small and covered by an updated test, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: ODT previews no longer print an index's title twice or its entry separators. The raw summary and objectives confirm that odfHtml now skips seven ODF index source eleme…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section explains the bug with reproduction files and expected behavior. The Change section e…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: ODT previews no longer print an index's title twice or its entry separators. The raw summary and objectives confirm that odfHtml now skips seven ODF index source elements, which removes the duplicate title and separator runs. The title is specific and matches the changeset. Its length (85 characters) is long but acceptable.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section explains the bug with reproduction files and expected behavior. The Change section explains the seven skipped elements and the limit. The Scope section explains why no issue is linked and says the change is a small fix. Verification gives focused tests, a corpus comparison, before/after screenshots, and the checks run. It also states what was not checked. The template asks for a conventional commit title; the title meets this. The description is mostly complete. One gap: the Scope section gives no linked issue. It gives a reason for skipping one, which the template allows for small obvious fixes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • 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 f0ceeef and d2d90d5.

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; 5 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 21, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Real web app, Chromium, light theme, 1440×1000, fresh isolated state on each commit. Seed the two original LibreOffice ODT samples, open a replay thread, then right panel → Files → Tabs-in-TOC.odt → BibliographyEntryField.odt.

The base visibly duplicates the index titles and prints bibliography template separators. The head renders each title and its entries once without that punctuation. scenarios:prove exited 0.

Preview Before After
Commit db9efc5cf0 d0cfc8057e
Table of contents Before: duplicate TOC title After: single TOC title
Bibliography Before: template punctuation and duplicate title After: clean bibliography title and entry

Self-contained scenario with both ODT fixtures

Not shown:

  • Other generated index types and ODP documents were not separately exercised; this visual proof covers the two reported ODT samples in the web client.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 21, 2026
@juliusmarminge
juliusmarminge merged commit 23e6e91 into pingdotgg:main Nov 21, 2026
56 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 21, 2026
@Michel-Liao
Michel-Liao deleted the fix/odt-index-source-text branch November 21, 2026 20:30
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Nov 22, 2026
**v0.1.12-nightly.20261121.5064** · 39 changes from 13 contributors

- **Linear team selection.** Agents can file issues in any Linear team bound to a project.
- **PDF links.** Open links directly from the in-app PDF viewer.
- **Devin commands on Windows.** Devin’s terminal commands now run in Git Bash, so its shell commands work on Windows.
- **Automatic thread settlement.** Threads can now settle automatically and stop project actions configured to stop on settlement.

### Plus 35 more bug fixes and performance improvements.

<details>
<summary>Full changelog</summary>

## What's Changed
* fix(cli): thread --wait --json keeps a result a woken run submits by @Marve10s in pingdotgg/t3code#40360
* fix(issues): agents can file issues in any bound Linear team by @shivamhwp in pingdotgg/t3code#40299
* fix(server): a queued message that names no model runs on the thread's current pick by @juliusmarminge in pingdotgg/t3code#40373
* perf(server): branch list reloads run 6 git processes instead of 9 by @juliusmarminge in pingdotgg/t3code#40376
* perf(client-runtime): Git menu status refresh keeps the branch list when no ref moved by @juliusmarminge in pingdotgg/t3code#40385
* fix(web): picker branch switches no longer re-read the full local status by @juliusmarminge in pingdotgg/t3code#40389
* fix(web): a modified click on a remote server opens it after forwarding by @Marve10s in pingdotgg/t3code#40390
* fix(server): a no-op fetch on Windows no longer re-resolves the base branch by @juliusmarminge in pingdotgg/t3code#40388
* fix(web): CSV preview rows keep their height during horizontal scroll by @Abaans in pingdotgg/t3code#40381
* fix(server): transcript cleanup failures tell the user why by @juliusmarminge in pingdotgg/t3code#40424
* fix(acp): Devin's terminal commands run under Git Bash on Windows, not cmd.exe by @juliusmarminge in pingdotgg/t3code#40418
* fix(server): a delegated task still reaches its parent when its first update fails by @sungyongcho in pingdotgg/t3code#37225
* fix(server): worktree threads start when a checkout hook already linked a nested clone by @juliusmarminge in pingdotgg/t3code#40419
* fix(desktop): a forward moves off a port this machine serves on IPv6 loopback by @Marve10s in pingdotgg/t3code#40423
* fix(web): RTF previews no longer join text across section and column breaks by @Michel-Liao in pingdotgg/t3code#40437
* fix(azure-devops): project-less pull request URLs can be pasted to check out by @Michel-Liao in pingdotgg/t3code#40436
* fix(server): queued messages no longer wait out every timed-out checkpoint in a shared folder by @ExSidius in pingdotgg/t3code#40411
* fix(shell): non-ASCII Windows PATH entries survive the PowerShell environment probe by @lowlyleon in pingdotgg/t3code#37154
* fix(web): scheduled task times follow the Time format setting by @Gooder24 in pingdotgg/t3code#37314
* perf(client-runtime): opening the branch picker keeps the branch list when no ref moved by @juliusmarminge in pingdotgg/t3code#40452
* perf(server): turn end reads upstream divergence once, not twice by @juliusmarminge in pingdotgg/t3code#40450
* fix(shared): file links whose title holds the other quote keep their folder labels by @Michel-Liao in pingdotgg/t3code#40464
* fix(web): RTF previews break the line at TextEdit soft line breaks by @Michel-Liao in pingdotgg/t3code#40468
* fix(mobile): scheduled task Time dialog closes after OK on Android by @juliusmarminge in pingdotgg/t3code#40479
* fix(server): RTF attachments no longer garble text set in a font's own character set by @Michel-Liao in pingdotgg/t3code#40476
* fix(antigravity): match skill manifest filters literally by @Lucenx9 in pingdotgg/t3code#40488
* fix(contracts): older clients drop unknown values in RPC responses by @phorrr in pingdotgg/t3code#40490
* fix(server): Word table cells wrapped in a content control reach the agent by @Michel-Liao in pingdotgg/t3code#40496
* fix(server): a stop-on-settle action no longer holds back automatic settlement by @Marve10s in pingdotgg/t3code#40489
* fix(web): links inside a PDF are clickable in the in-app PDF viewer by @juliusmarminge in pingdotgg/t3code#40507
* fix(web,mobile): Limits shows why a provider's limits are unavailable by @seankd3 in pingdotgg/t3code#40481
* fix(server): preview snapshots no longer report an empty interactiveElements list by @juliusmarminge in pingdotgg/t3code#40520
* fix(web): ODT previews no longer print an index's title twice or its entry separators by @Michel-Liao in pingdotgg/t3code#40509
* fix(web): preserve newer navigation when reopening closed views by @StiensWout in pingdotgg/t3code#40516
* fix(server): ODT attachments no longer repeat index titles or template separators by @Michel-Liao in pingdotgg/t3code#40523
* fix(server): skip symlinks during storage cleanup by @StiensWout in pingdotgg/t3code#40528
* fix(web): keep secret check replies tied to their own attempt by @StiensWout in pingdotgg/t3code#40541
* fix(web): downscaled image attachments keep Display P3 colors by @juliusmarminge in pingdotgg/t3code#40501
* fix(keybindings): preserve sibling shortcuts when editing an inherited rule by @StiensWout in pingdotgg/t3code#40525

## New Contributors
* @Abaans made their first contribution in pingdotgg/t3code#40381
* @sungyongcho made their first contribution in pingdotgg/t3code#37225
* @ExSidius made their first contribution in pingdotgg/t3code#40411
* @Gooder24 made their first contribution in pingdotgg/t3code#37314
* @phorrr made their first contribution in pingdotgg/t3code#40490
* @seankd3 made their first contribution in pingdotgg/t3code#40481

**Full Changelog**: pingdotgg/t3code@v0.1.12-nightly.20261121.5051...v0.1.12-nightly.20261121.5064

</details>


Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.12-nightly.20261121.5064
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants