Skip to content
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] Dimensions with empty names are difficult to edit #151271

Closed
markov00 opened this issue Feb 15, 2023 · 12 comments · Fixed by #154368
Closed

[Lens] Dimensions with empty names are difficult to edit #151271

markov00 opened this issue Feb 15, 2023 · 12 comments · Fixed by #154368
Labels
accessibility: focus Accessibility focus management enhancement New value added to drive a business result Feature:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure UX

Comments

@markov00
Copy link
Member

Kibana version:
8.7.0

Describe the bug:
I've discovered that issue mainly working with the new Metric visualization, where I want a bit more controls of what is rendered on the chart. When, for example, I'm creating a small multiple of metrics but I don't want to render multiple time the same primary metric text on each metric, I usually insert a simple space as the name of the primary metric.
This creates the following problems:

  1. the clickable area to edit the metric is reduced drastically to only the icon area + a small side padding
Screen.Recording.2023-02-15.at.12.11.55.mov
  1. the keyboard accessible focus area is invisible due to the missing text (is accessible but not shown)
Screen.Recording.2023-02-15.at.12.13.01.mov

Steps to reproduce:

  1. Create a metric chart
  2. Change the name of the primary metric to be an empty string (usually an empty space)
  3. see the issues

Expected behavior:
I probably expect that the button still is clickable with ease even if the name is short or empty. The same for the keyboard focus.

@markov00 markov00 added bug Fixes for quality problems that affect the customer experience Team:Visualizations Visualization editors, elastic-charts and infrastructure UX Feature:Lens accessibility: focus Accessibility focus management labels Feb 15, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations)

@markov00 markov00 added the impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. label Feb 15, 2023
@stratoula stratoula added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. and removed impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. labels Feb 15, 2023
@drewdaemon
Copy link
Contributor

drewdaemon commented Feb 15, 2023

I agree with this as a general enhancement, but I also think it points to a deeper problem which is that we don't allow folks to hide the metric subtitle in a breakdown situation.

This particular case should be alleviated by #137770

@dej611
Copy link
Contributor

dej611 commented Apr 4, 2023

I had a look at this problem, from a general prospective, and explored few "simple" solutions.
At the end I think it is more a design and accessibility problem rather than actual implementation.

The proposed ideas will work for any title string that once trimmed will result in a empty string (title.trim().length === 0).

First idea

Fill the dimension button of whitespaces to make most of the area clickable

  • pros: all clean and it is pretty easy to click on the dimension button and edit. Also it can be provided an alternative a11y no title
  • cons: it is still a link and on hover the underline is still shown. I've explored if it's possible to disable it on a EUI button, but then I felt that the a11y aspect of it would be undermined.

Screenshot 2023-04-04 at 15 38 15

I've experimented with several unicode ways to render whitespaces but didn't find anything better than a regular white space.

Second idea

Use an alternative title for the specific case.

  • pros: the design is not as nicer as above, but it is crystal clear that the dimension has no title. Also it is still easy to click to edit.
  • cons: none?

Screenshot 2023-04-04 at 15 37 13

Of course in both cases the choice of [No title] was completely arbitrary and can be changed to something else that fits the case.

@stratoula
Copy link
Contributor

stratoula commented Apr 4, 2023

I like the second idea! :)

cc @MichaelMarcialis

@dej611
Copy link
Contributor

dej611 commented Apr 4, 2023

PR with the second proposal implementation available here: #154368

@MichaelMarcialis
Copy link
Contributor

When, for example, I'm creating a small multiple of metrics but I don't want to render multiple time the same primary metric text on each metric, I usually insert a simple space as the name of the primary metric.

@markov00: Forgive my confusion, but could you elaborate on why you are supplying a single space for the dimension name? What is the case for it being preferable to have dimension items with no name?

Based on how Lens currently operates, if the dimension name input is cleared, it reverts back to using the auto-generated name. If there isn't a very compelling reason to allow unnamed dimension items, my first instinct would be to simply treat the name input with only space values as if it were empty (i.e. revert back to the auto-generated name).

