Skip to content

fix preview in notebooks#1007

Open
seeM wants to merge 2 commits into
mainfrom
fix/notebook-preview-3
Open

fix preview in notebooks#1007
seeM wants to merge 2 commits into
mainfrom
fix/notebook-preview-3

Conversation

@seeM

@seeM seeM commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

This fixes a bug where notebooks were failing to preview with error 'No Quarto document available to render'.

The problem is that notebook cell text editors disappear from vscode.window.visibleTextEditors when either the bottom Panel or the Secondary Sidebar are visible. I'm unsure what the cause is, but it seems like a Code OSS bug or perhaps intentional change in behavior.

The fix is to stop requiring a text editor in the notebook case.

QuartoEditor.textEditor is only used in one place today: PreviewManager.detectErrorNavigation which is already skipped for notebooks, so it's safe to remove for notebooks. This allows us to remove the visibleTextEditors check.

Since QuartoEditor still requires a TextDocument reference, we now use the first notebook cell, if one exists.

Fixes #1006.

This fixes a bug where notebooks were failing to preview with error 'No
Quarto document available to render'.

The problem is that notebook cell text editors disappear from
`vscode.window.visibleTextEditors` when either the bottom Panel or the
Secondary Sidebar are visible. I'm unsure what the cause is, but it
seems like a Code OSS bug or perhaps intentional change in behavior.

The fix is to stop requiring a text editor in the notebook case.

`QuartoEditor.textEditor` is only used in one place today:
`PreviewManager.detectErrorNavigation` which is already skipped for
notebooks, so it's safe to remove for notebooks. This allows us to
remove the `visibleTextEditors` check.

Since `QuartoEditor` still requires a `TextDocument` reference, we now
use the first notebook cell, if one exists.

Fixes #1006.
@posit-snyk-bot

posit-snyk-bot commented Jun 15, 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.

@seeM seeM requested a review from vezwork June 15, 2026 06:18
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.

Preview does not work in notebooks when Panel or Secondary Sidebar are visible

2 participants