-
Notifications
You must be signed in to change notification settings - Fork 860
Restore Flyout System feature in EUI #9178
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
Restore Flyout System feature in EUI #9178
Conversation
Co-authored-by: Clint Andrew Hall <[email protected]> Co-authored-by: Weronika Olejniczak <[email protected]> Co-authored-by: Tomasz Kajtoch <[email protected]> Co-authored-by: Arturo Castillo Delgado <[email protected]> Co-authored-by: Paulina Shakirova <[email protected]>
Resize listener always runs, but expensive layout calculations only run when needed.
3e0d623 to
fe52040
Compare
e966888 to
34690cd
Compare
💚 Build SucceededHistory
|
💚 Build Succeeded
History
|
|
Hi @tkajtoch @weronikaolejniczak can we prioritize review of this? Compared to what has already been merged to main and reverted, the primary changes are the performance improvements. |
|
Hey, @tsullivan 👋🏻 I can definitely take a look but I'd still wait for Tomasz when he's back from PTO on Wednesday. The thing is, we'd be able to release Flyouts next week the earliest anyways. Lmk if you need a sanity check from me or there's no need and you prefer to wait for Tomasz 😄 |
|
Thanks @weronikaolejniczak I would appreciate a sanity check or whatever help you can offer. There are other PRs that need to be targeted to the feature branch, and since this one is to be the basis of the feature branch, those PRs are held up. |
|
Sorry folks, I did review the PR on Friday, but apparently forgot to submit it. Here it is: I updated the base branch to target the new The test changes and pub-sub changes look good as well. LGTM 🚢 |
Co-authored-by: Clint Andrew Hall <[email protected]> Co-authored-by: Weronika Olejniczak <[email protected]> Co-authored-by: Tomasz Kajtoch <[email protected]> Co-authored-by: Arturo Castillo Delgado <[email protected]> Co-authored-by: Paulina Shakirova <[email protected]>
Summary
Closes #9173
Re-closes https://github.com/elastic/kibana-team/issues/2060
The EUI Flyout System was reverted a short time ago because of a blocking performance issue. This PR restores the feature and introduces a fix for the performance bug. The details of the performance bug fix are below.
This fix can be tested in a Kibana draft PR: elastic/kibana#233806.
Run
gh pr checkout 233806Why are we making this change?
Restoring a feature that had to be temporarily pulled out of EUI, and including a performance fix to resolve the issue that caused it to be reverted.
Performance improvement #
The previous implementation had inefficient code for adding the window resize event listeners: there was a circular dependency problem in
src/components/flyout/manager/layout_mode.ts:windowWidthstate variableuseEffectrecalculates the layout mode and calls the reducersetModeaction, which updates the Flyout Manger's statesetModewould be re-created because it depends oncontextsetMode, theuseEffecttriggers again and performs the layout mode calculation: this is a return back to Step 2 -> INFINITE LOOPThe fix was to refactor code to depend on stable references rather than the entire context. Primarily: the
setModecallback now just depends ondispatch, which never changes. Secondarily, the largeuseEffectwas broken up to re-run only when the specific values we care about are changed.page becomes unresponsive after brief window resizing:
page stays responsive after extensive window resizing:
NOTE: after the fix, when testing in Kibana, we still see the "JS Event Listeners" metric go up in Kibana after window resize, but this doesn't happen when testing the EUI storybook in isolation.
Screenshots #
The original EUI Flyout System screenshots can be found in #9068 (comment)
Impact to users
The original "Impact to users" and description of the breaking change can be found in #9068 (comment)
QA
Remove or strikethrough items that do not apply to your PR.
General checklist
Browser QA[ ] Checked in both light and dark modes[ ] Checked in both MacOS and Windows high contrast modes(emulate forced colors if you do not have access to a Windows machine.)[ ] Checked in mobile[ ] Checked in Chrome, Safari, Edge, and Firefox[ ] Checked for accessibility including keyboard-only and screenreader modesDocs site QA[ ] Added documentation[ ] Props have proper autodocs (using@defaultif default values are missing) and playground toggles[ ] Checked Code Sandbox works for any docs examples[ ] Updated visual regression testsRelease checklist[ ] A changelog entry exists and is marked appropriately[ ] If applicable, added the breaking change issue label (and filled out the breaking change checklist)[ ] If the changes unblock an issue in a different repo, smoke tested carefully (see Testing EUI features in Kibana ahead of time)Designer checklist[ ] If applicable, file an issue to update EUI's Figma library with any corresponding UI changes. (This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)