Repository navigation
Sidebar: refresh Resource Utilization with a button, not a timer - #157
Closed
t0mdavid-m wants to merge 1 commit into
Closed
t0mdavid-m wants to merge 1 commit into
t0mdavid-m wants to merge 1 commit into
Conversation
Port of OpenMS/streamlit-template#474. The sidebar monitors reran themselves with st.fragment(run_every=5). When that timer fired as the user switched pages, the rerun carried the page being left; the server ran it after the new page, the browser took it for a page change, cleared the page, and then got the panel's elements for a sidebar it no longer had ("Bad 'setIn' index"). The window is one network round trip, so it crashed online deployments and not local runs. The panels now sit in one fragment with a Refresh button and update with every page rerun. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KyJg47YNaoYnCCj1QYkHEy
Member
Author
|
Closing as superseded: #156 (Sync with template 26d7a41) already brings in OpenMS/streamlit-template#474 unchanged, with the same Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: on the live deployment, switching pages sometimes left a blank page with "Bad 'setIn' index N" in the console, and the session's later pages timed out. The sidebar's Resource Utilization panels reran themselves every 5 seconds.
After: the panels update with every page rerun and when you click the new Refresh button inside the expander. Nothing reruns on a timer, so page switches no longer crash.
Port of OpenMS/streamlit-template#474. When a 5-second timer fired while the user switched pages, its rerun carried the page being left. The server ran it after the new page, the browser read it as a page change and cleared the page, and then received the panel's elements for a sidebar it no longer had. The window is one network round trip, which is why it showed online and not locally.
How: the three monitors lose
@st.fragment(run_every=5)and the_keep_fragment_non_empty()workaround. They are drawn from one plain@st.fragment(_resource_panels) that holds the Refresh button.tests/test_sidebar_monitors.pygains a check that none of them reruns on a timer. Workspace Sync's own timers (developer mode only) and the FLASHIda live viewer are unchanged.Generated by Claude Code