Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to output rendering for VSCode. #55

Merged
merged 2 commits into from
Jan 21, 2025
Merged

Conversation

danieldjohnson
Copy link
Collaborator

@danieldjohnson danieldjohnson commented Jan 21, 2025

VSCode's IPython notebook rendering works slightly differently than JupyterLab and Colab. This commit makes a few changes to improve the way Treescope works in this setting:

  • Inserts and removes small amounts of padding, to trigger VSCode to re-evaluate whether "cell output" blocks should be hidden. Previously, VSCode would have false positive and false negatives about which blocks are empty due to Treescope's output-stealing behavior. Adding and removing padding forces VSCode to identify that the temporary output cell is now empty and the final output cell now contains content.
  • Changes the treescope root element to have a white background that extends the full width of the output cell, which can improve appearance when using Treescope to render small values in a dark-mode theme (since Treescope outputs always appear with a white background and dark mode is not yet supported inside a rendering).

Also fixes some errors in building documentation.

VSCode's IPython notebook rendering works slightly differently than
JupyterLab and Colab. This commit makes a few changes to improve the
way Treescope works in this setting:
- Inserts and removes small amounts of padding, to trigger VSCode to
  re-evaluate whether "cell output" blocks should be hidden.
  Previously, VSCode would have false positive and false negatives
  about which blocks are empty due to Treescope's output-stealing
  behavior. Adding and removing padding forces VSCode to identify
  that the temporary output cell is now empty and the final output
  cell now contains content.
- Changes the treescope root element to have a white background
  that extends the full width of the output cell, which can improve
  appearance when using Treescope to render small values in a
  dark-mode theme (since Treescope outputs always appear with a white
  background and dark mode is not yet supported inside a rendering).
Errors while generating docs previously led to silent failures in
the documentation site. This commit fixes the specific failure by
upgrading Penzai, ensuring that it is compatible with new JAX
versions. It also enables error checking to fail documentation builds
if the notebook execution fails.
@danieldjohnson danieldjohnson merged commit 09de497 into main Jan 21, 2025
2 checks passed
@danieldjohnson danieldjohnson deleted the vscode_output_fix branch January 21, 2025 07:30
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.

1 participant