docs: document embedded viewer preview-testing harness - #14870
Merged
Merged
Conversation
Adds a reference for testing code in src/webui/quarto-preview/src/frame/ that only runs inside an embedded viewer (RStudio Viewer, VS Code Simple Browser, Posit Workbench) - a plain top-level preview never exercises it. Covers the iframe + postMessage host page pattern, a throwaway reverse proxy for reproducing a proxied deployment's browser/server origin mismatch, the server's sticky first-request client-injection detection, and the precondition assertion needed before trusting any click result.
Collaborator
✅ 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. |
The harness reference told testers to pre-render the project and to avoid a leading underscore on the parent page. Both were wrong: verified on a website project that `quarto preview` copies files declared under `project.resources:` to the output directory on its own, including `_host.html`, and serves them without consuming the first-request client-injection detection. The underscore exclusion applies to input-file and YAML discovery, not to explicitly declared resources. Also records why a static parent is safe at all (the server only injects into output files that map back to an input) and adds --no-browser, without which the auto-opened browser makes the unmarked first request itself.
…ness The previous wording only warned against unmarked requests to rendered paths, but the 404 handler in src/project/serve/serve.ts also calls injectClient. Verified: a single unmarked request to a missing path, sent before the marked iframe request, leaves the injected options empty (origin: "", search: "") - the same symptom the section already documents a restart for. The control case, requesting the already-copied static parent page first, keeps them populated. Readiness now waits on the preview output rather than an HTTP poll, since the poll is itself the unmarked request and the parent page's path 404s until the first render finishes.
Nothing under .claude/ (skills, rules, commands, agent memory files) can affect build or test outcomes, so running smoke, bundle, feature-format, latexmk and performance jobs for those PRs burns runner time for no signal. test-install.yml keeps its paths allowlist and already never matched.
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.
Verifying #14869 needed a way to exercise code in
src/webui/quarto-preview/src/frame/that only runs inside an embedded viewer (RStudio Viewer, VS Code Simple Browser, Posit Workbench). A plain top-level preview never reaches it, and quarto-cli has no e2e test that startsquarto previewat all (tracked in #10696).Adds a reference to the
quarto-preview-testskill covering the iframe + postMessage host page pattern, a throwaway reverse proxy for reproducing a proxied deployment's browser/server origin mismatch, the server's first-request client-injection detection, and the precondition assertion needed before trusting any click result.Related to #14869, #10696.