Skip to content

Conversation

@lukasmasuch
Copy link
Collaborator

@lukasmasuch lukasmasuch commented Dec 4, 2025

Describe your changes

If st.logo is used in an MPA app without specifying a link, it will do an internal redirect to the default/home page on click.

GitHub Issue Link (if applicable)

Testing Plan

  • Added unit and e2e tests.

Contribution License Agreement

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

Copilot AI review requested due to automatic review settings December 4, 2025 12:26
@snyk-io
Copy link
Contributor

snyk-io bot commented Dec 4, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-13222/streamlit-1.52.0-py3-none-any.whl
📦 @streamlit/component-v2-lib Download from artifacts
🕹️ Preview app pr-13222.streamlit.app (☁️ Deploy here if not accessible)

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 adds a new feature where clicking the logo in a multi-page app navigates to the home page when no explicit link is provided via st.logo. Previously, logos without an explicit link were non-interactive.

Key changes:

  • Logos in multi-page apps now act as a home navigation button when no explicit link parameter is provided
  • The logo remains non-interactive in single-page apps and uses external links when explicitly configured
  • Navigation only occurs when not already on the home page

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
frontend/app/src/components/Logo/LogoComponent.tsx Adds logic to render a clickable button for multi-page apps without explicit links, uses NavigationContext to navigate to the home page
frontend/app/src/components/Sidebar/styled-components.ts Extracts shared logo link styles and adds new StyledLogoButton component with button reset styles
frontend/app/src/components/Logo/LogoComponent.test.tsx Adds comprehensive test coverage for multi-page app home navigation scenarios
e2e_playwright/multipage_apps_v2/mpa_v2_basics_test.py Adds e2e test verifying logo click navigation and removes snapshot assertion for removed external link feature
e2e_playwright/multipage_apps_v2/mpa_v2_basics.py Removes explicit link parameter from st.logo call to test new home navigation behavior

@lukasmasuch lukasmasuch added security-assessment-completed Security assessment has been completed for PR impact:internal PR changes only affect internal code change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users and removed impact:internal PR changes only affect internal code labels Dec 4, 2025
dataTestId = "stLogo",
}: LogoComponentProps): ReactElement | null => {
const { resourceCrossOriginMode } = useContext(LibConfigContext)
const { appPages, onPageChange, currentPageScriptHash } =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggestion: In a MPA, when you are on the home page, this will still render the logo as a clickable button (with hover effect / cursor) - though its a bit more work I think it should only render as clickable button when not already on the home page

logo-button.mov

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point, updated 👍

@lukasmasuch lukasmasuch merged commit e7dd9fa into develop Dec 8, 2025
43 checks passed
@lukasmasuch lukasmasuch deleted the navigate-to-home-page-on-logo-click branch December 8, 2025 09:32
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.

Allow link in st.logo to link to one of the app pages

3 participants