-
Notifications
You must be signed in to change notification settings - Fork 4k
[Fix] Disable sidebar page nav links when app not connected #10946
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
🎉 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!
|
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 👍 A few comments/suggestions.
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.
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(...)| ...(disabled && { | ||
| cursor: "not-allowed", | ||
| }), |
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.
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",
| /** | ||
| * Whether to disable the sidebar page navigation links, based on connection | ||
| * state and whether the host has disabled inputs. | ||
| * @see SidebarNavLink | ||
| */ | ||
| disableSidebarNavLinks: boolean |
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.
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.
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.
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):

We want to match these with the app state, displaying them as disabled:

GitHub Issue Link (if applicable)
Closes #9198
Testing Plan