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

Add explicit message to non-trusted cell output, with instructions on how to make it trusted #15467

Open
janpfeifer opened this issue Dec 1, 2023 · 3 comments

Comments

@janpfeifer
Copy link

janpfeifer commented Dec 1, 2023

Context:

[1] Jupyter Forum: Jupyterlab not remembering trust for notebooks
[2] Jupyter Forum: SVG either not loading right, or not exporting to HTML?

Problem

Notebooks created with rich content (SVGs, videos, etc), when re-opened in fresh JupyterLab installs (like a docker), don't display their rich content, or in case of SVG, display it as garbled text.

This is because the notebook is marked as non-trusted, but users won't know it.

Example:

(1) How SVG should be displayed (original rendering from Github)

image

(2) How it is displayed when notebook is opened by the user in a pre-built docker with a fresh JupyterLab:

image

Most users won't know the concept of "trusted notebook", nor will they know how to make the notebook trusted -- it requires knowing there is a "Command Palette" in JupyterLab, and then knowing what to search for.

So effectively is appears broken to the users.

Proposed Solution

Whenever an output cell is not displayed (or garbled text is replaced) because it is not trusted, instead display a simple warning box with "Output not displayed, notebook not trusted. To mark notebook as trusted do X (or click here)".

Additional context

Issue observed in vanilla Jupyter 4.0.9

Copy link

welcome bot commented Dec 1, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Dec 1, 2023
@krassowski
Copy link
Member

To clarify, in JupyterLab 4.0.x this only happens when opening a notebook created or recently edited on another machine. This means that users who spawn a new docker image every day, or pull notebooks from a repository (like GitHub) will face this issue.

Whenever an output cell is not displayed (or garbled text is replaced) because it is not trusted, instead display a simple warning box with "Output not displayed, notebook not trusted. To mark notebook as trusted do X (or click here)".

Adding a shield icon in the output corner with explanation on hover (and click opening a dialog to trust output) on output may be a better trade-off between preserving current user expectations and improving the problematic behaviour.

Most users won't know the concept of "trusted notebook", nor will they know how to make the notebook trusted -- it requires knowing there is a "Command Palette" in JupyterLab, and then knowing what to search for.

True, we should improve it. Of note we already cover it in user documentation: https://jupyterlab.readthedocs.io/en/latest/user/notebook.html#trust

@janpfeifer
Copy link
Author

janpfeifer commented Dec 1, 2023

THanks @krassowski !

Just to clarify, the example case is: I created a demo docker with JupyterLab and many demo GoMLX (my project) notebooks with code and results, including plots. When someone pulls the demo docker and opens the notebooks, the plots show garbled text. I update the demo Docker at each release, so once a month or something.

Coincidentally, I also happen to co-develop on 2 machines (laptop and desktop) so it's possible I bump more often into this issue as you mentioned. But I assume this is not such an uncommon case ?

+1 to the idea of a shield icon: the more visible the better, since it's likely a condition that deserves attention -- things are being hidden / garbled for a good reason.

About it being documented: most folks don't read it (surely not to the end, it's the last item in the doc), and without someone telling users what to search for ("trust") very few people would find it ... Actually, many users may just not realize that things are not being displayed at all (due to lack of trust) or assume the garbled text is an issue with the notebook and not with Jupyter+Trust status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants