Skip to content

Fix tiny, broken plots in Quarto and notebook consoles#14866

Open
jmcphers wants to merge 8 commits into
mainfrom
bugfix/notebook-console-plots
Open

Fix tiny, broken plots in Quarto and notebook consoles#14866
jmcphers wants to merge 8 commits into
mainfrom
bugfix/notebook-console-plots

Conversation

@jmcphers

@jmcphers jmcphers commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Fixes #11142
Fixes #11104

When you plot from a notebook console, the plot showed up as a tiny thumbnail, and the "Inspect" gesture that offered to open it in the Plots pane did nothing. This PR makes notebook console plots actually usable. They're now big enough to work with and Inspect works:

image

Summary

  • Notebook console plots now show up in the Plots pane. Static plots from a notebook session are surfaced in the Plots pane once a console is attached, so the "Inspect" gesture works. They're added quietly, without stealing focus by raising the pane. Plain notebooks (no console) still render inline and are left alone.
  • The console preview is bigger and configurable. A new setting, console.notebookPlotPreviewHeight, controls how tall the preview is (default 200px). Set it to 0 to turn previews off entirely. The preview resizes live when you change the setting.
  • Clicking a plot links back to its source. Plots now remember where they came from, so clicking the session-name button in the Plots pane navigates to the source document and the exact line that produced the plot (e.g. the Quarto chunk), instead of just opening the file. We don't offer this for notebook cells and .ipynb files, which can't be revealed as text.
  • Clicking a cleared preview brings the plot back. The console keeps showing a preview even after you clear the Plots pane. Clicking it now recreates the plot and reselects it, instead of doing nothing.

Release Notes

New Features

  • N/A

Bug Fixes

Validation Steps

@:quarto @:plots @:ark

Covered by the new e2e test test/e2e/tests/quarto/quarto-inline-output-plot-attribution.test.ts and unit tests (positronPlotsService.vitest.ts, plotUtils.vitest.ts, activityOutputPlot.vitest.tsx).

Manual check:

  1. Turn on notebook consoles (console.showNotebookConsoles).
  2. Open a notebook (or Quarto doc), open its console, and run a command that emits a plot.
  3. Confirm the plot previews in the console at a usable size, and also appears in the Plots pane without the pane stealing focus.
  4. Hover the preview and use "Inspect" -- confirm it opens the plot in the Plots pane.
  5. In the Plots pane, click the plot's session-name button. Confirm it navigates to the source document and the line that produced the plot.
  6. Clear the Plots pane, then click the console preview. Confirm the plot comes back and is reselected.
  7. Set console.notebookPlotPreviewHeight to 0 (previews hidden) and to e.g. 300 (previews resize live).

@jmcphers
jmcphers requested a review from nstrayer July 14, 2026 21:18
@jmcphers jmcphers changed the title Bugfix/notebook console plots Fix tiny, broken plots in Quarto and notebook consoles Jul 14, 2026
@github-actions

Copy link
Copy Markdown

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:quarto @:plots @:ark @:console @:sessions @:interpreter

Why these tags?
Tag Source
@:critical Always runs (required)
@:quarto PR description
@:plots PR description
@:ark PR description
@:console Changed files
@:sessions Changed files
@:interpreter Changed files

More on automatic tags from changed files.

readme  valid tags

@nstrayer nstrayer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

forefront.plot.mov

Tested and things work as expected. One thing I noticed while testing that I couldn't tell if it was desired behavior or not. (Video above)

When you run a plot from the notebook after you've already done an existing plot from the console, the notebook plot shows up in both the notebook and the plots pane. It makes sense why it would happen, but I could see why maybe you'd want the plot to not steal the plots pane when you just run it in the notebook itself. I don't know if you still put it in the plots pane, but maybe go back and select a previous plot from the console or not. It's a tricky question.

@jmcphers

Copy link
Copy Markdown
Collaborator Author

the notebook plot shows up in both the notebook and the plots pane.

That's a really good point. I did do this on purpose, with the theory that people might like to be able to browse the Plots pane to review/compare visualizations (@jthomasmock has mentioned this a few times) that originated in the notebook. In particular it can be useful to have the Plots pane side by side with the Notebook to compare a previous plot with a new one.

But if you have the Plots pane up and the Console pane up and the Notebook up, it is a little infelicitous (© @jennybc) for the plot to show up in THREE PLACES AT ONCE. It makes sense for each individual location but all of them at once might be too much. We'll see what feedback we get!

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.

Notebook consoles: Plots rendered as tiny, useless thumbnails with broken inspector Inline display of plots in Console

2 participants