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

fix(legend): action sizing ui and focus states #1102

Merged
merged 6 commits into from
Apr 2, 2021

Conversation

nickofthyme
Copy link
Collaborator

@nickofthyme nickofthyme commented Mar 31, 2021

Summary

Overall fixes for action UI to match rest of legend

Screen.Recording.2021-03-31.at.12.58.46.PM.mp4

Notible changes/fixes include:

shared margins to create a more narrow footprint
Screen Recording 2021-03-24 at 09 09 32 AM

Forced size of action popovers. This assumes that user will use the EuiPopover for the actions and forces the size to be full height and width to have uniform focus state across the color dot (w/ or w/o a color picker), the series name (w/ or w/o extra value) and the actions.

Before

image

After

image

Checklist

@nickofthyme nickofthyme added bug Something isn't working :legend Legend related issue :styling Styling related issue labels Mar 31, 2021
@nickofthyme nickofthyme requested review from markov00 and rshen91 March 31, 2021 17:53
@nickofthyme nickofthyme force-pushed the fix-legend-action-ui branch from 1259f80 to b75b753 Compare April 1, 2021 18:11
Copy link
Member

@markov00 markov00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visually checked all the screenshots!
LGTM

Comment on lines +83 to 86
if (items.length === 0 || items.every(({ isItemHidden }) => isItemHidden)) {
return null;
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not free-up space for the chart when there is no legend rendered. We need to find a better way to set the size to zero in the get_legend_size selector without creating an infinite loop.

@codecov-io
Copy link

codecov-io commented Apr 2, 2021

Codecov Report

Merging #1102 (4a90a13) into master (0bd61f1) will increase coverage by 0.42%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1102      +/-   ##
==========================================
+ Coverage   71.72%   72.14%   +0.42%     
==========================================
  Files         381      397      +16     
  Lines       11917    12230     +313     
  Branches     2600     2629      +29     
==========================================
+ Hits         8547     8823     +276     
- Misses       3339     3368      +29     
- Partials       31       39       +8     
Flag Coverage Δ
unittests 71.71% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/state/selectors/get_legend_size.ts 93.02% <0.00%> (-0.16%) ⬇️
src/components/legend/extra.tsx 100.00% <0.00%> (ø)
src/components/legend/legend.tsx 100.00% <0.00%> (ø)
src/mocks/annotations/annotations.ts 66.66% <0.00%> (ø)
src/mocks/specs/specs.ts 83.33% <0.00%> (ø)
src/mocks/utils.ts 100.00% <0.00%> (ø)
src/mocks/store/store.ts 92.59% <0.00%> (ø)
src/mocks/geometries.ts 92.85% <0.00%> (ø)
src/mocks/series/index.ts 100.00% <0.00%> (ø)
src/mocks/series/series.ts 91.22% <0.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0bd61f1...4a90a13. Read the comment docs.

@nickofthyme nickofthyme enabled auto-merge (squash) April 2, 2021 17:05
@nickofthyme nickofthyme merged commit 3a76a2c into elastic:master Apr 2, 2021
nickofthyme pushed a commit that referenced this pull request Apr 2, 2021
# [28.0.0](v27.0.0...v28.0.0) (2021-04-02)

### Bug Fixes

* **annotations:** provide fallback for line annotation markers ([#1091](#1091)) ([0bd61f1](0bd61f1))
* **legend:** action sizing ui and focus states ([#1102](#1102)) ([3a76a2c](3a76a2c))
* **legend:** stop legend color picker dot twitching ([#1101](#1101)) ([c89b767](c89b767))

### Code Refactoring

* rename enum types to singular ([#1064](#1064)) ([396b3d1](396b3d1)), closes [#767](#767)

### BREAKING CHANGES

* `AnnotationDomainTypes`, `AnnotationTypes`, `SeriesTypes`, `ChartTypes`, and `SpecTypes` are renamed to `AnnotationDomainType`, `AnnotationType`, `SeriesType`, `ChartType`, and `SpecType`
@nickofthyme
Copy link
Collaborator Author

🎉 This PR is included in version 28.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nickofthyme nickofthyme added the released Issue released publicly label Apr 2, 2021
@nickofthyme nickofthyme deleted the fix-legend-action-ui branch April 6, 2021 16:41
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
# [28.0.0](elastic/elastic-charts@v27.0.0...v28.0.0) (2021-04-02)

### Bug Fixes

* **annotations:** provide fallback for line annotation markers ([opensearch-project#1091](elastic/elastic-charts#1091)) ([d907c81](elastic/elastic-charts@d907c81))
* **legend:** action sizing ui and focus states ([opensearch-project#1102](elastic/elastic-charts#1102)) ([a58cc0a](elastic/elastic-charts@a58cc0a))
* **legend:** stop legend color picker dot twitching ([opensearch-project#1101](elastic/elastic-charts#1101)) ([f63bb3b](elastic/elastic-charts@f63bb3b))

### Code Refactoring

* rename enum types to singular ([opensearch-project#1064](elastic/elastic-charts#1064)) ([6e900e2](elastic/elastic-charts@6e900e2)), closes [opensearch-project#767](elastic/elastic-charts#767)

### BREAKING CHANGES

* `AnnotationDomainTypes`, `AnnotationTypes`, `SeriesTypes`, `ChartTypes`, and `SpecTypes` are renamed to `AnnotationDomainType`, `AnnotationType`, `SeriesType`, `ChartType`, and `SpecType`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working :legend Legend related issue released Issue released publicly :styling Styling related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants