Skip to content

[Workspace Chrome] Adjust scrollIntoViewIfNeeded for the new layout #228796

Merged
Dosant merged 16 commits intoelastic:mainfrom
Dosant:d/2025-07-21-fix-custom-scorll-into-view
Aug 26, 2025
Merged

[Workspace Chrome] Adjust scrollIntoViewIfNeeded for the new layout #228796
Dosant merged 16 commits intoelastic:mainfrom
Dosant:d/2025-07-21-fix-custom-scorll-into-view

Conversation

@Dosant
Copy link
Copy Markdown
Contributor

@Dosant Dosant commented Jul 21, 2025

Summary

We're working on new layout engine for Kibana moving from legacy fixed layout to grid layout. New layout is in main behind feature flag feature_flags.overrides.core.chrome.layoutType: 'grid' and we're preparing for QA before the rollout.

When running functional tests with the new layout there turned out to be a lot of failures that I pin pointed to src/platform/packages/shared/kbn-ftr-common-functional-ui-services/services/web_element_wrapper/scroll_into_view_if_necessary.js This function is used for scrolling inside our ftr test. It didn't work properly with the new layout because the main application scroll is moved from document to internal main grid cell.

This PR adjusts the function to work well for both the old layout and the new layout.

However, there were issues with this function in the old layout as well. It didn't correctly decide if an element was visible when the page was scrolled down. I fixed it, but I had to adjust a couple of tests to account for the logical change.

@dolaru helped to run mki, and it passed: https://buildkite.com/elastic/appex-qa-serverless-kibana-ftr-tests/builds/6385, give a bit more confidence

@Dosant Dosant force-pushed the d/2025-07-21-fix-custom-scorll-into-view branch 2 times, most recently from 64331ac to 9660677 Compare August 5, 2025 12:46
@Dosant Dosant force-pushed the d/2025-07-21-fix-custom-scorll-into-view branch from 9660677 to 45d6339 Compare August 5, 2025 15:49
@Dosant Dosant changed the title adjust custom scroll into view logic [Workspace Chrome] Adjust scrollIntoViewIfNeeded to work with new layout Aug 13, 2025
@Dosant Dosant changed the title [Workspace Chrome] Adjust scrollIntoViewIfNeeded to work with new layout [Workspace Chrome] Adjust scrollIntoViewIfNeeded for the new layout Aug 13, 2025
@Dosant Dosant marked this pull request as ready for review August 14, 2025 07:51
@Dosant Dosant requested review from a team as code owners August 14, 2025 07:51
@Dosant Dosant added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// labels Aug 14, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

Copy link
Copy Markdown
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kibana-presentation changes LGTM
code review only


let fixedHeaderHeight = 0;
await Promise.all(
fixedHeaders.map(async (header) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using import { asyncMap } from '@kbn/std'; instead of fixedHeaders.map wrapped in Promise.all?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems that

await Promise.all(
  fixedHeaders.map(async (header) => {
    const headerHeight = (await header.getSize()).height;
    fixedHeaderHeight += headerHeight;
  })
);

becomes

await asyncMap(fixedHeaders, async (header) => {
  const headerHeight = (await header.getSize()).height;
  fixedHeaderHeight += headerHeight;
});

I am not sure it adds much to readability? and we don't need the limit.
But I'll keep it since I had to try it anyway.

Unless I am not missing more ways to simplify

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#9146

[✅] x-pack/platform/test/functional/apps/lens/group3/config.ts: 10/10 tests passed.
[✅] src/platform/test/functional/apps/dashboard/group3/config.ts: 10/10 tests passed.
[✅] src/platform/test/functional/apps/discover/group4/config.ts: 10/10 tests passed.
[✅] x-pack/platform/test/serverless/functional/configs/security/config.group2.ts: 10/10 tests passed.
[✅] x-pack/platform/test/serverless/functional/configs/observability/config.context_awareness.ts: 10/10 tests passed.

see run history

@Dosant
Copy link
Copy Markdown
Contributor Author

Dosant commented Aug 15, 2025

Random flaky test run looks good . We agreed with @dolaru and @dmlemeshko to merge after next serverless promotion to give more time for fixes and reverts if we see instabilities

Copy link
Copy Markdown
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kibana-presentation changes LGTM
code review only

Copy link
Copy Markdown
Contributor

@maxcold maxcold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cloud_security_posture test changes LGTM

@Dosant
Copy link
Copy Markdown
Contributor Author

Dosant commented Aug 19, 2025

Will merge after on-week

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Aug 26, 2025

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: e26f6a2
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-228796-e26f6a298d25

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #85 / Core Analysis - Entity Store @ess Host transform logic Install Entity Store and test Host transform Should not collect fields present in frozen or cold tier

Metrics [docs]

Unknown metric groups

ESLint disabled in files

id before after diff
@kbn/ftr-common-functional-ui-services 2 1 -1

Total ESLint disabled count

id before after diff
@kbn/ftr-common-functional-ui-services 2 1 -1

History

@Dosant Dosant merged commit 382ab9d into elastic:main Aug 26, 2025
12 checks passed
@Dosant Dosant added the chrome-grid Work related to Chrome refactor to grid layout label Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting chrome-grid Work related to Chrome refactor to grid layout ci:build-serverless-image release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants