Skip to content

Delete html fallback message. #2007

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

Merged
merged 3 commits into from
Mar 23, 2018
Merged

Conversation

jasongrout
Copy link
Member

This reverts #1674, since we discovered some problems with the classic notebook and html outputs.

Fixes #1777
Fixes #1951

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
@jasongrout
Copy link
Member Author

I'll also add a docs page explaining what to do if you see this, but were hoping to see widgets, basically containing the helpful text here.

@jasongrout jasongrout added this to the 7.2 milestone Mar 20, 2018
@vidartf
Copy link
Member

vidartf commented Mar 21, 2018

Note: The repr in the plain text mimetype isn't always nice and clean (it can become quite large for complex widgets). As such, I'm not sure if this is a good fix for #1951.

@jasongrout
Copy link
Member Author

jasongrout commented Mar 22, 2018

Note: The repr in the plain text mimetype isn't always nice and clean (it can become quite large for complex widgets). As such, I'm not sure if this is a good fix for #1951.

Good point. Can we try it out and see? At least it's informative of what you're missing, instead of boilerplate text that gets repetitive after a while.

@vidartf
Copy link
Member

vidartf commented Mar 22, 2018

Can we try it out and see?

If this is only intended as a stop-gap measure until #1777 / jupyter/notebook#2980 gets fixed, then sure. My preferred long-term solution would be a short HTML entry with a link to an entry in the docs describing the possible causes of seeing the message.

Use case where the repr is longer than the current message: pythreejs, e.g. https://github.com/jovyan/pythreejs/blob/master/examples/Animation.ipynb

Copy link
Contributor

@mwcraig mwcraig left a comment

Choose a reason for hiding this comment

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

This seems fine as a temporary workaround.

I agree with Vidar about where we want to end up eventually.

@@ -708,7 +708,6 @@ def _ipython_display_(self, **kwargs):
# http://www.iana.org/assignments/media-types/media-types.xhtml.
data = {
'text/plain': repr(self),
Copy link
Contributor

Choose a reason for hiding this comment

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

If we want to ensure this never gets too big, how about repr(self)[:160] (or some other appropriate number).

Copy link
Member

Choose a reason for hiding this comment

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

I think it is nice to have the full repr available, I'm just arguing whether that should be the fallback format or not.

Copy link
Member Author

Choose a reason for hiding this comment

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

Since you can always do repr() to get the full repr, I think chopping it off (and appending an ellipsis) is a good compromise for the fallback.

@jasongrout
Copy link
Member Author

My preferred long-term solution would be a short HTML entry with a link to an entry in the docs describing the possible causes of seeing the message.

+1

This prevents huge text output when it is a fallback. Length 110 is chosen as it fits on a single line in the classic Notebook.
@jasongrout
Copy link
Member Author

I just elided anything over length 110 characters - that's enough to fit on one line in the classic notebook. I think it looks all right for a fallback. What do you think?

screen shot 2018-03-23 at 12 47 27 pm

@mwcraig
Copy link
Contributor

mwcraig commented Mar 23, 2018

LGTM

@jasongrout
Copy link
Member Author

@vidartf?

@vidartf
Copy link
Member

vidartf commented Mar 23, 2018

As long as we agree on the long term solution, I'm happy with the suggested solution.

@jasongrout
Copy link
Member Author

Great, thanks!

@jasongrout jasongrout merged commit e1e0948 into jupyter-widgets:master Mar 23, 2018
@github-actions github-actions bot added the resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Feb 7, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide Jupyter "Failed to display Jupyter Widget" on Github mathjax affects dropdown options inconsistently
3 participants