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 HTML Renderer #488

Merged
merged 4 commits into from
Mar 29, 2024
Merged

Add HTML Renderer #488

merged 4 commits into from
Mar 29, 2024

Conversation

gjmooney
Copy link
Contributor

@gjmooney gjmooney commented Mar 8, 2024

Describe your changes
Adds an HTML renderer. Users can input HTML strings as the value of the cell and the output will be rendered HTML.

pr_shot

Testing performed
Manual testing and added visual regression tests

@gjmooney
Copy link
Contributor Author

gjmooney commented Mar 8, 2024

Bot update galata references

@paddymul
Copy link

paddymul commented Mar 8, 2024

Out of curiosity, how do you think about security with allowing users to input raw HTML? Are you thinking about any type of disclaimers?

@martinRenou
Copy link
Member

Bot update galata references

The bot does not seem obedient https://github.com/bloomberg/ipydatagrid/actions/runs/8204278156/job/22438628744 ...

Out of curiosity, how do you think about security with allowing users to input raw HTML? Are you thinking about any type of disclaimers?

I guess it would be fair to say that we are not far from the HTML widget situation in ipywidgets. Users can technically already output any HTML they want in the Jupyter notebook. I can also think of the IPython.display HTML output.

@gjmooney gjmooney force-pushed the html_renderer branch 3 times, most recently from 2a43b17 to 66ae40d Compare March 15, 2024 16:39
Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

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

This all looks great! Thanks!

I see one tiny issue, when resizing the column that contains HTML, the HTML content stretches or shrinks weirdly:

Screencast.from.2024-03-20.15-45-51.webm

I suppose that because your HTML content depends entirely on the cell size, we should invalidate the cache as soon as the cell is not the same size. Right now your cache depends only on the cell content, not the cell size.

I'm not sure making the cache dependent on the cell size is the way to go though. Probably let's not cache anything at all?

Signed-off-by: gjmooney <gjmooney@asu.edu>
Signed-off-by: gjmooney <gjmooney@asu.edu>
Signed-off-by: gjmooney <gjmooney@asu.edu>
@gjmooney gjmooney force-pushed the html_renderer branch 2 times, most recently from 9293799 to 4d495ff Compare March 27, 2024 16:12
Signed-off-by: gjmooney <gjmooney@asu.edu>
Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

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

Thanks!!

@martinRenou martinRenou merged commit 43af13f into jupyter-widgets:main Mar 29, 2024
15 checks passed
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.

3 participants