-
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
[Core Rendering Styles] Fix bug with kibanaFullBodyHeight calculation #193798
[Core Rendering Styles] Fix bug with kibanaFullBodyHeight calculation #193798
Conversation
0bf86aa
to
08ee079
Compare
@@ -67,7 +67,7 @@ | |||
} | |||
|
|||
.kbnBody--chromeHidden { | |||
--euiFixedHeadersOffset: 0; | |||
--euiFixedHeadersOffset: 0px; |
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.
The problem was: this calculation, which is used in Discover, was coming up wrong:
@media only screen and (min-width: 1200px) {
.dscPage {
// --kbnAppHeadersOffset is undefined
// --euiFixedHeadersOffset is `0`
height: calc(100vh - var(--kbnAppHeadersOffset, var(--euiFixedHeadersOffset, 0)));
}
}
@cee-chen found the reason why in a spec: https://drafts.csswg.org/css-values-3/#calc-type-checking
Note: Because s are always interpreted as s or s, "unitless 0" s aren’t supported in calc(). That is, width: calc(0 + 5px); is invalid, even though both width: 0; and width: 5px; are valid.
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.
that's very strange, it seems that this change now causes a functional test error here:
kibana/test/functional/services/visualizations/elastic_chart.ts
Lines 43 to 50 in 2b344d2
public async waitForRenderComplete(dataTestSubj?: string, timeout?: number) { | |
const chart = await this.getChart(dataTestSubj, timeout); | |
const rendered = await chart.findAllByCssSelector( | |
'.echChartStatus[data-ech-render-complete=true]', | |
timeout | |
); | |
expect(rendered.length).to.equal(1); | |
} |
I've checked the html of the failure
And so it failes because it seems data-ech-render-complete=false
doesn't turn to true
dear @elastic/kibana-visualizations , do you have an idea what's happening here?
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.
Interesting. Does the test fail with the attribute still set to false, but the chart rendered? Or the panel is still in a loading phase?
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.
Interesting, looks like the charts now starts a redraw due to the height change.
Is not the first time I see this, where the discover heatmap is rendered 2 times because of some jumps in the layout rendering of the table.
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.
that's is a possible workaround. I believe there is still something that needs to be anyway solved as it doesn't seems to work correctly.
I've checked locally and I can see the following:
before this PR, when switching to full screen the chart height goes to zero, and back to its height when toggling the fullscreen off. With this PR the chart remain the same size but is hidden behind the position:fixed table. This, for some reason I don't understand cause a trigger in the ResizeObserver we are using to compute the chart size causing it to turn the rendered off, but doesn't trigger it again. I can investigate a bit more if you want
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.
ok, the way I see it, yes, it's related to the data grid going to full screen, and with the changes of this PR, as you said, the chart remains same size. For me it seems like we could try to remove the await this.testSubjects.click('dataGridFullScreenButton');
, check for flakiness, and if there's no quick fix for the ResizeObserver not being triggered again (which shold be investigated I think), open an issue to track this
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.
@kertal @tsullivan not sure if this is a bug in Charts or in ResizeObserver (that triggers a size change even if there is no size change in the chart), but I've created a PR to fix this in charts.
I will merge the fix in charts, and push an upgraded charts version in Kibana today if possible
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.
Awesome 🎉 thx!
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.
Sorry for the late work on that, we finally manage to fix the bug in charts, and we are now waiting for a CI to pass before merging the charts dependency update in Kibana #194794
Please do a bootstrap locally if you want to see and test the changes
08ee079
to
1c56a35
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.
Thanks so much for identifying the fix Tim!
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.
Nice!
@elasticmachine merge upstream |
Flaky Test Runner Stats🟠 Some tests failed. - kibana-flaky-test-suite-runner#7007[❌] test/functional/apps/discover/group1/config.ts: 0/50 tests passed. |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: |
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#7092[✅] test/functional/apps/discover/group1/config.ts: 50/50 tests passed. |
Starting backport for target branches: 8.x |
Thanks so much @markov00 for handling the chart issue! |
…elastic#193798) A variable for the page height was not being calculated correctly when the Kibana chrome is invisible. This PR fixes the issue by adding `px` as a unit to a variable used as input in the calculation. Unblocks: elastic#193647 ## Testing It will help to test within the elastic#193647 PR branch. The following screenshots show the before and after effects of having this fix: **before** ![ghjkgjghgkhjgjgkjg-1](https://github.com/user-attachments/assets/d684bc77-dcc0-40ef-9271-8ae198582eea) **after** ![ghjkgjghgkhjgjgkjg-2](https://github.com/user-attachments/assets/5198cc43-b721-4ce8-92f0-0b2bac9f5eb5) Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Marco Vettorello <[email protected]> (cherry picked from commit 1df458d)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…lation (#193798) (#195146) # Backport This will backport the following commits from `main` to `8.x`: - [[Core Rendering Styles] Fix bug with kibanaFullBodyHeight calculation (#193798)](#193798) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Tim Sullivan","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-04T21:00:57Z","message":"[Core Rendering Styles] Fix bug with kibanaFullBodyHeight calculation (#193798)\n\nA variable for the page height was not being calculated correctly when\r\nthe Kibana chrome is invisible. This PR fixes the issue by adding `px`\r\nas a unit to a variable used as input in the calculation.\r\n\r\nUnblocks: https://github.com/elastic/kibana/pull/193647\r\n\r\n## Testing\r\nIt will help to test within the\r\nhttps://github.com//pull/193647 PR branch. The following\r\nscreenshots show the before and after effects of having this fix:\r\n\r\n**before**\r\n\r\n![ghjkgjghgkhjgjgkjg-1](https://github.com/user-attachments/assets/d684bc77-dcc0-40ef-9271-8ae198582eea)\r\n\r\n**after**\r\n\r\n![ghjkgjghgkhjgjgkjg-2](https://github.com/user-attachments/assets/5198cc43-b721-4ce8-92f0-0b2bac9f5eb5)\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>\r\nCo-authored-by: Marco Vettorello <[email protected]>","sha":"1df458d2d605f5a3281c3b18bda9f433d41a7c05","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","v8.16.0","backport:version"],"title":"[Core Rendering Styles] Fix bug with kibanaFullBodyHeight calculation","number":193798,"url":"https://github.com/elastic/kibana/pull/193798","mergeCommit":{"message":"[Core Rendering Styles] Fix bug with kibanaFullBodyHeight calculation (#193798)\n\nA variable for the page height was not being calculated correctly when\r\nthe Kibana chrome is invisible. This PR fixes the issue by adding `px`\r\nas a unit to a variable used as input in the calculation.\r\n\r\nUnblocks: https://github.com/elastic/kibana/pull/193647\r\n\r\n## Testing\r\nIt will help to test within the\r\nhttps://github.com//pull/193647 PR branch. The following\r\nscreenshots show the before and after effects of having this fix:\r\n\r\n**before**\r\n\r\n![ghjkgjghgkhjgjgkjg-1](https://github.com/user-attachments/assets/d684bc77-dcc0-40ef-9271-8ae198582eea)\r\n\r\n**after**\r\n\r\n![ghjkgjghgkhjgjgkjg-2](https://github.com/user-attachments/assets/5198cc43-b721-4ce8-92f0-0b2bac9f5eb5)\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>\r\nCo-authored-by: Marco Vettorello <[email protected]>","sha":"1df458d2d605f5a3281c3b18bda9f433d41a7c05"}},"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/193798","number":193798,"mergeCommit":{"message":"[Core Rendering Styles] Fix bug with kibanaFullBodyHeight calculation (#193798)\n\nA variable for the page height was not being calculated correctly when\r\nthe Kibana chrome is invisible. This PR fixes the issue by adding `px`\r\nas a unit to a variable used as input in the calculation.\r\n\r\nUnblocks: https://github.com/elastic/kibana/pull/193647\r\n\r\n## Testing\r\nIt will help to test within the\r\nhttps://github.com//pull/193647 PR branch. The following\r\nscreenshots show the before and after effects of having this fix:\r\n\r\n**before**\r\n\r\n![ghjkgjghgkhjgjgkjg-1](https://github.com/user-attachments/assets/d684bc77-dcc0-40ef-9271-8ae198582eea)\r\n\r\n**after**\r\n\r\n![ghjkgjghgkhjgjgkjg-2](https://github.com/user-attachments/assets/5198cc43-b721-4ce8-92f0-0b2bac9f5eb5)\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>\r\nCo-authored-by: Marco Vettorello <[email protected]>","sha":"1df458d2d605f5a3281c3b18bda9f433d41a7c05"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Tim Sullivan <[email protected]>
…elastic#193798) A variable for the page height was not being calculated correctly when the Kibana chrome is invisible. This PR fixes the issue by adding `px` as a unit to a variable used as input in the calculation. Unblocks: elastic#193647 ## Testing It will help to test within the elastic#193647 PR branch. The following screenshots show the before and after effects of having this fix: **before** ![ghjkgjghgkhjgjgkjg-1](https://github.com/user-attachments/assets/d684bc77-dcc0-40ef-9271-8ae198582eea) **after** ![ghjkgjghgkhjgjgkjg-2](https://github.com/user-attachments/assets/5198cc43-b721-4ce8-92f0-0b2bac9f5eb5) Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Marco Vettorello <[email protected]>
A variable for the page height was not being calculated correctly when the Kibana chrome is invisible. This PR fixes the issue by adding
px
as a unit to a variable used as input in the calculation.Unblocks: #193647
Testing
It will help to test within the #193647 PR branch. The following screenshots show the before and after effects of having this fix:
before
after