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

[ML] EUI Visual Refresh (tokens) #203518

Merged
merged 55 commits into from
Dec 18, 2024

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Dec 10, 2024

Summary

Part of #199715 (EUI Visual Refresh).

Recommend to review with white-space diff disabled: https://github.com/elastic/kibana/pull/203518/files?w=1

  • All references to renamed tokens have been updated to use the new token name.
  • All usage of color palette tokens and functions now pull from the theme, and correctly update to use new colors when the theme changes from Borealis to Amsterdam and vice versa.
  • Migrated some data visualizer related SCSS to emotion, part of [ML] Replace legacy SCSS overwrites with css-in-js #140695.
  • It makes use of EUI's own useEuiTheme() instead of our own hook variants. So this gets rid of useCurrentEuiThemeVars(), useFieldStatsFlyoutThemeVars(), useCurrentEuiTheme(), useCurrentThemeVars().
  • Renamed components used to edit Anomaly Detection jobs from JobDetails, Detectors, Datafeed to EditJobDetailsTab, EditDetectorsTab, EditDatafeedTab to make them less ambiguous.
  • Added unit tests for ner_output.tsx.
  • Adds checks to pick euiColorVis* colors suitable for the theme.

Some of our code used colors like euiColorVis5_behindText. In Borealis *_behindText is no longer available since the original colors like euiColorVis5 have been updated to be suitable to be used behind text. For that reason and for simplicity's sake I removed the border from the custom badges we use to render NER items:

NER labels Amsterdam:

CleanShot 2024-12-18 at 11 37 45@2x

NER labels Borealis:

CleanShot 2024-12-18 at 11 38 45@2x

Checklist

  • Unit or functional tests were updated or added to match the most common scenarios
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

@walterra walterra self-assigned this Dec 10, 2024
@walterra walterra force-pushed the ml-borealis-fixes-color-palettes branch from b18326f to 63e1448 Compare December 10, 2024 13:38
@walterra walterra force-pushed the ml-borealis-fixes-color-palettes branch from 63e1448 to a1ec963 Compare December 10, 2024 17:32
@walterra walterra force-pushed the ml-borealis-fixes-color-palettes branch from d186aa6 to 14c4402 Compare December 11, 2024 14:12
@walterra walterra marked this pull request as ready for review December 11, 2024 18:23
@walterra walterra requested a review from a team as a code owner December 11, 2024 18:23
@walterra walterra added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting v9.0.0 :ml labels Dec 11, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested and visually LGTM - tested Borealis (dark theme) and Amsterdam (light theme).

Copy link
Contributor

@andreadelrio andreadelrio left a comment

Choose a reason for hiding this comment

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

