A11Y: shared PDF preview has no document text for screen readers #741

Open
opened 2026-10-02 13:08:06 +00:00 by kayg · 3 comments
Owner

Source audit from rev-a11y (#427), base c4a61e8cf090170f35b1bed3350d9de20c83ecd5. No product changes or production build were made.

A2 — PDF previews expose page numbers without document text

Priority: P1. Family: shared PDF viewer. Tracking: this issue.
Criteria: 1.1.1 Non-text Content, 1.3.1 Info and Relationships.

Evidence:

  • packages/ui/src/components/viewer/PdfView.svelte:3: the module states
    that there is no text layer.
  • packages/ui/src/components/viewer/PdfView.svelte:74: pdf.js draws each
    page on a canvas.
  • packages/ui/src/components/viewer/PdfView.svelte:111: each canvas has
    only a page-number label and no content alternative.
  • packages/ui/src/components/viewer/QuickLook.svelte:235: Quick Look uses
    this viewer for PDF files.

Effect: a screen reader can find the PDF name and page number, but cannot
read its text in the preview. This applies to Files, Photos and public-link
previews that use Quick Look.

Fix: add a lazy pdf.js text layer and the available document structure.
Keep canvas paint decorative when an equivalent text layer exists. Keep
page loading bounded. For image-only pages, show a real text-unavailable
state and retain Download. Do not invent OCR output.

Test: open a small text PDF in Quick Look. Check that body text and reading
order reach the accessibility tree, that links work with the keyboard, and
that unloaded pages do not allocate all text layers at once.

Duplicate check: searched all-state Forgejo issues for PDF and accessibility. Existing PDF thumbnail/OCR issues do not cover the shared viewer text alternative.

Use the existing component and tests. Check phone (390 px), tablet (820 px) and desktop (1440 px), light and dark, with macOS shortcut rendering. Keep keyboard and pointer motion durations equal; retain reduced-motion support.

Source audit from rev-a11y (#427), base `c4a61e8cf090170f35b1bed3350d9de20c83ecd5`. No product changes or production build were made. ### A2 — PDF previews expose page numbers without document text Priority: P1. Family: shared PDF viewer. Tracking: this issue. Criteria: 1.1.1 Non-text Content, 1.3.1 Info and Relationships. Evidence: - `packages/ui/src/components/viewer/PdfView.svelte:3`: the module states that there is no text layer. - `packages/ui/src/components/viewer/PdfView.svelte:74`: pdf.js draws each page on a canvas. - `packages/ui/src/components/viewer/PdfView.svelte:111`: each canvas has only a page-number label and no content alternative. - `packages/ui/src/components/viewer/QuickLook.svelte:235`: Quick Look uses this viewer for PDF files. Effect: a screen reader can find the PDF name and page number, but cannot read its text in the preview. This applies to Files, Photos and public-link previews that use Quick Look. Fix: add a lazy pdf.js text layer and the available document structure. Keep canvas paint decorative when an equivalent text layer exists. Keep page loading bounded. For image-only pages, show a real text-unavailable state and retain Download. Do not invent OCR output. Test: open a small text PDF in Quick Look. Check that body text and reading order reach the accessibility tree, that links work with the keyboard, and that unloaded pages do not allocate all text layers at once. Duplicate check: searched all-state Forgejo issues for PDF and accessibility. Existing PDF thumbnail/OCR issues do not cover the shared viewer text alternative. Use the existing component and tests. Check phone (390 px), tablet (820 px) and desktop (1440 px), light and dark, with macOS shortcut rendering. Keep keyboard and pointer motion durations equal; retain reduced-motion support.
Author
Owner

Exact module-comment anchor at the audited base c4a61e8cf090170f35b1bed3350d9de20c83ecd5: packages/ui/src/components/viewer/PdfView.svelte:6 states that there is no text layer. This replaces the nearby :3 anchor in the first body. Canvas rendering remains at :74, page-only labels at :114, and Quick Look use at viewer/QuickLook.svelte:235. The final report uses the corrected module-comment anchor.

Exact module-comment anchor at the audited base `c4a61e8cf090170f35b1bed3350d9de20c83ecd5`: `packages/ui/src/components/viewer/PdfView.svelte:6` states that there is no text layer. This replaces the nearby `:3` anchor in the first body. Canvas rendering remains at `:74`, page-only labels at `:114`, and Quick Look use at `viewer/QuickLook.svelte:235`. The final report uses the corrected module-comment anchor.
Author
Owner

Additional source check: the PDF viewer bounds canvas rendering with its existing page observer. Any text layer must use that same bound. I will keep the existing Download action and expose a clear text-unavailable state for image-only PDFs without inventing OCR text.

Additional source check: the PDF viewer bounds canvas rendering with its existing page observer. Any text layer must use that same bound. I will keep the existing Download action and expose a clear text-unavailable state for image-only PDFs without inventing OCR text.
Author
Owner

Started work on job/undo-a11y-a11y, based on 9281e63b0164fd0297d959f37eb0008bfa0aa4d3. Scope: issues #740, #741, #744, #745, #819 and #820. I am reproducing each reported behavior with a regression test before changing implementation.

Started work on `job/undo-a11y-a11y`, based on `9281e63b0164fd0297d959f37eb0008bfa0aa4d3`. Scope: issues #740, #741, #744, #745, #819 and #820. I am reproducing each reported behavior with a regression test before changing implementation.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#741
No description provided.