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

Skip to content

Conversation

@mayagbarnes
Copy link
Collaborator

@mayagbarnes mayagbarnes commented Mar 27, 2025

Describe your changes

Sidebar's page navigation links still display as active when the app is not in a connected state (or the host has disabled inputs):
Screenshot 2025-03-31 at 11 58 14 a m

We want to match these with the app state, displaying them as disabled:
Screenshot 2025-03-31 at 11 57 39 a m

GitHub Issue Link (if applicable)

Closes #9198

Testing Plan

  • Unit Tests: ✅ Added
  • E2E Tests: ✅ Added
  • Manual Testing: ✅

@mayagbarnes mayagbarnes added security-assessment-completed Security assessment has been completed for PR change:bugfix PR contains bug fix implementation impact:users PR changes affect end users labels Mar 27, 2025
@snyk-io
Copy link
Contributor

snyk-io bot commented Mar 27, 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 Mar 27, 2025

✅ PR preview is ready!

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

@mayagbarnes mayagbarnes marked this pull request as ready for review March 31, 2025 18:42
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 👍 A few comments/suggestions.

Copy link
Collaborator

@lukasmasuch lukasmasuch Mar 31, 2025

Choose a reason for hiding this comment

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

In addition to the hostframe test, I think it would also be nice to add it to the websocket disconnect test as well:

# you may not use this file except in compliance with the License.

e.g. maybe just via some function-based pages:

def page1():
    pass

def page2():
    pass

st.navigation(...)

Comment on lines 119 to 121
...(disabled && {
cursor: "not-allowed",
}),
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Is the pointer cursor already applied in the normal state? Otherwise something like this might be a little nicer: cursor: disabled ? "not-allowed" : "pointer",

Comment on lines 82 to 87
/**
* Whether to disable the sidebar page navigation links, based on connection
* state and whether the host has disabled inputs.
* @see SidebarNavLink
*/
disableSidebarNavLinks: boolean
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: I think it might be a little bit more useful if we directly put the widgetsDisabled into the context to be reusable across other components / use case. Currently, this state is only used by other components by passing this through as props. Also we currently only have a single case for disableSidebarNavLinks which is when all widgets should be disabled.

@mayagbarnes mayagbarnes merged commit 54a823e into develop Mar 31, 2025
33 checks passed
@mayagbarnes mayagbarnes deleted the fix-9198 branch March 31, 2025 21:34
sfc-gh-bnisco pushed a commit that referenced this pull request Mar 31, 2025
Sidebar's page navigation links still display as active when the app is
not in a connected state (or the host has disabled inputs). We want to match these with the app state, displaying them as disabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:bugfix PR contains bug fix 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.

stSidebarNav items should be disabled when app is disconnected

3 participants