-
Notifications
You must be signed in to change notification settings - Fork 949
ENH: Give a clearer error for widget js. #1674
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
ENH: Give a clearer error for widget js. #1674
Conversation
Adds a new 'text/html' entry in the mimebundle for widgets, which points users to the installation instructions in the widgets docs.
cc @jasongrout |
Nice! That's much clearer. |
+1. @pbugnion, can you review and merge if it looks good to you? |
ipywidgets/widgets/widget.py
Outdated
<p>Failed to display Jupyter Widget of type <code>{widget_type}</code>.</p> | ||
<p> | ||
If you're reading this message in Jupyter Notebook or JupyterLab, it probably means that | ||
the widgets Javascript library is either not installed or not enabled. See |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be JavaScript, rather than Javascript? That's how Wikipedia spells it.
ipywidgets/widgets/widget.py
Outdated
<p> | ||
If you're reading this message in Jupyter Notebook or JupyterLab, it probably means that | ||
the widgets Javascript library is either not installed or not enabled. See | ||
the <a href=http://ipywidgets.readthedocs.io/en/latest/user_install.html>Jupyter Widgets Documentation</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use https rather than http for the protocol of the URL.
If you reopen a notebook that contains lots of widgets, or contains some widgets that take a long time to render, this message will be displayed until the widgets have finished rendering. The user might think their installation is broken, whereas they actually just need to wait. Maybe we can change the copy to include this? e.g. If you're reading this message in Jupyter Notebook or JupyterLab, your widget is either still loading, or the widgets Javascript library is either not installed or not enabled. |
Interesting. Is there any way to distinguish between these cases on the frontend side and show a different representation (e.g. a loading spinner) when the javascript is still loading? Ideally I'd want to avoid giving the user too many different possible cases to think about if we can. |
@pbugnion updated with your feedback: I still think it'd be nice to try to distinguish the cases mentioned in #1674 (comment), but that's probably a larger piece of work and shouldn't block this improvement IMO. |
I'll open a new issue to discuss showing a loading icon while the widget manager is rebuilding its state after loading.
I definitely agree. Thanks for this! |
This reverts jupyter-widgets#1674, since we discovered some problems with the classic notebook and html outputs. Fixes jupyter-widgets#1777 Fixes jupyter-widgets#1951
Adds a new 'text/html' entry in the mimebundle for widgets, which points
users to the installation instructions in the widgets docs.