Skip to content

fix(web): keep OpenDocument image descriptions in alt text - #41383

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
geezoria:fix/odf-preview-image-description
Nov 23, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
geezoria:fix/odf-preview-image-description

Conversation

@geezoria

Copy link
Copy Markdown
Contributor

Problem

The Files preview renders OpenDocument image descriptions as visible document text and leaves the image's alt empty. Open the OASIS accessibility guidelines ODT in Files to see “OASIS logo” appear between the image and the heading.

Change

The shared OpenDocument renderer reads a frame's SVG-compatible title and description and puts them in the image's escaped alt attribute. It excludes those metadata elements from the document text and preserves ordinary captions.

Scope

Small bug fix in the shared ODT and ODP preview renderer. The public ODT fixture reproduces the defect directly.

Verification

  • The regression test failed on upstream main with an empty alt and visible metadata. It passes with the fix and covers XML namespace aliases, escaped attribute text, and caption preservation.
  • vp test run apps/web/src/components/files/FilePreviewPanel.test.ts passed all 45 tests, and vp run check:changed origin/main passed.
  • In Chromium on Windows, I opened the same OASIS ODT in Files before and after the change. The embedded GIF and heading remained visible, the stray text disappeared, and the image's DOM alt became OASIS logo. The browser check used the ODT fixture.
Before After
OpenDocument preview with OASIS logo text before the heading OpenDocument preview with the heading and logo image

Implemented and verified with GPT-6.2-Sol in T3 Code through the Codex harness.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 23, 2026
@coderabbitai

coderabbitai Bot commented Nov 23, 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 b78731d and 04bddb8.

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

ODF previews now use frame title and description text as escaped, bounded image alt text. The preview suppresses these metadata nodes. A test checks the alt text and visible caption.

Changes: ODF image descriptions

Layer / File(s) Summary
Frame metadata to image alt text
apps/web/src/components/files/extendedDocumentPreview.ts, apps/web/src/components/files/FilePreviewPanel.test.ts
The renderer extracts nonempty title and description text from each frame and applies it to child images’ escaped, bounded alt attributes. It suppresses title and description nodes from rendered content. The test checks the combined alt text and visible caption.

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

Change: Bug fix

Suggested reviewers: stienswout, michel-liao, juliusmarminge

Merge Risk: Minimal · previous review b7873

This fixes OpenDocument image descriptions showing up as visible text in Files previews by moving them into image alt text. The change is small and localized to the preview renderer, and no concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(web): keep OpenDocument image descriptions in alt text" names the main change: the shared ODT/ODP renderer now moves SVG title and description of a draw:frame into the image alt attribu…
Description check Passed The description follows the template sections (Problem, Change, Scope, Verification). It states the bug and reproduction steps with a public ODT fixture. It explains the fix and why the metadata is ex…
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 "fix(web): keep OpenDocument image descriptions in alt text" names the main change: the shared ODT/ODP renderer now moves SVG title and description of a draw:frame into the image alt attribute and hides them from document text. It follows the conventional commit format the template asks for, and it is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description follows the template sections (Problem, Change, Scope, Verification). It states the bug and reproduction steps with a public ODT fixture. It explains the fix and why the metadata is excluded from document text. It bounds scope to a small bug fix and links no issue. It reports focused test results (regression test, 45-test file run, check:changed) and a Chromium before/after check with screenshots. The template's required issue link is missing, but the author gives a reason, and the author also cites the PR objectives' issue number only in the title. The description is mostly complete.

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 910ea8a and b78731d.

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

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

Copy link
Copy Markdown
Member

Evidence

Opened the reported OASIS ODT from the Files panel in the real web app on both commits, using fresh isolated state, identical document bytes, Chromium at 1280×800, and light theme.

The scenario failed on base because the logo had alt=""; it passed on head with alt="OASIS logo" and no visible description prose.

Before — 977b7c7932 After — 04bddb802b
Before: OASIS logo description appears as stray prose After: logo remains and description prose is removed

Self-contained reproduction scenario

Not shown:

  • ODP previews, combined frame title and description metadata, and preservation of ordinary captions were not separately exercised; the supplied reproduction covers an ODT frame with description metadata.

@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 23, 2026
@juliusmarminge
juliusmarminge merged commit fd44bde into pingdotgg:main Nov 23, 2026
56 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 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