Skip to content

[Lens][Embeddable] Make UI react faster to click actions like create or edit#210084

Closed
dej611 wants to merge 6 commits intoelastic:mainfrom
dej611:fix/209361-2
Closed

[Lens][Embeddable] Make UI react faster to click actions like create or edit#210084
dej611 wants to merge 6 commits intoelastic:mainfrom
dej611:fix/209361-2

Conversation

@dej611
Copy link
Copy Markdown
Contributor

@dej611 dej611 commented Feb 6, 2025

Summary

This PR is based on the idea in #209361 and tries to improve perceived performances for all the scenarios where the editorFrame is loaded.

On fast connections this is now perceived very fast:

dashboard_faster_load

On Fast 4g is still fast

dashboard_fast_load

On Slow 4g is acceptable

dashboard_slow_load

As a bonus extra tests have been added for the ES|QL creation flow.

cc @thomasneirynck @nreese

Checklist

@dej611 dej611 added Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// release_note:skip Skip the PR/issue when compiling release notes Feature:Lens backport:skip This PR does not require backporting Feature:Embeddables Relating to the Embeddable system labels Feb 6, 2025
@dej611
Copy link
Copy Markdown
Contributor Author

dej611 commented Feb 6, 2025

/ci

@elasticmachine
Copy link
Copy Markdown
Contributor

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!

@dej611
Copy link
Copy Markdown
Contributor Author

dej611 commented Feb 10, 2025

/ci

@dej611
Copy link
Copy Markdown
Contributor Author

dej611 commented Feb 10, 2025

/ci

}) => Promise<void | boolean>;

async function expectRerenderOnDataLoder(
async function expectRerenderOnDataLoader(
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.

Fixed a typo

('attributes' in rawState ? rawState : { attributes: rawState }) as LensRuntimeState,
references?.length ? references : undefined
);
if (newState.isNewPanel) {
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.

If it's a new panel, we can safely assume (for now) that is a ES|QL panel.
Therefore try to load the attributes from the query here

const query = initialState.attributes.state.query;

const panelEsqlVariables$ = new BehaviorSubject<ESQLControlVariable[]>([]);
esqlVariables$.subscribe((newVariables) => {
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.

This led to a memory leak as it wasn't removed at unmount.
The code has moved into the data_loader where the subscription is correctly removed at umount.

editorFrameService,
const lensEmbeddable = await embeddable.addNewPanel<object, LensApi>({
panelType: 'lens',
serializedState: {
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.

Moving away from the runtime state as requested by the presentation team.
Also it has the benefit to move the loading logic into the deserializeState helper

@dej611
Copy link
Copy Markdown
Contributor Author

dej611 commented Feb 10, 2025

/ci

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Feb 10, 2025

💔 Build Failed

Failed CI Steps

History

cc @dej611

@dej611
Copy link
Copy Markdown
Contributor Author

dej611 commented Feb 12, 2025

Closing for now as I'm breaking this up into multiple smaller PRs

@dej611 dej611 closed this Feb 12, 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 Feature:Embeddables Relating to the Embeddable system Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t//

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants