Repository navigation
Title only the live PDF viewer frame during a recompile swap (fixes typst PDF e2e flake) - #873
Merged
Merged
Conversation
…ign two-iframe swap Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…juv0) A recompile loads into a second iframe under the live one and replaces it once it has painted. Both frames carried title="PDF preview", so the e2e locator hit a strict-mode violation whenever it polled inside the swap window (long on loaded CI runners), and assistive tech saw two viewers. A new frame now starts untitled, aria-hidden and inert, and gets the title on promotion. Painting is unchanged: the pending frame is still laid out and drawn underneath, which the readiness gate needs. Tests: a unit test for the live-frame marker, and an e2e repro that holds the second viewer's script via page.route so the swap window stays open. Without the fix it fails with the CI error; the embed spec drops its .first() workaround. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rame (bd-e4q7juv0) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
q2-preview-spa/e2e/typst-pdf-preview.spec.ts› "an edit recompiles the PDF" flaked on #848 (all 3 attempts):The two iframes are intentional. On every recompile,
@quarto/pdf-viewerloads the new PDF into a second iframe underneath the live one. It swaps the new frame in, in a single paint, only once it has drawn a page, so the reader never sees an empty viewer (bd-c72wsugj). Both frames carriedtitle="PDF preview", so the strict locator failed whenever a poll landed in that window. The window is longer on loaded CI runners. Assistive tech also saw two "PDF preview" frames, one hidden and still loading.Fix
aria-hidden="true"andinert. When it's swapped in, it getstitle="PDF preview"and loses the other two. Painting is unchanged: the loading frame is still laid out and drawn underneath, which the swap's readiness check needs. The file header now records that the loading frame must never be hidden with CSS.embed-typst-pdf.spec.tsdrops its.first()workaround, since the selector now matches a single frame.Tests
hub-client/src/pandoc/pdfViewer.test.ts): only the live frame is titled. The loading frame is hidden from assistive tech but not with CSS.typst-pdf-preview.spec.ts): holds the second viewer'sviewer.mjswithpage.route, so the swap window stays open, then reads the text layer inside it. Against a build without the fix, both this test and the existing "an edit recompiles the PDF" fail locally with the CI error.typst-pdf-preview.spec.ts(chromium + firefox) andembed-typst-pdf.spec.ts(embed) pass 20/20, andcargo xtask verify --skip-hub-buildpasses.Plan:
claude-notes/plans/2026-10-20-pdf-preview-iframe-flake.md· braid: bd-e4q7juv0🤖 Generated with Claude Code