Daft icon indicating copy to clipboard operation
Daft copied to clipboard

Resize Cell Preview to full extents automatically.

Open everettVT opened this issue 3 months ago • 3 comments

Is your feature request related to a problem?

When you click on a cell, you get this awesome preview of the content whether it be an image or text. Unfortunately resizing the image has to happen manually, which if your images are small, or if your text is large, means your cell preview isn't much more useful than without the preview.

Image

Describe the solution you'd like

When I select a cell, I expect the entire preview cell to be filled with the contents (automatically resized within the frame).

Describe alternatives you've considered

add a resize button?

Additional Context

No response

Would you like to implement a fix?

No

everettVT avatar Aug 31 '25 19:08 everettVT

Text example Image

everettVT avatar Aug 31 '25 19:08 everettVT

This might be a google colab thing

everettVT avatar Sep 01 '25 17:09 everettVT

It's a google colab thing.

The way the .show preview works is by starting a local http server to serve the cell data. When you click on a cell, it makes a request for the full content. The rationale behind this client-server model is to prevent unnecessary rendering of large strings or images.

However, this doesn't work on colab as the server will be remote. The fallback right now is to just render the existing cell html in the preview popup.

If you'd like to play with it, the code for the table display is here https://github.com/Eventual-Inc/Daft/blob/main/src/daft-dashboard/src/lib.rs#L163

Update: We can leverage google.colab.output.serve_kernel_port_as_iframe(3238, cache_in_notebook=True) to do the tunnelling for us

colin-ho avatar Sep 02 '25 16:09 colin-ho