Closed mrdobalina2k closed 1 month ago
I'm not 100% sure i follow the use case - i'll try to digest it more. But in the meantime, have you see the mo.output.replace/mo.output.append/mo.output.clear
? The allow you to update the cell output (replace/append/clear) before the cell finished.
e.g.
mo.output.replace(mo.status.spinner(title="loading"))
# do things
mo.ouput.replace(mo.md("First result: ", result)
# do more things
result
It's related to the example given in https://github.com/marimo-team/marimo/issues/1271, This works when the action (clicking a button), is inexpensive. However, in my use case I am calling a calculation engine, which takes seconds to return the results. Instead of showing the spinner, it doesn't show up and once the output returns it is gone. I'll take a look at the mo.output, maybe that's what I need..
@mrdobalina2k is this good to close out? not sure if you are still experiencing issues
Describe the bug
Stacked UI elements are not updated when a task is running, which blocks the main thread. This is the case for both async and sync code. For example, I want to create a spinner that pops up conditionally when I press a button, and place that spinner in a stacked configuration. Instead of showing up, the stacked element greys out. I can see the other element where the spinner is created, that it pops up. For async this is not the case.
This occurs on other elements as well, for instance markdown elements.
Environment
{ "marimo": "0.4.10", "OS": "Windows", "OS Version": "11", "Processor": "Intel64 Family 6 Model 126 Stepping 5, GenuineIntel", "Python Version": "3.12.2", "Binaries": { "Browser": "123.0.6312.123", "Node": "v14.16.0" }, "Requirements": { "click": "8.1.7", "importlib-resources": "missing", "jedi": "0.19.1", "markdown": "3.6", "pymdown-extensions": "10.7.1", "pygments": "2.17.2", "tomlkit": "0.12.4", "uvicorn": "0.29.0", "starlette": "0.37.2", "websocket": "missing", "typing-extensions": "4.9.0", "black": "24.3.0" } }
Code to reproduce