Left some comments about visColors.

},
LOC: {
label: 'Location',
icon: 'visMapCoordinate',
color: 'euiColorVis1_behindText',
borderColor: 'euiColorVis1',
color: 'euiColorVis1',
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @walterra, visColors mapping has changed in Borealis (as seen here):

image

So here if you want to preserve the blue you'll probably want to do euiColorVis2 instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

@walterra @andreadelrio Fyi, changing colors like this means the current color in Amsterdam changes as well. (in Amsterdam it will be red now)
If that's not wanted, we'd need to use conditional color definitions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @mgadewoll. Afaict these vis colors are not being used in a semantic way (e.g. low/healthy, warning, danger, etc) so we should be safe to make this change this way. Can you confirm @walterra?

},
MISC: {
label: 'Miscellaneous',
icon: 'questionInCircle',
color: 'euiColorVis7_behindText',
borderColor: 'euiColorVis7',
color: 'euiColorVis7',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
color: 'euiColorVis7',
color: 'euiColorVis8',

label: '',
icon: 'questionInCircle',
color: 'euiColorVis5_behindText',
borderColor: 'euiColorVis5',
color: 'euiColorVis5',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
color: 'euiColorVis5',
color: 'euiColorVis9',

return (
<EuiBadge
color={euiTheme.euiColorVis5_behindText}
color={euiTheme.colors.vis.euiColorVis5}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
color={euiTheme.colors.vis.euiColorVis5}
color={euiTheme.colors.vis.euiColorVis9}

@walterra
Copy link
Contributor Author

@mgadewoll @andreadelrio went through all the vis colors and added a flag an appropriate colors where necessary.

@walterra
Copy link
Contributor Author

@rbrtj Thanks for spotting these issues! Fixed the analytics map icons in 8250674. Fixed the histogram chart colors in d4346ac. Please have another look!

@walterra walterra changed the title [ML] Borealis theme fixes (tokens) [ML] EUI Visual Refresh (tokens) Dec 18, 2024
Copy link
Contributor

@rbrtj rbrtj left a comment

Choose a reason for hiding this comment

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

Latest changes LGTM 👍

Copy link
Contributor

@mgadewoll mgadewoll left a comment

Choose a reason for hiding this comment

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

Thanks for the additional changes and making sure Amsterdam colors have parity. 👏
✅ Changes LGTM from EUI side

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
dataVisualizer 736 725 -11
ml 2138 2137 -1
transform 489 487 -2
total -14

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/ml-kibana-theme 3 1 -2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
aiops 621.5KB 620.7KB -747.0B
dataVisualizer 616.4KB 614.6KB -1.8KB
ml 4.7MB 4.7MB +1.4KB
transform 475.9KB 475.4KB -419.0B
total -1.6KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
aiops 17.3KB 17.5KB +208.0B
dataVisualizer 26.3KB 26.3KB -54.0B
ml 78.4KB 77.8KB -608.0B
transform 18.6KB 18.5KB -54.0B
total -508.0B
Unknown metric groups

API count

id before after diff
@kbn/ml-kibana-theme 5 2 -3

History

cc @walterra

@walterra walterra merged commit 0b14669 into elastic:main Dec 18, 2024
8 checks passed
@walterra walterra deleted the ml-borealis-fixes-color-palettes branch December 18, 2024 13:50
JoseLuisGJ pushed a commit to JoseLuisGJ/kibana that referenced this pull request Dec 19, 2024
## Summary

Part of elastic#199715 (EUI Visual Refresh).

Recommend to review with white-space diff disabled:
https://github.com/elastic/kibana/pull/203518/files?w=1

- All references to renamed tokens have been updated to use the new
token name.
- All usage of color palette tokens and functions now pull from the
theme, and correctly update to use new colors when the theme changes
from Borealis to Amsterdam and vice versa.
- Migrated some data visualizer related SCSS to emotion, part of
elastic#140695.
- It makes use of EUI's own `useEuiTheme()` instead of our own hook
variants. So this gets rid of `useCurrentEuiThemeVars()`,
`useFieldStatsFlyoutThemeVars()`, `useCurrentEuiTheme()`,
`useCurrentThemeVars()`.
- Renamed components used to edit Anomaly Detection jobs from
`JobDetails`, `Detectors`, `Datafeed` to `EditJobDetailsTab`,
`EditDetectorsTab`, `EditDatafeedTab` to make them less ambiguous.
- Added unit tests for `ner_output.tsx`.
- Adds checks to pick `euiColorVis*` colors suitable for the theme.

----

Some of our code used colors like `euiColorVis5_behindText`. In Borealis
`*_behindText` is no longer available since the original colors like
`euiColorVis5` have been updated to be suitable to be used behind text.
For that reason and for simplicity's sake I removed the border from the
custom badges we use to render NER items:

NER labels Amsterdam:

![CleanShot 2024-12-18 at 11 37
45@2x](https://github.com/user-attachments/assets/d82bca3a-2ad1-411a-94cd-748de6b4b0e9)

NER labels Borealis:

![CleanShot 2024-12-18 at 11 38
45@2x](https://github.com/user-attachments/assets/36987779-fab2-4ad7-8e31-6853d48079a1)


### Checklist

- [ ] [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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
benakansara pushed a commit to benakansara/kibana that referenced this pull request Jan 2, 2025
## Summary

Part of elastic#199715 (EUI Visual Refresh).

Recommend to review with white-space diff disabled:
https://github.com/elastic/kibana/pull/203518/files?w=1

- All references to renamed tokens have been updated to use the new
token name.
- All usage of color palette tokens and functions now pull from the
theme, and correctly update to use new colors when the theme changes
from Borealis to Amsterdam and vice versa.
- Migrated some data visualizer related SCSS to emotion, part of
elastic#140695.
- It makes use of EUI's own `useEuiTheme()` instead of our own hook
variants. So this gets rid of `useCurrentEuiThemeVars()`,
`useFieldStatsFlyoutThemeVars()`, `useCurrentEuiTheme()`,
`useCurrentThemeVars()`.
- Renamed components used to edit Anomaly Detection jobs from
`JobDetails`, `Detectors`, `Datafeed` to `EditJobDetailsTab`,
`EditDetectorsTab`, `EditDatafeedTab` to make them less ambiguous.
- Added unit tests for `ner_output.tsx`.
- Adds checks to pick `euiColorVis*` colors suitable for the theme.

----

Some of our code used colors like `euiColorVis5_behindText`. In Borealis
`*_behindText` is no longer available since the original colors like
`euiColorVis5` have been updated to be suitable to be used behind text.
For that reason and for simplicity's sake I removed the border from the
custom badges we use to render NER items:

NER labels Amsterdam:

![CleanShot 2024-12-18 at 11 37
45@2x](https://github.com/user-attachments/assets/d82bca3a-2ad1-411a-94cd-748de6b4b0e9)

NER labels Borealis:

![CleanShot 2024-12-18 at 11 38
45@2x](https://github.com/user-attachments/assets/36987779-fab2-4ad7-8e31-6853d48079a1)


### Checklist

- [ ] [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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Jan 13, 2025
## Summary

Part of elastic#199715 (EUI Visual Refresh).

Recommend to review with white-space diff disabled:
https://github.com/elastic/kibana/pull/203518/files?w=1

- All references to renamed tokens have been updated to use the new
token name.
- All usage of color palette tokens and functions now pull from the
theme, and correctly update to use new colors when the theme changes
from Borealis to Amsterdam and vice versa.
- Migrated some data visualizer related SCSS to emotion, part of
elastic#140695.
- It makes use of EUI's own `useEuiTheme()` instead of our own hook
variants. So this gets rid of `useCurrentEuiThemeVars()`,
`useFieldStatsFlyoutThemeVars()`, `useCurrentEuiTheme()`,
`useCurrentThemeVars()`.
- Renamed components used to edit Anomaly Detection jobs from
`JobDetails`, `Detectors`, `Datafeed` to `EditJobDetailsTab`,
`EditDetectorsTab`, `EditDatafeedTab` to make them less ambiguous.
- Added unit tests for `ner_output.tsx`.
- Adds checks to pick `euiColorVis*` colors suitable for the theme.

----

Some of our code used colors like `euiColorVis5_behindText`. In Borealis
`*_behindText` is no longer available since the original colors like
`euiColorVis5` have been updated to be suitable to be used behind text.
For that reason and for simplicity's sake I removed the border from the
custom badges we use to render NER items:

NER labels Amsterdam:

![CleanShot 2024-12-18 at 11 37
45@2x](https://github.com/user-attachments/assets/d82bca3a-2ad1-411a-94cd-748de6b4b0e9)

NER labels Borealis:

![CleanShot 2024-12-18 at 11 38
45@2x](https://github.com/user-attachments/assets/36987779-fab2-4ad7-8e31-6853d48079a1)


### Checklist

- [ ] [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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
viduni94 pushed a commit to viduni94/kibana that referenced this pull request Jan 23, 2025
## Summary

Part of elastic#199715 (EUI Visual Refresh).

Recommend to review with white-space diff disabled:
https://github.com/elastic/kibana/pull/203518/files?w=1

- All references to renamed tokens have been updated to use the new
token name.
- All usage of color palette tokens and functions now pull from the
theme, and correctly update to use new colors when the theme changes
from Borealis to Amsterdam and vice versa.
- Migrated some data visualizer related SCSS to emotion, part of
elastic#140695.
- It makes use of EUI's own `useEuiTheme()` instead of our own hook
variants. So this gets rid of `useCurrentEuiThemeVars()`,
`useFieldStatsFlyoutThemeVars()`, `useCurrentEuiTheme()`,
`useCurrentThemeVars()`.
- Renamed components used to edit Anomaly Detection jobs from
`JobDetails`, `Detectors`, `Datafeed` to `EditJobDetailsTab`,
`EditDetectorsTab`, `EditDatafeedTab` to make them less ambiguous.
- Added unit tests for `ner_output.tsx`.
- Adds checks to pick `euiColorVis*` colors suitable for the theme.

----

Some of our code used colors like `euiColorVis5_behindText`. In Borealis
`*_behindText` is no longer available since the original colors like
`euiColorVis5` have been updated to be suitable to be used behind text.
For that reason and for simplicity's sake I removed the border from the
custom badges we use to render NER items:

NER labels Amsterdam:

![CleanShot 2024-12-18 at 11 37
45@2x](https://github.com/user-attachments/assets/d82bca3a-2ad1-411a-94cd-748de6b4b0e9)

NER labels Borealis:

![CleanShot 2024-12-18 at 11 38
45@2x](https://github.com/user-attachments/assets/36987779-fab2-4ad7-8e31-6853d48079a1)


### Checklist

- [ ] [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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](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
backport:skip This commit does not require backporting EUI Visual Refresh :ml release_note:skip Skip the PR/issue when compiling release notes v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants