widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.9k stars 140 forks source link

Debounce loading bar #143

Closed jonmmease closed 1 year ago

jonmmease commented 1 year ago

Thanks to the fix in https://github.com/widgetti/solara/issues/142, VegaFusionWidget is now working in Solara 🎉

Here's what the example from that issue looks like now:

https://github.com/widgetti/solara/assets/15064365/86433232-e06f-4721-a840-0b98442f9364

Each time the chart's brush selection is moved, a traitlet property is assigned to send a message from the client to the server. And then after the server processes the message it assigns to another traitlet property to send the new chart state back to the client.

This happens so fast that Solara's top loading indicator flashes in a distracting way. Would it be possible to debounce this, so that the loading indicator only shows up if there's a delay of more than a few hundred milliseconds?

maartenbreddels commented 1 year ago

I agree, this doesn't look nice. What do you think the behaviour should be? Should we not show it at all except when the response takes something like >300ms (possibly configurable).

jonmmease commented 1 year ago

Should we not show it at all except when the response takes something like >300ms (possibly configurable).

Yeah, that's exactly what I was thinking

maartenbreddels commented 1 year ago

Fixed in 1.16.2 Thanks for you feedback!