-
Notifications
You must be signed in to change notification settings - Fork 8.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
[Lens] Drag dimension to replace #75895
Conversation
Pinging @elastic/kibana-app (Team:KibanaApp) |
Context: Reviewing solely the "Replace" functionality Aside from some stylistic tweaks to the dragging item (hover & focus states), this behavior works pretty well. I think more than the strikethrough, the more evident thing we can do to show that this will be moving the config is to hide the original placement. When they're hovering over a new spot, whether a pre-existing config or empty config, the known paradigm will be that this will take its spot, so whatever we do to the styling of the new placement isn't as necessary. Then we also need to be sure to use the correct |
@cchaos Thanks for the feedback! I implemented a |
.lnsLayerPanel__dimension-replace { | ||
text-decoration: line-through; | ||
} | ||
|
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.
To avoid the effect of 'x' button being slower than the rest when dragging, you could add a custom className and overwrite transition: all 250ms ease-in
setting coming from EUI, eg: transition: all 250ms ease-out, visibility 0ms;
I found a better solution - can you instead animate opacity:0
and not visibility
on .lnsLayerPanel__dimension-hidden
? Opacity is more performant and solves the problem with the button.
@@ -27,6 +27,14 @@ | |||
overflow: hidden; | |||
} | |||
|
|||
.lnsLayerPanel__dimension-hidden { |
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.
nitpick: in other places in lens we use BEM notation with a format block__element--modifier
so you might want to change it to .lnsLayerPanel__dimension--hidden
and lnsLayerPanel__dimension--replace
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.
BEM also indicates that you use a single dash for specific states. Like block__element-isDisabled
. The single dash is technically correct here, but it's better to indicate state by adding the is
in front like: lnsLayerPanel__dimension-isHidden
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 left few small comments, but overall looks good 👍 I will leave my 'approve' when we're aligned with Caroline about the design details.
Two more situations to think more about or make sure we follow up on. 1. Dragging a config that has no where to goRight now you can start dragging a Y-axis config, but there's no place for it to go. How should we handle this situation? I'm thinking that it's not right to completely disable the drag effect because it might look like a bug. Perhaps we need to not only indicate good drop zones but bad ones as well. Perhaps by just decreasing the opacity of the bad ones. It may be mostly a temporary measure since we should eventually get to a place where any configs can be replaced, but it does at least set us up with something in the event we come across this situation that will happen. 2. Dragging between layers |
@cchaos I can't tell which comments of yours are meant to be blocking approval, and which are meant for further discussion. Both of your most recent comments need more discussion, and I'm not sure that they should be done in this PR. Here's why they need more discussion:
The GIF here is showing my preferred way of doing it. If you agree, I'll implement in this PR. If you disagree, let's implement it in a separate PR due to technical complexity.
|
I agree with this approach and your implementation looks good to me. Lets do it 👍
Because "Replacing" doesn't just replace an existing config, but can move an X-axis from layer 1 to the newly created X-axis of of the newly created (empty) layer 2. And it seemed to me like replacing is a precursor to being able to swap and copy. If you disagree with this approach, that's fine. |
x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/_layer_panel.scss
Show resolved
Hide resolved
@cchaos I think the PR is approvable now. One of the changes you requested was already done, and the other is done now. |
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.
Functionally this LGTM. 🎉
I'll end up doing some design clean up to the different DnD states once we get them hall worked out functionally.
I think @myasonik may have some a11y concerns that he may want to bring up proactively so we can address them early before it's all been configured.
I took a look and this PR doesn't seem to make anything worse than what already existed so I'm actually not going to leave any a11y feedback right now |
@elasticmachine merge upstream |
💚 Build SucceededBuild metricspage load bundle size
History
To update your PR or re-run it, just comment with: |
Tested on Firefox, looks good! |
* [Lens] Drag to replace * Add jest tests for drag and drop * Fix bug in dragging to empty * Hide dragged dimension when drag starts * Make table metrics required * Update class names * Implement styles on non-droppable items * Replace drag and drop image in docs * Remove extra specificity Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
* master: (47 commits) Do not require id & description when creating a logstash pipeline (elastic#76616) Remove commented src/core/tsconfig file (elastic#76792) Replaced whitelistedHosts with allowedHosts in actions ascii docs (elastic#76731) [Dashboard First] Genericize Attribute Service (elastic#76057) [ci-metrics] unify distributable file count metrics (elastic#76448) [Security Solution][Detections] Handle conflicts on alert status update (elastic#75492) [eslint] convert to @typescript-eslint/no-unused-expressions (elastic#76471) [DOCS] Add default time range filter to advanced settings (elastic#76414) [Security Solution] Refactor NetworkTopNFlow to use Search Strategy (elastic#76249) [Dashboard] Update Index Patterns when Child Index Patterns Change (elastic#76356) [ML] Add option to Advanced Settings to set default time range filter for AD jobs (elastic#76347) Add CSM app to CODEOWNERS (elastic#76793) [Security Solution][Exceptions] - Updates exception item find sort field (elastic#76685) [Security Solution][Detections][Tech Debt] - Move to using common io-ts types (elastic#75009) [Lens] Drag dimension to replace (elastic#75895) URI encode the index names we fetch in the fetchIndices lib function. (elastic#76584) [Security Solution] Resolver retrieve entity id of documents without field mapped (elastic#76562) [Ingest Manager] validate agent route using AJV instead kbn-config-schema (elastic#76546) Updated non-dev usages of node-forge (elastic#76699) [Ingest Pipelines] Processor forms for processors K-S (elastic#75638) ...
This only works when dragging dimensions to a different groups, such as "X-axis" to "Break down by". Example:
As a side effect of the drag changes, the table configuration is now split into "Break down by" and "Metrics":
Still to do: Functional tests and Kibana docs update.
Part of #51739
Checklist
Delete any items that are not applicable to this PR.