|
Two root causes:
1. The JS wrote empty session defaults to localStorage before reading
stored values back, destroying saved data on every fresh page load.
Fixed by gating on data-loaded: JS reads+restores only when loaded=0,
writes+saves only when loaded=1.
2. st.rerun() inside render_persistence_bridge() aborted the render
before qt_click_receiver/wl_click_receiver were registered. Streamlit
clears unrendered widget state, so pending click values (_qt_click,
_wl_click) were wiped before quotetable/watchlist could process them.
Fixed by removing st.rerun() — the bridge runs at the top of the
render cycle so restored session state propagates to components below
in the same pass; no extra rerun needed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|