-
Notifications
You must be signed in to change notification settings - Fork 4k
Change default theme hash on app init #6729
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
|
CC @sfc-gh-hkantuni @sfc-gh-wschmitt This will probably go out a bit earlier than expected in 1.23 since we're pushing back that release by a week to get some other PRs in |
sfc-gh-wschmitt
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.
@vdonato for president 🙌
Is there a way we can test this locally ahead of the release cycle? Potentially could we:
- start the frontend server dev server with no running backend
- window.post()
- then connect the backend?
Tested! Conveniently, https://github.com/streamlit/streamlit/blob/develop/frontend/hostframe.html was added last month for testing this, so that simplified this a good amount. It was a bit trickier to test this than connecting to the dev server without a running backend since the client won't accept messages from its parent frame until after we get a response from the |
* develop: (22 commits) enzyme -> react-testing-library (Countdown, Modal, ProgressBar) (streamlit#6744) Remove console.log (streamlit#6753) Update `st.data_editor` and `st.dataframe` docstrings (streamlit#6752) Update `st.data_editor` session state format (streamlit#6711) Cypress flaky test fixes (streamlit#6743) Document integer size limit for number_input and slider (streamlit#6724) Change default theme hash on app init (streamlit#6729) Use .genericFonts instead of .fonts to fix bug with theme postMessage. (streamlit#6732) Improve startup performance by lazy loading some dependencies (streamlit#6531) Add support for Altair 5 (streamlit#6618) Update modals (streamlit#6688) Improve docstrings for `ttl` and `max_entries` (streamlit#6733) Improve `st.columns` docstring (streamlit#6727) Removed orphan line in dataframe docstring (streamlit#6734) Fix useIsOverflowing dependency array (streamlit#6731) Remove experimental from data editor (streamlit#6712) Clarify set_page_config docstring and exception message (streamlit#6594) Add a config option to disable warning for setting both a widget default and its key in session_state (streamlit#6640) Add column configuration API for `st.dataframe` and `st.data_editor` (streamlit#6598) Migrate datetime column formatting from date-fns to momentJS (streamlit#6702) ...
In #6393, we added support for the host of an embedded Streamlit app to set the app's theme.
This currently conflicts with some of the theme caching code + custom theme code in the following
way:
themeHashstate variable is set tonullpostMessagethemeHash(null)with the hash used when it doesn't receive a custom theme from the server (the literal value
(
"hash_for_undefined_custom_theme").theme to the system default (this handles the case where the developer removes a custom theme).
This can be fixed by simply initializing our
themeHashto"hash_for_undefined_custom_theme"insteadof
null, which will keep the behavior the same in all other cases but won't inadvertently revert themes set bythe parent frame.