-
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
[EuiProviders] Warn Developer if EuiProvider is missing #184608
Conversation
a13dff6
to
15141dc
Compare
notifications.toasts.addDanger({ | ||
title: '`EuiProvider` is missing', | ||
text: mountReactNode( | ||
<p data-test-sub="core-chrome-euiDevProviderWarning-toast"> |
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.
With this data-test-subj
, there could be a change in another PR to catch scenarios when this unwanted toast shows in functional tests. We could update the navigation methods of CommonPageObject
class, to catch this toast message during functional testing, and throw a helpful error.
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.
Update: #189018 (comment)
Pinging @elastic/appex-sharedux (Team:SharedUX) |
8ee9364
to
535fe00
Compare
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.
🚀
packages/core/chrome/core-chrome-browser-internal/src/chrome_service.tsx
Show resolved
Hide resolved
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @tsullivan |
* master: (3487 commits) `BedrockChat` & `GeminiChat` (elastic#186809) [ResponseOps] log error when ES Query rules find docs out of time range (elastic#186332) skip flaky suite (elastic#188997) [Security solution][Alert Details] Enable preview feature flag and cypress tests (elastic#188580) [EuiProviders] Warn Developer if EuiProvider is missing (elastic#184608) [Security Solution ] Fixes Timeline infinite loading bug (elastic#188943) Improve SearchSource SearchRequest type (elastic#186862) Deprecate Search Sessions config (elastic#188037) [Synthetics] Add missing monitorType and tag info in cards !! (elastic#188824) [Console Monaco] Resolve uncaught error from tokenizer (elastic#188746) [Data Forge] Add `service.logs` dataset as a data stream (elastic#188786) [Console] Fix failing bulk requests (elastic#188552) Update dependency terser to ^5.31.2 (main) (elastic#188528) [APM][ECO] Telemetry (elastic#188627) [Fleet] Fix uninstall package validation accross space (elastic#188749) Update warning on `xpack.fleet.enableExperimental` (elastic#188917) [DOCS][Cases] Automate more screenshots for cases (elastic#188697) [Fleet] Fix get one agent when feature flag disabled (elastic#188953) chore(investigate): Add investigate-app plugin from poc (elastic#188122) [Monaco Editor] Add Search functionality (elastic#188337) ...
* master: (2400 commits) `BedrockChat` & `GeminiChat` (elastic#186809) [ResponseOps] log error when ES Query rules find docs out of time range (elastic#186332) skip flaky suite (elastic#188997) [Security solution][Alert Details] Enable preview feature flag and cypress tests (elastic#188580) [EuiProviders] Warn Developer if EuiProvider is missing (elastic#184608) [Security Solution ] Fixes Timeline infinite loading bug (elastic#188943) Improve SearchSource SearchRequest type (elastic#186862) Deprecate Search Sessions config (elastic#188037) [Synthetics] Add missing monitorType and tag info in cards !! (elastic#188824) [Console Monaco] Resolve uncaught error from tokenizer (elastic#188746) [Data Forge] Add `service.logs` dataset as a data stream (elastic#188786) [Console] Fix failing bulk requests (elastic#188552) Update dependency terser to ^5.31.2 (main) (elastic#188528) [APM][ECO] Telemetry (elastic#188627) [Fleet] Fix uninstall package validation accross space (elastic#188749) Update warning on `xpack.fleet.enableExperimental` (elastic#188917) [DOCS][Cases] Automate more screenshots for cases (elastic#188697) [Fleet] Fix get one agent when feature flag disabled (elastic#188953) chore(investigate): Add investigate-app plugin from poc (elastic#188122) [Monaco Editor] Add Search functionality (elastic#188337) ...
…189018) ## Summary Follows #184608 Closes elastic/kibana-team#805 ![image](https://github.com/user-attachments/assets/eaee5b81-c1e9-4e81-9018-db57652236dc) --------- Co-authored-by: kibanamachine <[email protected]>
Summary
Addresses https://github.com/elastic/kibana-team/issues/805
Rollout plan
These steps will graduate toward a consistency of Dark Mode theming (and I18n, and Analytics for Error Boundaries) by ensuring that EUI components are always rendered with
KibanaRenderContextProvider
wrapping the root of the rendering tree.The final behavior: in Dev mode when KibanaRenderContextProvider is missing, developers will see a console.error and a toast Error message. In CI environments, the error scenario will cause the EUI components to fail with an error and developers will have to address the issue with a fix by viewing the test logs.
After running in a mode of step 2 for a length of time, we add restrictions to CI environments with the final error behavior.Update the navigation methods of the common page objects for functional tests, to detect when the toast message appears during functional testing, and throw a helpful error.Notification for developers
Developers would see this error toast with a message telling them they need to use EuiProvider, plus a link for "more details." They can also check the JS console to see the error details.
How this helps
Surfacing these kinds of errors automates the discovery of finding where dark mode issues exist. Here is an example of a hard-to-find dark mode issue that was easily caught by the kinds of testing enabled in this PR:
The way to problems in this nature is to wrap the React context in
<KibanaRenderContextProvider>
, and setting the required CoreStart service dependencies ofanalytics
,i18n
andtheme
.