[ML] Remove legacy scss overwrites Single Metric Viewer#195259
[ML] Remove legacy scss overwrites Single Metric Viewer#195259rbrtj merged 12 commits intoelastic:mainfrom
Conversation
💔 Build FailedFailed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
Page load bundle
HistoryTo update your PR or re-run it, just comment with: cc @rbrtj |
|
Pinging @elastic/ml-ui (:ml) |
| // Annotations styles | ||
|
|
||
| '.ml-annotation': { | ||
| '&__brush': { |
There was a problem hiding this comment.
There was a problem hiding this comment.
I believe the syntax is correct and it works!
What happened is (I'm guessing) that I deleted the @import 'timeseriesexplorer/index'; in
x-pack/plugins/ml/public/application/_index.scss
So the styles for annotations in the Anomaly Explorer were removed.
In 0d5af5f I split the styles into two separate functions and applied them where needed. It seems to be working correctly now. I've also updated the embeddables
There was a problem hiding this comment.
Oh nice, great to see that's supported, so I was just misinterpreting why it was broken. I checked the latest state and it's working for me now too 👍
| const casesPermissions = cases?.helpers.canUseCases(); | ||
| const helpLink = docLinks.links.ml.anomalyDetection; | ||
|
|
||
| const timeseriesExplorerStyles = getTimeseriesExplorerStyles(); |
There was a problem hiding this comment.
Could this be done once outside the component instead of during every render?
| } | ||
| }; | ||
|
|
||
| const timeseriesExplorerStyles = getTimeseriesExplorerStyles(); |
There was a problem hiding this comment.
Could this be done once outside the component instead of during every render?
walterra
left a comment
There was a problem hiding this comment.
It's unfortunate that this change causes such an increase in async bundle sizes. Do you want to investigate a bit? You can do so by running this command:
node scripts/build_kibana_platform_plugins.js --dist --profile --focus=ml --no-cache
This will build optimized/minified bundles in x-pack/plugins/ml/target/public. In the directory you'll find some HTML files created by utilities to investigate the bundle sizes. You could compare main and this PR and investigate what's going on.
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
cc @rbrtj |
It seems that the bundle size is good now. The problem was caused by importing styles into embeddable via |
walterra
left a comment
There was a problem hiding this comment.
Latest changes including bundle size LGTM, great you were able to fix it!
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
cc @rbrtj |
| }, | ||
|
|
||
| '.tick line': { | ||
| stroke: euiThemeVars.euiColorLightShade, |
There was a problem hiding this comment.
does it look ok with the dark theme as well?
There was a problem hiding this comment.
ah yes, I see it automatically adjust
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
cc @rbrtj |
|
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11325480383 |
## Summary Removes SCSS files for the Single Metric Viewer and adds BEM classes for `annotations`. Affects the Single Metric Viewer in ML and the embeddable. Part of [elastic#140695](elastic#140695) (cherry picked from commit 87c91f4)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
… (#196085) # Backport This will backport the following commits from `main` to `8.x`: - [[ML] Remove legacy scss overwrites Single Metric Viewer (#195259)](#195259) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Robert Jaszczurek","email":"92210485+rbrtj@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-14T10:14:37Z","message":"[ML] Remove legacy scss overwrites Single Metric Viewer (#195259)\n\n## Summary\r\n\r\nRemoves SCSS files for the Single Metric Viewer and adds BEM classes for\r\n`annotations`.\r\nAffects the Single Metric Viewer in ML and the embeddable.\r\nPart of [#140695](https://github.com/elastic/kibana/issues/140695)","sha":"87c91f4e258db1910e13daec7e8267d1110735dd","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","release_note:skip","v9.0.0","Team:ML","v8.16.0","backport:version"],"title":"[ML] Remove legacy scss overwrites Single Metric Viewer","number":195259,"url":"https://github.com/elastic/kibana/pull/195259","mergeCommit":{"message":"[ML] Remove legacy scss overwrites Single Metric Viewer (#195259)\n\n## Summary\r\n\r\nRemoves SCSS files for the Single Metric Viewer and adds BEM classes for\r\n`annotations`.\r\nAffects the Single Metric Viewer in ML and the embeddable.\r\nPart of [#140695](https://github.com/elastic/kibana/issues/140695)","sha":"87c91f4e258db1910e13daec7e8267d1110735dd"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195259","number":195259,"mergeCommit":{"message":"[ML] Remove legacy scss overwrites Single Metric Viewer (#195259)\n\n## Summary\r\n\r\nRemoves SCSS files for the Single Metric Viewer and adds BEM classes for\r\n`annotations`.\r\nAffects the Single Metric Viewer in ML and the embeddable.\r\nPart of [#140695](https://github.com/elastic/kibana/issues/140695)","sha":"87c91f4e258db1910e13daec7e8267d1110735dd"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Robert Jaszczurek <92210485+rbrtj@users.noreply.github.com>


Summary
Removes SCSS files for the Single Metric Viewer and adds BEM classes for
annotations.Affects the Single Metric Viewer in ML and the embeddable.
Part of #140695