-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Lens] Keyboard-selected items follow user traversal of drop zones #90546
[Lens] Keyboard-selected items follow user traversal of drop zones #90546
Conversation
Pinging @elastic/kibana-app (Team:KibanaApp) |
763dc90
to
20b5f37
Compare
@elasticmachine merge upstream |
/** | ||
* don't display ghost image for the drop element | ||
*/ | ||
noGhost?: boolean; |
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 find negative props somewhat confusing in components. Maybe others do to?
Especially when passing in false
you end up with a double negative when thinking it through and that can throw people (me, at least) for a loop.
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 understand and it makes sense. However, on the other side, this construction allows us to treat displaying a ghost as a default behaviour without passing extra parameter and that's what I was trying to do here. So for most components, I can do <DragDrop draggable .../>
and I don't have to add ghost = {true}
(or specify a default value in the component). I understand it's a bit on the edge when it comes to readability so I'd like to know the opinion of another person reviewing this 🙏
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.
Looks good! I like the effect and when testing with Voice Over I didn't notice anything breaking.
Just one small bug (below) and a small nit/question in the code.
Kind of an odd bug, and might be a browser bug, only in Safari in full screen mode, if I'm moving a dimension to a different drop target but then cancel by pressing esc, Safari exists full screen mode. This doesn't happen in other browsers. And this doesn't happen if I'm reordering and press esc. Maybe an extra event.preventDefault()
somewhere can prevent this?
b085a7d
to
e19f9ad
Compare
Thanks for the review @myasonik! I fixed the bug with your suggestion, |
@elasticmachine merge upstream |
These failures don't seem related, testing again. |
@elasticmachine merge upstream |
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.
The feature LGTM once the PR is green, this is a smart way to implement it. Tested in Chrome and Firefox and it renders fine
I think it's worth adding a unit test to the drag_drop tests to verify whether the ghost image is put correctly into the context and rendered correctly on the active target.
Left a comment about the prop name, but it's not a big deal IMHO.
/** | ||
* don't display ghost image for the drop element | ||
*/ | ||
noGhost?: boolean; |
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 don't have a strong feeling here, but we could call the prop ghost
and treat undefined
as true:
{(ghost || typeof ghost === 'undefined') &&
dragging?.ghost &&
activeDropTarg...
@elasticmachine merge upstream |
This looks awesome, @mbondyra! Here are my responses to your questions.
No, I think leaving behind an empty focus ring in the original location when changing dimensions would end up being a distraction. If anything, it probably makes the most sense to keep the focus ring around the ghosted item to make it very apparent where the item is moving. Here's an example below.
Ideally, I'd love to see the ghost behavior be consistent, even when dropping a field on the workspace. Is it possible to add the ghosted field to the top right of the workspace when it is the currently selected drop zone?
Correct. Since the field isn't being removed from that list, I think it makes sense not to hide it.
I'm OK leaving it as is for the moment. It might be more confusing on the user's part to see the ghost in the "add" drop zone but then also seeing the item in its original spot simultaneously. Otherwise, here's some additional comments from my review:
|
@elasticmachine merge upstream |
Hey @MichaelMarcialis I've corrected all the things you mentioned except for the workspace double border - everytime I am applying it in some way, some other thing breaks and I want to merge this branch before FF on Tuesday. Are you ok with merging this as it is and then correcting the double border in separate PR? 🙏 |
…_add_ghost_image_to_keyboard_navigation
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, tested in Firefox!
@@ -416,8 +446,13 @@ const DropInner = memo(function DropInner(props: DropInnerProps) { | |||
setActiveDropTarget(undefined); | |||
setKeyboardMode(false); | |||
}; | |||
|
|||
// const shouldShowGhost = isActiveDropTarget && dropType !== 'reorder'; |
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.
Commented code
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.
Sorry, I found a bug caused by this PR: the entire workspace panel is empty in Firefox.
@@ -34,6 +33,8 @@ | |||
// Color the whole panel instead | |||
background-color: transparent !important; // sass-lint:disable-line no-important | |||
border: none !important; // sass-lint:disable-line no-important | |||
width: 100%; | |||
height: 100%; |
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 don't see why this behavior changed, can you explain?
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.
Yes, so we have this style:
.lnsWorkspacePanelWrapper .lnsWorkspacePanelWrapper__pageContentBody > * {
flex: 1 1 100%;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
that before was applied directly to .lnsWorkspace. Now, when I added .lnsDragDrop__container
as a parent of the element, .lnsDragDrop__container
got the styles above so I needed to ensure the child (.lnsWorkspace) was "spread" inside.
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.
Thanks for making those changes, @mbondyra. Let me know if you want me to create that separate issue for the double border.
I left one small suggestion. Otherwise, this looks good to me. Approving now so I don't hold you up further.
Co-authored-by: Michael Marcialis <michael@marcial.is>
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
@wylieconlon I want to merge this one before FF so I'lll merge it despite your 'changes requested' - I addressed your request already, hope it's fine! |
…ndition-for-hiding-recommded-allocation * 'master' of github.com:elastic/kibana: [Discover] Fix toggling multi fields from doc view table (elastic#91121) [ML] Data Frame Analytics: ROC Curve Chart (elastic#89991) skip flaky suite (elastic#86948) skip flaky suite (elastic#91191) Fix date histogram time zone for rollup index (elastic#90632) [Search Source] Fix retrieval of unmapped fields; Add field filters (elastic#89837) [Logs UI] Use useMlHref hook for ML links (elastic#90935) Fix values of `products.min_price` field in Kibana sample ecommerce data set (elastic#90428) [APM] Darker shade for Error group details labels (elastic#91349) [Lens] Adjust new copy for 7.12 (elastic#90413) [ML] Unskip test. Fix modelMemoryLimit value. (elastic#91280) [Lens] Fix empty display name issue in XY chart (elastic#91132) [Lens] Improves error messages when in Dashboard (elastic#90668) [Lens] Keyboard-selected items follow user traversal of drop zones (elastic#90546) [Lens] Improves ranking feature in Top values (elastic#90749) [ILM] Rollover min age tooltip and copy fixes (elastic#91110) # Conflicts: # x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.test.ts
Summary
Fixes #90339
Interaction with field:
Interaction between dimensions
Interaction when reordering
Design Questions: