Skip to content

fix preview in notebooks#1007

Merged
seeM merged 5 commits into
mainfrom
fix/notebook-preview-3
Jun 18, 2026
Merged

fix preview in notebooks#1007
seeM merged 5 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.

@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
@seeM seeM mentioned this pull request Jun 17, 2026
@seeM seeM requested a review from juliasilge June 17, 2026 15:36

@vezwork vezwork left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment thread apps/vscode/src/core/doc.ts

@juliasilge juliasilge left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is working well for me!

Comment thread apps/vscode/CHANGELOG.md Outdated
seeM added 5 commits June 18, 2026 09:45
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.
@seeM seeM force-pushed the fix/notebook-preview-3 branch from b1f6bdb to 9630827 Compare June 18, 2026 07:54
@seeM seeM merged commit ad1db8c into main Jun 18, 2026
5 checks passed
@seeM seeM deleted the fix/notebook-preview-3 branch June 18, 2026 07:58
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.

Render/Preview fail in notebooks that are visible but not active or when Panel/Sidebar are visible

4 participants