-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Feature: Menu with core functionalities #981
Conversation
Codecov Report
@@ Coverage Diff @@
## master #981 +/- ##
==========================================
+ Coverage 12.61% 14.08% +1.47%
==========================================
Files 192 198 +6
Lines 4424 4658 +234
Branches 707 733 +26
==========================================
+ Hits 558 656 +98
- Misses 3241 3362 +121
- Partials 625 640 +15
Continue to review full report at Codecov.
|
I would love to see this merged sooner rather than later. Can you rebase this? |
@@ -0,0 +1,175 @@ | |||
/* eslint-disable */ | |||
(function webpackUniversalModuleDefinition(root, factory) { |
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.
I'm not following why we're committing a webpack generated module into the repo with svgs in base64 string format.
I think for maintainability sake, we should include the original svgs in the repo and generate them during runtime.
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.
Thank you @danielduan
It's a legacy solution from PR for Storybook 2.0 :)
I think we can switch to the "normal" way to import svg.
We'll need to change some loaders in webpack config, for that. Actually, I think we need to do it very carefully!
Closing this because there hasn't been any activity here for a while. Feel free to reopen when this is ready for discussion again. |
I'm really interested in this PR, the ability to toggle all the panels makes viewing stories a lot easier on mobile devices. I'm currently writing scripts in manager-head.html to toggle the panels but its very much hacked together, I'd much prefer a first class storybook solution to handle this. @usulpro, you mentioned needing to change some loaders in webpack config. Is that work you might be interested in picking up? |
@bjankord he's been unresponsive for a while now. The best thing you can do is pick up where he left off and try working on it. You can make a branch off his and open a PR when you're ready. |
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 1d88caa. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
Issues: #867 #314 ui-#69
step towards: #124 #868 #862
At this moment we can only use keyboard shortcuts and query string to get core functionalities. In some cases, we'd like to do the same via mouse or touch screen. Especially necessary for access from mobile devices
What I did
1. Added menu duplicate keyboard shortcuts to the left (stories) panel
expanded menu
This menu is collapsible (default state):
This menu has buttons to navigate within stories / storyKinds
We'll need it in
Fullscreen
modeRemoved `⌘` button from the header of left panel
It's still available from the core menu
2. Added floating menu when left panel is hidden
Fullscreen mode
So we can navigate via mouse/touchscreen or return to the normal view
Hidden left panel
Expanse direction
Depending on its position menu expands to up or down direction
3. Mantra modules API
jumpToKind
- new API to jump between storyKinds: modules/api/actionsfloatingBoxOptions
- settings of floating menu displaying. Default:4. Added tests for new components
How to test
Open demo page to test usability. Try it with mobile devices.
Clone repo
Try to use new menu to hide/show left/down panels. Go to
fullscreen
/normal
mode. Navigate through the stories.To change floating menu position set default settings to one of this
All tests should pass
Details for review
New react component for menu is here:
packages/storybook-ui/src/modules/ui/components/core_menu/
It gets access to API via
react-komposer
here:packages/storybook-ui/src/modules/ui/containers/core_menu.js
new
jumpToKind
API is here:packages/storybook-ui/src/modules/api/actions/api.js
all
svg
images for menu in the webpack bundled library:packages/storybook-ui/src/modules/ui/components/assets/svg_package.js
. we can discuss this solution