-
Notifications
You must be signed in to change notification settings - Fork 4k
Hide about dialog if not explicitly set #10091
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
| const markdownStyle: CSSProperties = { | ||
| overflowY: "auto", | ||
| overflowX: "hidden", | ||
| maxHeight: "35vh", |
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.
Note: I think we can remove the scrolling/max height around the about message here. Because 1) we also don't have that on other dialogs that can be long (namely st.dialog) and 2) in practice, I don't think anybody will write crazy long about messages.
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.
Does medium-long text on a small screen (e.g., mobile) also work fine without overflowing or other weird UI?
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
✅ PR preview is ready!
|
📈 Frontend coverage change detectedThe frontend unit test (vitest) coverage has increased by 0.0500%
🎉 Great job on improving test coverage! |
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.
Pull Request Overview
This PR hides the default About dialog in the MainMenu unless a custom aboutSectionMd is provided, moves Streamlit version info into the Settings dialog, and adds pixel annotations to spacing primitives.
- MainMenu About option is now conditional on
aboutSectionMdinstead of toolbar mode. - SettingsDialog displays version info via
SessionInfo. - Spacing definitions annotated with pixel values for clarity.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/lib/src/theme/primitives/spacing.ts | Added pixel comments to rem-based spacing values. |
| frontend/app/src/components/StreamlitDialog/styled-components.ts | Removed About-related styled-components and unused imports. |
| frontend/app/src/components/StreamlitDialog/StreamlitDialog.tsx | Simplified AboutDialog and removed sessionInfo handling. |
| frontend/app/src/components/StreamlitDialog/StreamlitDialog.test.tsx | Updated AboutDialog tests to check custom markdown only. |
| frontend/app/src/components/StreamlitDialog/SettingsDialog.tsx | Added version display with SessionInfo. |
| frontend/app/src/components/StreamlitDialog/SettingsDialog.test.tsx | Added tests for version presence and absence. |
| frontend/app/src/components/MainMenu/MainMenu.tsx | Made About menu item conditional on aboutSectionMd. |
| frontend/app/src/components/MainMenu/MainMenu.test.tsx | Updated tests to reflect missing About item. |
| frontend/app/src/App.tsx | Passed sessionInfo to settings callback and removed from about callback. |
| frontend/app/src/App.test.tsx | Removed default About menu item assertions. |
| e2e_playwright/st_set_page_config_test.py | Adjusted e2e tests for absent About item. |
| e2e_playwright/main_menu_test.py | Updated snapshot settings and version hiding. |
Comments suppressed due to low confidence (2)
frontend/app/src/components/MainMenu/MainMenu.test.tsx:88
- Add a unit test case that renders
MainMenuwithmenuItems.aboutSectionMdset and asserts that an "About" option appears, ensuring this code path is covered.
"Settings",
frontend/app/src/components/StreamlitDialog/StreamlitDialog.tsx:103
- The
AboutPropsinterface does not declareaboutSectionMd, but the component referencesprops.aboutSectionMd, causing a TypeScript error. AddaboutSectionMd?: stringtoAboutProps.
{props.aboutSectionMd && (
lukasmasuch
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.
LGTM 👍
Describe your changes
The about dialog in Streamlit is pretty useless in most situations, except for showing the version information. This PR hides it completely in the app menu unless a custom about message is configured via
st.set_page_config. The Streamlit version is instead shown at the bottom of the settings dialog.New default app menu (if
menu_itemsinst.set_page_configis not set):New settings dialog:
Also sneaking in some comments on our
spacingdefinition to make it easier to work with pixels ;)GitHub Issue Link (if applicable)
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.