fix(document): configure pdf.js wasmUrl so CCITT/JBIG2 scans stop rendering blank (#708) #713

Merged
marcel merged 15 commits from feat/issue-708-pdfjs-wasmurl into main 2026-06-01 21:25:57 +02:00
2 changed files with 12 additions and 3 deletions
Showing only changes of commit e16b7402bd - Show all commits

View File

@@ -170,13 +170,20 @@ function handleAnnotationClick(id: string) {
<p class="font-sans text-sm">Keine Datei vorhanden</p>
</div>
{:else if renderer.error}
<div class="flex h-full w-full flex-col items-center justify-center gap-3 bg-pdf-bg text-ink-3">
<p class="font-sans text-sm text-red-400">{m.doc_render_failed()}</p>
<!-- role="alert" announces the failure to screen readers; the message text
(not colour alone) carries the meaning. The download link is the only
recovery action, so it is sized as a comfortable tap/focus target for
the archive's older readers. -->
<div
role="alert"
class="flex h-full w-full flex-col items-center justify-center gap-3 bg-pdf-bg px-4 text-center text-ink-3"
>
<p class="font-sans text-base text-red-400">{m.doc_render_failed()}</p>
<a
href={url}
target="_blank"
rel="noopener noreferrer"
class="font-sans text-xs text-primary underline hover:text-ink-2"
class="inline-block py-2 font-sans text-sm text-primary underline hover:text-ink-2"
>
{m.doc_download_link()}
</a>

View File

@@ -44,6 +44,8 @@ describe('PdfViewer — render failure', () => {
await expect.element(page.getByText(m.doc_render_failed())).toBeVisible();
await expect.element(page.getByRole('link', { name: m.doc_download_link() })).toBeVisible();
// Announced to assistive tech, not a silent visual-only failure.
await expect.element(page.getByRole('alert')).toBeVisible();
});
it('does not show the failure message when the page renders successfully', async () => {