Closed aroberge closed 3 years ago
This presumable complements https://github.com/friendly-traceback/friendly/issues/3 which suggests a simple collapsible heading that states the error message as the heading with the traceback folded beneath it with a more elaborate ipywidget
. The ipywidget
framework supports two way callbacks between Python and Javascript environments and as such can be used to implement simple applications. What might such widget do / look like?
Perhaps related or useful to help guide thinking about what sorts of interaction or UI are possible are tools such as as nbtutor as well as notebook variable inspectors and debuggers?
What I have in mind is inspired by Thonny's assistant
However, the expandable elements would correspond to friendly's what()
, where()
, why()
, as well as the traceback, all headed by the error message. There would be no need of two-way communications: everything would be computed at once and presented in a collapsed state, ready for expansion.
I have implemented something which is not an iPywidget but works essentially as I was hoping it would. Unfortunately, it does not currently work with the dark theme and I cannot figure out why. More explanations can be found on a blog post I just published.
After reading (again) the documentation about ipywidgets, especially about installing them, I note the following:
Most of the time, installing
ipywidgets
automatically configures Jupyter ...
Users of friendly are generally not expected to be experienced. Installing friendly should "just work", not simply most of the time, but all the time.
So, I will continue to work on an html-based solution, and should explore how rich deals with jupyter in an attempt to create a more robust solution.
Other than for an extra (annoying) vertical space that I cannot seem to be able to get rid of, I am happy with the result shown on https://twitter.com/andre_roberge/status/1420733729497038848
Looks useful:-) My preference would be to reveal the text below, rather than above, the button. With text revealed above, the button moves, with text revealed below the button stays in the same place, (so in the latter case there is less distracting motion).
Ok, I am quite sure I can do this.
Closing this issue as I consider the implementation to be satisfactory.
In Jupyter notebooks and lab, it might be useful to have a custom
iPywidgetinteractive way to have all the information available in a collapsed form. This would allow to no longer recommend the "controversial"* import
.