Conversation
Introduces _push_nav_if_changed(), _restore_nav_state(), and _on_back_click() to track asset/category navigation and restore full page state (including lazy-loaded news and live data).
Removes back button from sidebar. Injects a CSS anchor span before the st.button call and uses a :has() sibling selector in styles.py to position the button fixed at top: 60px, left: calc(21rem + 1rem), styled with the retro broadsheet theme variables.
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.
asset/category/custom-ticker state is compared against the previous run; if it changed, the old state (including whether news and live data were loaded) is pushed onto a
session-state history stack capped at 20 entries. A _nav_restoring flag prevents the back action from being recorded as a new navigation event.
the st.button call at the top of the main panel. A CSS :has() sibling selector in styles.py targets the button's wrapper div and fixes it at top: 60px; left: calc(21rem + 1rem),
placing it just below Streamlit's header bar and to the right of the sidebar. Button inherits all retro broadsheet theme variables (gold text, dark transparent background, serif
font).
a widget-backed session state key (e.g. _custom_ticker_input) after that widget has already been instantiated in the current run. The callback fires between reruns, before any
widgets are created.
A guard clears _selected_asset if the restored value is not valid for the current category, preventing a Streamlit value-not-in-options error.
when a custom ticker is confirmed, keeping the sidebar layout stable and showing the user their last tracked selection.
Corrected to TSM (Taiwan Semiconductor Manufacturing Company)