Alternatively, if there is indeed a compelling reason to allow unnamed dimension items, and we want to support this hacky workaround of inserting a space character as the dimension name, I prefer @dej611's second idea of supplying an "Untitled" string. However, this begs the question as to whether we should even bother making the dimension name input required (if we're going to allow people to circumvent it like this). With that in mind, should we make the dimension name input optional and show the "Untitled" string in situations where the input was empty or filled with space characters. If so, we'd also have to consider whether we need to provide users with the ability to restore the auto-generated dimension names. Thoughts?

@drewdaemon
Copy link
Contributor

drewdaemon commented Apr 10, 2023

I agree with @MichaelMarcialis 's general sentiment.

Is hiding the subtitle for multi-metric visualizations the only place these empty dimensions are coming up? If so, maybe we just need to fix that specific case and close this back door by following @MichaelMarcialis 's suggestion

simply treat the name input with only space values as if it were empty

As I said above, I assumed #137770 would take care of the metric subtitle question. However, if we are not sure about moving the title into the visualization anymore, maybe we need a new solution to the metric subtitle question.

@markov00
Copy link
Member Author

@MichaelMarcialis in this case for example, if I'm using a panel in a dashboard with a title like: Count of records per country I don't need to render the same subtitle on each metric.
Screenshot 2023-04-11 at 14 58 16

To achieve the desired result, today I can only use the space trick because it is the only way to avoid the auto-generated title.

There is another possible way to fix this by providing an option to hide the subtitle or other title like in the axes for example.

@MichaelMarcialis
Copy link
Contributor

@markov00: Thanks for that explanation. I understand now, and I like your alternative idea of providing users with an option to hide subtitles. Since it's an option that extends across multiple dimensions (primary metric and breakdown in this case) and is applied across the entire visualization, it probably would make sense to have an option added for it in the toolbar area above the visualization, like we do for other visualization types. In doing so, we could also prevent the dimension name inputs from accepting and using a space character (and instead restore the auto-generated name). Thoughts?

@stratoula
Copy link
Contributor

Yes this seems as a good solution to me Michael. I am changing this to enhancement, I will add it to 8.9.

@stratoula stratoula added enhancement New value added to drive a business result and removed bug Fixes for quality problems that affect the customer experience labels Apr 13, 2023
@dej611
Copy link
Contributor

dej611 commented Apr 13, 2023

This is not the first time I see this bug coming up, before the new metric. I think it was a way to keep the axis padding on the chart without providing a title to it.

While having a new metric solution would fix @markov00 's case, it would be nice to provide a general solution also for other visualization types.

Based on how Lens currently operates, if the dimension name input is cleared, it reverts back to using the auto-generated name. If there isn't a very compelling reason to allow unnamed dimension items, my first instinct would be to simply treat the name input with only space values as if it were empty (i.e. revert back to the auto-generated name).

I think it kind of make sense to have the auto-generated name on both cases, but still not 100% it's the same thing.
If a user did put some more extra effort to have some extra spacing in there maybe it wanted to make sure the wasn't really anything in there to be shown (and we could make sure this reflects on the visualization side), but I'm sure, as a user, that every time I would see that auto-generated name placed on the dimension box it would confuse me 😅 . Maybe we could give a different style to it in such case?

@dej611
Copy link
Contributor

dej611 commented Apr 21, 2023

Another use case to have an empty dimension label is when using the "Split metrics by" table dimension.

dej611 added a commit that referenced this issue Jun 19, 2023
…4368)

## Summary

Fixes #151271 

This PR is a proposal to provide a fallback title in case the user
decides to provide an empty value for dimensions title.

<img width="1230" alt="Screenshot 2023-06-14 at 12 05 46"
src="https://github.com/elastic/kibana/assets/924948/521d00db-4c1e-4aff-a142-086fa3456884">
<img width="1238" alt="Screenshot 2023-06-14 at 12 05 35"
src="https://github.com/elastic/kibana/assets/924948/9a272fac-02e6-4585-81d1-5e0b2686eaf1">


Note that this applies only to the presentation of the dimension button,
but the title remains as empty space in the configuration itself.
Tests added with testing-library.

### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility: focus Accessibility focus management enhancement New value added to drive a business result Feature:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure UX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants