-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Manager: Add options to hide sidebar and toolbar per story #29516
base: next
Are you sure you want to change the base?
Conversation
View your CI Pipeline Execution ↗ for commit 6838695.
☁️ Nx Cloud last updated this comment at |
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.
17 file(s) reviewed, 12 comment(s)
Edit PR Review Bot Settings | Greptile
| **showSidebar** | Function | Toggle visibility for the sidebar | `({ storyId }, defaultValue) => storyId === 'landing' ? false : defaultValue` | | ||
| **showToolbar** | Function | Toggle visibility for the toolbar | `({ viewMode }, defaultValue) => viewMode === 'docs' ? false : defaultValue` | |
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.
style: Example values should include type annotations to match the function signatures in the code
## TODO layout customisation doc | ||
|
||
TODO: | ||
1. Document both functions with use cases | ||
2. Add caveat about bricking the user experience by hiding sidebar everywhere |
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.
@Sidnioulz, could you ping me when you finish adding the documentation so that I can review it properly and help you get this in?
Let me know and we'll go from there.
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.
@jonniebigodes thanks, I had totally forgotten about this bit. I've updated it to integrate the new config options in your existing docs, and added a Sidebar UI
section with both the showSidebar options/API and the keyboard shortcut doc which was missing.
I've placed a warning about not using showSidebar
without an alternative means of nav everywhere where it's mentioned.
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.
@Sidnioulz, I'm sorry for the radio silence on this. I was tasked with other documentation / project-related items that required my attention. I looked into it and left some items for you to consider when you can.
Let me know and we'll go from there.
Hope you have a great weekend.
Stay safe
fb38b53
to
fd38b47
Compare
@jonniebigodes I believe I've addressed all docs feedback. Thanks again for showing me how to preview docs and handle snippets! Do let me know if anything extra needs changing. |
Package BenchmarksCommit: No significant changes detected, all good. 👏 |
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.
@Sidnioulz, thank you for taking the time to address the documentation feedback. Appreciate it 🙏 ! From my end, all is good, and I'm approving this to unblock you.
@ndelangen, can you follow up with @Sidnioulz for any code changes that need follow-up?
Thanks in advance
@ndelangen I've implemented what we discussed yesterday, Layout stories should now all pass! This is ready for review. I'll only add commits to handle the rebase conflicts. |
Co-authored-by: jonniebigodes <[email protected]>
3cf434e
to
6838695
Compare
Closes #22081.
Context
What I did
What's left to do
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
code/.storybook/manager.tsx
with the snippet belowyarn storybook:ui
The snippet:
Documentation
If you are deprecating/removing a feature, make sure to updateMIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.ts
Make sure this PR contains one of the labels below:
Available labels
bug
: Internal changes that fixes incorrect behavior.maintenance
: User-facing maintenance tasks.dependencies
: Upgrading (sometimes downgrading) dependencies.build
: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup
: Minor cleanup style change. Will not show up in release changelog.documentation
: Documentation only changes. Will not show up in release changelog.feature request
: Introducing a new feature.BREAKING CHANGE
: Changes that break compatibility in some way with current major version.other
: Changes that don't fit in the above categories.🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/core
team here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>
Greptile Summary
This PR adds layout customization options to conditionally show/hide the Storybook toolbar and sidebar based on story context, primarily addressing the need to hide toolbars on documentation pages.
layoutCustomisations
object in manager config withshowSidebar
andshowToolbar
functionsgetShowToolbarWithCustomisations
andgetNavSizeWithCustomisations
in layout module to handle visibility logictoolbar.mdx
explaining conditional toolbar visibility featuresLayout
andPreview
components to integrate customization logic through API propsaddons.ts
andapi.ts