Skip to content

Show Positron's Viewer stop button for Quarto previews - #1193

Open
juliasilge wants to merge 2 commits into
mainfrom
feature/preview-panel-stop
Open

juliasilge wants to merge 2 commits into
mainfrom
feature/preview-panel-stop

Conversation

@juliasilge

Copy link
Copy Markdown
Collaborator

In Positron, the Viewer now shows a stop button for Quarto previews. Before this PR, the only way to stop quarto preview was to find the Quarto Preview terminal and press Ctrl+C or close the terminal.

Screenshot 2026-10-12 at 6 21 49 PM

The Positron PR adds PreviewPanel.stoppable and onDidRequestStop to the Positron API. The extension sets stoppable while the preview server runs, and Positron shows the button and reports clicks. Quarto starts and stops the server, so Quarto decides when the button shows.

The extension uses feature detection ("onDidRequestStop" in panel), not a version check. On older Positron versions and in VS Code, nothing changes. A local type covers the new members until @posit-dev/positron ships them, so engines.positron does not change.

Some known limitations:

  • Without shell integration (for example, the Windows cmd path), Ctrl+C in the terminal leaves the button visible until the terminal closes. A click on this button does no harm, and it closes the preview.
  • A re-render restarts the server. If the user clicks stop during this short time, the new server can still start and open the preview again. A second click stops it.

Verification

  • yarn build-test: passes, including tsc --noEmit.
  • yarn test (label main): the 6 new tests pass. 178 passing, 3 pending, 1 failing. The failure is the notebook renderer build test, which fails on stale chunks in my local out/markdownit. This PR does not change that code.
  • ESLint on the changed files: no new warnings.
  • Manual test in Positron, built from the branch of the Positron PR:
    • Preview a document. The stop button shows on the right side of the Viewer toolbar.
    • Save the document. The button stays, and the toolbar does not move.
    • Click stop. The server stops, the terminal closes, and the preview closes.
    • Press Ctrl+C in the Quarto Preview terminal. The button goes away, and the preview stays.
    • Close the Quarto Preview terminal. The button goes away.

@posit-snyk-bot

posit-snyk-bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@juliasilge
juliasilge requested a review from seeM October 15, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants