fix(performance): reduce unnecessary reruns and improve dashboard responsiveness#43
Conversation
Removed forced full reload on data refresh and updated auto scan functionality.
|
Heyy!! I have tested these changes locally and made sure that it improves the UI responsiveness and reduced unnecessary reruns... |
|
Hello, Nice work and thank you for contributing Have you checked other parts of the dashboard regarding minor exceptions or exception leaks and unassigned data for this? please do check and revert to us before we merge your branch. |
Codex-Crusader
left a comment
There was a problem hiding this comment.
Change 1 - Auto-scan checkbox: Widget is declared after it's read; move the st.sidebar.checkbox above the if block to avoid ordering fragility.
Change 2 - Removed st.rerun() after scan: This breaks the UI refresh — the comment above literally says a rerun is needed to pick up fresh data. Use st.fragment or a conditional rerun instead of removing it entirely.
Change 3 - Stale data st.info: Good direction, but pair it with a st.button("Refresh now") so the user has an actual way to act on the message.
Change 4 - "Load news feed" button: Removing st.rerun() here makes the button feel broken, session state is set but the news section won't render until the next unrelated interaction.
Change 5 - "Load live data" button: Same issue as above; the spinner below never triggers on the same click without a rerun.
General: Avoid emoji in source comments (# ❌) , encoding issues in some CI/editor setups. The overall strategy is inconsistent: some changes are solid UX improvements, but the rerun removals in changes 2, 4, and 5 trade correctness for perceived performance gains.
Refactor auto scan and refresh logic for better control.
|
Heyyy!! Thanks for the detailed feedback I've addressed all the requested changes: -> Moved the auto-scan checkbox above its usage Please take another look when you have time. Happy to make further improvements if needed!!! |
There was a problem hiding this comment.
All five points from my previous review have been addressed:
- Checkbox ordering -
st.sidebar.checkboxis now declared before it's read - Button reruns -
st.rerun()restored on both "Load news feed" and "Load live data" buttons - Stale data UX -
st.infois now paired with a "Refresh now" button so users can act on it - Epoch increment bug - all increments now consistently read from
st.session_stateinstead of a stale local variable - Emoji in comments - removed
CI passes on py3.11 and py3.12. Nice work, merging.
Congratulations on your first merge :)
|
Hope to see more of your contributions as we go! |
Reduced unnecessary Streamlit reruns by removing forced st.rerun() calls.
Improved dashboard responsiveness by controlling background scan triggers.
Added optional auto-scan toggle and prevented redundant refresh cycles.
Result: smoother UI, reduced lag, and better caching efficiency.