-
Notifications
You must be signed in to change notification settings - Fork 861
[flyouts] Developer API + sessions #8939
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
Conversation
38564c8 to
bfe70f4
Compare
921c51d to
f6ff3da
Compare
💚 Build SucceededHistory
|
packages/eui/src/components/collapsible_nav/collapsible_nav.tsx
Outdated
Show resolved
Hide resolved
34fd254 to
9ffef35
Compare
a3a5805 to
62cd4e5
Compare
|
@clintandrewhall I'll stop at this because my head is exploding 🤯 You've all done amazing job here! 🎉 💚 Flyouts are working smoothly, the API is simple and clear, and I love the code quality - no magic numbers, clear separation of concerns, no code smells. There are a bunch of comments I left, I made sure to say whether they are blocking or non-blocking in my mind (the majority are non-blocking) and leave GH code suggestions to make the fixes quick and easy. Feel free to omit / postpone as many of my suggestions as you'd like. And if you want, we can discuss some of them in more depth. |
|
@ThomThomson @tsullivan I did, indeed, remove "automatic" virtualization for this approach. I just felt the DX ease justified the trade-off. My mitigation would be a container component for intentional virtualization, rather than a pre-optimization: Or perhaps |
Co-authored-by: Weronika Olejniczak <32842468+weronikaolejniczak@users.noreply.github.com>
@clintandrewhall @ThomThomson it sounds like this is an optimization that doesn't necessarily need to be made in this PR. The idea wouldn't be a major pivot from the direction we're starting here, correct?
Totally agree |
packages/eui/src/components/flyout/manager/flyout_child.stories.tsx
Outdated
Show resolved
Hide resolved
| // TODO: @tkajtoch - this is causing all kinds of issues with animations if a | ||
| // main flyout is opened with ownFocus={true}. Since the logic is to _change_ | ||
| // ownFocus to false if a child is rendered, the component remounts, spinning all | ||
| // of the animations into a tailspin. One option would be to flat-out _hide_ this | ||
| // mask. :shrug: |
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.
ping @tkajtoch
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 addressing this as part of the animations improvements work. This whole EuiOverlayMask is a bit of a mess and needs reworking.
Let's leave it as is since this goes into a feature branch, and I'll fix it in a follow-up PR for clarity if you have no objections.
tsullivan
left a comment
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. All tasks that are open are going to be handleed in separate PRs in this feature branch. Along with other things, they're being tracked in this document: https://docs.google.com/document/d/1OXx2H997k6zfz_w4jc-CJ1qyJxesi47CW5bEDsZ7OQk/edit?tab=t.0
💚 Build SucceededHistory
|
💚 Build Succeeded
History
|
| .cursorrules | ||
| WARP.md |
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.
nit:
I don't mind adding these but I'd put them in a separate "section", right now they seem under "Yarn". Maybe even move to "IDE-specific files".
weronikaolejniczak
left a comment
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.
Recent changes look great! I like that it was extensively covered with tests. I skimmed them and they are alright 😄
🟢 🚀
tkajtoch
left a comment
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 happy merging this as is since it goes into a feature branch. I reviewed the code and functionality and have no complaints that would be blocking merging of this PR.
Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> Co-authored-by: Timothy Sullivan <tsullivan@elastic.co> Co-authored-by: Weronika Olejniczak <32842468+weronikaolejniczak@users.noreply.github.com>
Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> Co-authored-by: Timothy Sullivan <tsullivan@elastic.co> Co-authored-by: Weronika Olejniczak <32842468+weronikaolejniczak@users.noreply.github.com>
Summary
In this iteration of flyout management, a single
sessionprop is used to control whether a flyout is rendered as a new session, or as a standard flyout.Demo
There is a Storybook demonstration of flyout management using a contrived "shopping cart" example.
Flyouts
Shopping cart flyout
This flyout always starts a new session, session={true}.
Review order flyout
This flyout always starts a new session, session={true}.
It is rendered on it's own from the page root, but also from within the Shopping Cart flyout. This demonstrates how a new session can be started from anywhere, but how it's session interacts with others.
Item details flyout
This flyout is a regular flyout.
It is rendered on its own, but also from within the Shopping Cart flyout.
If rendered on its own, and no session is active, it is rendered as a regular flyout.
If rendered on its own, and a session is active, it is rendered as a new main flyout as a new session.
If rendered from within the Shopping Cart flyout, it will be rendered as a child flyout.
Parent + child management
Standard flyout becomes
mainif a session is activeParent + child stacking behavior
Details
The determination of whether a managed flyout is rendered as a
mainorchildis based:This approach means the relationship between the
mainandchildflyout, as well as the history of whichmainflyouts have been opened, are implicitly derived from the React structure.So from a DX perspective, no one need wonder if they should create a
MainFlyoutor aChildFlyout, or check what may already be open... the way its structured and thesessionprop handle it all.Notes
EuiFlyoutcomponent was moved toflyout.component.tsx.flyout.tsx.