Skip to content

Commit e8502c9

Browse files
authored
[ML] Replace useIsDarkTheme() with EUI's colorMode. (#205079)
## Summary This PR replaces the `useIsDarkTheme()` hook with EUI's `colorMode`. Since this was the last hook in `@kbn/ml-kibana-theme` left this removes the whole package too. Note that the hook subscribed to an observable and was able to update the theme in place. EUI's `colorMode` will only be updated after a page refresh. Since updating the Kibana advanced setting to enable dark mode requires a full page refresh too, I guess it's fair to remove this behavior in favor of this simplification. In the long run we should aim for getting rid of these checks altogether and rely on dark-mode-aware EUI tokens. ### Checklist - [x] [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] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations.
1 parent a058312 commit e8502c9

File tree

17 files changed

+5
-124
lines changed

17 files changed

+5
-124
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,6 @@ x-pack/platform/packages/private/ml/inference_integration_flyout @elastic/ml-ui
779779
x-pack/platform/packages/private/ml/is_defined @elastic/ml-ui
780780
x-pack/platform/packages/private/ml/is_populated_object @elastic/ml-ui
781781
x-pack/platform/packages/private/ml/json_schemas @elastic/ml-ui
782-
x-pack/platform/packages/private/ml/kibana_theme @elastic/ml-ui
783782
x-pack/platform/packages/private/ml/local_storage @elastic/ml-ui
784783
x-pack/platform/packages/private/ml/nested_property @elastic/ml-ui
785784
x-pack/platform/packages/private/ml/number_utils @elastic/ml-ui
@@ -3171,7 +3170,6 @@ x-pack/platform/packages/private/ml/inference_integration_flyout @elastic/ml-ui
31713170
x-pack/platform/packages/private/ml/is_defined @elastic/ml-ui
31723171
x-pack/platform/packages/private/ml/is_populated_object @elastic/ml-ui
31733172
x-pack/platform/packages/private/ml/json_schemas @elastic/ml-ui
3174-
x-pack/platform/packages/private/ml/kibana_theme @elastic/ml-ui
31753173
x-pack/platform/packages/private/ml/local_storage @elastic/ml-ui
31763174
x-pack/platform/packages/private/ml/nested_property @elastic/ml-ui
31773175
x-pack/platform/packages/private/ml/number_utils @elastic/ml-ui

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,6 @@
665665
"@kbn/ml-in-memory-table": "link:x-pack/platform/packages/private/ml/in_memory_table",
666666
"@kbn/ml-is-defined": "link:x-pack/platform/packages/private/ml/is_defined",
667667
"@kbn/ml-is-populated-object": "link:x-pack/platform/packages/private/ml/is_populated_object",
668-
"@kbn/ml-kibana-theme": "link:x-pack/platform/packages/private/ml/kibana_theme",
669668
"@kbn/ml-local-storage": "link:x-pack/platform/packages/private/ml/local_storage",
670669
"@kbn/ml-nested-property": "link:x-pack/platform/packages/private/ml/nested_property",
671670
"@kbn/ml-number-utils": "link:x-pack/platform/packages/private/ml/number_utils",

tsconfig.base.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,8 +1260,6 @@
12601260
"@kbn/ml-is-defined/*": ["x-pack/platform/packages/private/ml/is_defined/*"],
12611261
"@kbn/ml-is-populated-object": ["x-pack/platform/packages/private/ml/is_populated_object"],
12621262
"@kbn/ml-is-populated-object/*": ["x-pack/platform/packages/private/ml/is_populated_object/*"],
1263-
"@kbn/ml-kibana-theme": ["x-pack/platform/packages/private/ml/kibana_theme"],
1264-
"@kbn/ml-kibana-theme/*": ["x-pack/platform/packages/private/ml/kibana_theme/*"],
12651263
"@kbn/ml-local-storage": ["x-pack/platform/packages/private/ml/local_storage"],
12661264
"@kbn/ml-local-storage/*": ["x-pack/platform/packages/private/ml/local_storage/*"],
12671265
"@kbn/ml-nested-property": ["x-pack/platform/packages/private/ml/nested_property"],

x-pack/platform/packages/private/ml/kibana_theme/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

x-pack/platform/packages/private/ml/kibana_theme/index.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

x-pack/platform/packages/private/ml/kibana_theme/jest.config.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

x-pack/platform/packages/private/ml/kibana_theme/kibana.jsonc

Lines changed: 0 additions & 9 deletions
This file was deleted.

x-pack/platform/packages/private/ml/kibana_theme/package.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

x-pack/platform/packages/private/ml/kibana_theme/src/hooks.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

x-pack/platform/packages/private/ml/kibana_theme/tsconfig.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)