Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jrieke
Copy link
Collaborator

@jrieke jrieke commented Dec 29, 2024

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_items in st.set_page_config is not set):

Screenshot 2025-06-20 at 22 03 59

New settings dialog:

Screenshot 2025-06-20 at 22 04 43

Also sneaking in some comments on our spacing definition to make it easier to work with pixels ;)

GitHub Issue Link (if applicable)

Testing Plan

  • Updated existing unit and e2e tests to work with the new dialog content and menu structure.
  • Note that for the snapshot of the settings dialog, I'm removing the version information via CSS, so that this snapshot doesn't need to be updated on every new version.

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@jrieke jrieke added security-assessment-completed Security assessment has been completed for PR impact:users PR changes affect end users change:other PR contains other type of change labels Dec 29, 2024
const markdownStyle: CSSProperties = {
overflowY: "auto",
overflowX: "hidden",
maxHeight: "35vh",
Copy link
Collaborator Author

@jrieke jrieke Dec 29, 2024

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.

Copy link
Collaborator

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-io
Copy link
Contributor

snyk-io bot commented Jun 20, 2025

🎉 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)

@github-actions
Copy link
Contributor

github-actions bot commented Jun 20, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-10091/streamlit-1.45.1-py3-none-any.whl
🕹️ Preview app pr-10091.streamlit.app (☁️ Deploy here if not accessible)

@github-actions
Copy link
Contributor

github-actions bot commented Jun 21, 2025

📈 Frontend coverage change detected

The frontend unit test (vitest) coverage has increased by 0.0500%

  • Current PR: 85.7600% (43030 lines, 6126 missed)
  • Latest develop: 85.7100% (43071 lines, 6152 missed)

🎉 Great job on improving test coverage!

📊 View detailed coverage comparison

@jrieke jrieke added change:feature PR contains new feature or enhancement implementation and removed change:other PR contains other type of change labels Jun 21, 2025
@jrieke jrieke changed the title [WIP] Hide about dialog if not explicitly set Hide about dialog if not explicitly set Jun 21, 2025
@jrieke jrieke marked this pull request as ready for review June 21, 2025 00:44
@jrieke jrieke requested a review from Copilot June 21, 2025 13:04
Copy link
Contributor

Copilot AI left a 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 aboutSectionMd instead 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 MainMenu with menuItems.aboutSectionMd set and asserts that an "About" option appears, ensuring this code path is covered.
      "Settings",

frontend/app/src/components/StreamlitDialog/StreamlitDialog.tsx:103

  • The AboutProps interface does not declare aboutSectionMd, but the component references props.aboutSectionMd, causing a TypeScript error. Add aboutSectionMd?: string to AboutProps.
        {props.aboutSectionMd && (

Copy link
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@jrieke jrieke merged commit 21613fc into develop Jun 25, 2025
37 checks passed
@jrieke jrieke deleted the fix/hide-about-menu branch June 25, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants