-
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
[ML] Remove legacy scss overwrites Single Metric Viewer #195259
[ML] Remove legacy scss overwrites Single Metric Viewer #195259
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 👍
@@ -38,13 +39,11 @@ export const TimeSeriesExplorerPage: FC<PropsWithChildren<TimeSeriesExplorerPage | |||
const CasesContext = cases?.ui.getCasesContext() ?? React.Fragment; | |||
const casesPermissions = cases?.helpers.canUseCases(); | |||
const helpLink = docLinks.links.ml.anomalyDetection; | |||
|
|||
const timeseriesExplorerStyles = getTimeseriesExplorerStyles(); |
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.
Could this be done once outside the component instead of during every render?
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.
Done in 0d5af5f
@@ -204,6 +204,8 @@ const SingleMetricViewerWrapper: FC<SingleMetricViewerPropsWithDeps> = ({ | |||
} | |||
}; | |||
|
|||
const timeseriesExplorerStyles = getTimeseriesExplorerStyles(); |
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.
Could this be done once outside the component instead of during every render?
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.
Done in 0d5af5f
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.
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 |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it look ok with the dark theme as well?
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.
ah yes, I see it automatically adjust
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.
LGTM
💚 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":"[email protected]"},"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 <[email protected]>
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