-
Notifications
You must be signed in to change notification settings - Fork 4k
Add SidebarConfigContext
#12791
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
Add SidebarConfigContext
#12791
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
✅ PR preview is ready!
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
fab04ec to
65881e8
Compare
0c4918e to
f9d7623
Compare
65881e8 to
49a5c47
Compare
e43a48f to
a0bba88
Compare
84d2d68 to
3d70b6e
Compare
3d70b6e to
2bd1ffb
Compare
a0bba88 to
2fe50da
Compare
📈 Frontend coverage change detectedThe frontend unit test (vitest) coverage has increased by 0.0100%
✅ Coverage change is within normal range. |
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 introduces a new SidebarConfigContext to improve context separation and organization in the Streamlit frontend architecture. The change moves sidebar-related configuration properties (initialSidebarState, appLogo, sidebarChevronDownshift, expandSidebarNav, hideSidebarNav) from AppContext to a dedicated SidebarConfigContext.
Key changes:
- Created new
SidebarConfigContextwith comprehensive documentation - Updated all components to consume sidebar config from the new context
- Refactored test utilities to support the new context provider
- Removed
appLogoprop drilling through component trees
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/lib/src/components/core/SidebarConfigContext.tsx | New context file defining sidebar configuration properties |
| frontend/lib/src/index.ts | Exports new SidebarConfigContext and types |
| frontend/app/src/components/StreamlitContextProvider.tsx | Integrates SidebarConfigContext into provider hierarchy |
| frontend/app/src/components/AppContext.tsx | Removes sidebar-related properties |
| frontend/app/src/components/AppView/AppView.tsx | Consumes sidebar config from new context instead of props/AppContext |
| frontend/app/src/components/Sidebar/Sidebar.tsx | Uses SidebarConfigContext instead of AppContext for sidebar properties |
| frontend/app/src/components/Navigation/SidebarNav.tsx | Switches from AppContext to SidebarConfigContext |
| frontend/lib/src/test_util.tsx | Adds SidebarConfigContext support to test rendering utilities |
| frontend/app/src/components/AppView/AppView.test.tsx | Updates tests to use new context structure |
| frontend/app/src/components/Sidebar/Sidebar.test.tsx | Refactors tests to provide SidebarConfigContext |
| frontend/app/src/components/Navigation/SidebarNav.test.tsx | Updates test helpers to use SidebarConfigContext |
| frontend/app/src/App.tsx | Removes appLogo prop from AppView |
| Multiple test files | Adds empty SidebarConfigContext overrides to maintain test compatibility |
2bd1ffb to
ac1148f
Compare
92b57cd to
61e36b8
Compare
ac1148f to
4ba6af1
Compare
61e36b8 to
67acfad
Compare
67acfad to
bc6f5f4
Compare
4ba6af1 to
352b359
Compare
bc6f5f4 to
e2ec103
Compare
352b359 to
1985977
Compare
e2ec103 to
2b0aa23
Compare

Describe your changes
Part 4 of
StreamlitContextProviderupdatesAdds new
SidebarConfigContextwith the following:initialSidebarStateappLogosidebarChevronDownshiftexpandSidebarNavhideSidebarNavTesting Plan