-
Notifications
You must be signed in to change notification settings - Fork 4k
Show elapsed time on st.spinner
#10072
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
Conversation
st.spinnerst.spinner
st.spinnerst.spinner
|
❤️ Just going from the screenshot, if we go into minutes, I think we should reduce the precision of seconds. (So, if we go past a minute, it would be "1 minute, 13 seconds" instead of "1 minute, 13.1 seconds" to avoid visual noise. Or maybe switch to a timer format after a minute, or ten minutes? (00:11:13 with seconds ticking up is clear.) |
Yeah I tried that but it looks so boring if it only updates once a second :D Looks like nothing is happening. I also don't want to use another style because it looks a bit annoying if the format suddenly switches while it's running. |
|
@lukasmasuch I think this is ready for a 2nd look and approval. There's one small open question around |
lukasmasuch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of small things, but otherwise looks good 👍
## Describe your changes Adds a parameter `show_time` to `st.spinner`. If set to True, the spinner shows the elapsed time in a small gray font next to the spinner text. Defaults to False (i.e. same behavior as today).  If we're going towards minutes and hours, the timer text will be formatted nicely:  ## GitHub Issue Link (if applicable) Closes streamlit#6805 ## Testing Plan Added unit tests for JS and Python and one simple e2e test. I tried to make it not flaky but since that checks what's displayed after one second, we need to see in practice whether it's flaky and potentially adapt. --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license. --------- Co-authored-by: Johannes Rieke <[email protected]>
Describe your changes
Adds a parameter
show_timetost.spinner. If set to True, the spinner shows the elapsed time in a small gray font next to the spinner text. Defaults to False (i.e. same behavior as today).If we're going towards minutes and hours, the timer text will be formatted nicely:
GitHub Issue Link (if applicable)
Closes #6805
Testing Plan
Added unit tests for JS and Python and one simple e2e test. I tried to make it not flaky but since that checks what's displayed after one second, we need to see in practice whether it's flaky and potentially adapt.
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.