-
-
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
UI: Add preloading to stories highlighted in the sidebar #17964
UI: Add preloading to stories highlighted in the sidebar #17964
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit df77b98. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
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 tried this out and found two problem:
-
When mousing over the sidebar, it only preloads at the story level, which is "too late" as a sibling story will already have been loaded. (similar when using the keyboard).
-
It doesn't do anything in the search panel. I thought we planned to do similar behaviour on mouse/keyboard selection?
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.
Meant to request changes
@tmeasday I think I made all the requested changes |
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.
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 tested in different projects using webpack4 and 5 and the behavior is super awesome!
There was one scenario that didn't go really well (kind of expected to be honest @tmeasday) which is when using LazyCompilation. If the user hovers over +10 stories fast, then webpack goes haywire:
webpack5lazycompilation.mov
Should report as a bug to webpack I guess. I propose we add a debounce here: |
Ok! Wanna add it in this PR or another next cycle? |
I'd be in favor of merging this, and creating a new task for next cycle |
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.
@ndelangen there seems to be some stories failing
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
auto map the ref id in lib/api when calling emit emit preload event when hovering over sidebar items or selecting them with the keyboard
cbc0e45
to
1aa9f79
Compare
What I did
Optimizations: