Skip to content
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

[MWPW-159324] Progress loader circle delay handling #150

Open
wants to merge 1 commit into
base: stage
Choose a base branch
from

Conversation

robert-bogos
Copy link
Collaborator

Description:
This PR handles the unwanted delay in the loader circle render by moving the async loading elements outside of the function which gets triggered by clicking the "Remove background" or "Upload image" button.

Resolves: MWPW-159324

Testing instructions:
Do these for both the before and after test URLs:

  1. open an incognito window.
  2. go to the test url.
  3. try clicking the "Remove background" or "Upload image" button.
  4. Observe the delay between the click and the loader circle render.

Test URLs:
Before: https://stage--unity--adobecom.hlx.page/drafts/rbogos/remove-background
After: https://mwpw-159324-loader-delay--unity--adobecom.hlx.page/drafts/rbogos/remove-background

Copy link

aem-code-sync bot commented Nov 13, 2024

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

Copy link

aem-code-sync bot commented Nov 13, 2024

Page Scores Audits Google
📱 /drafts/rbogos/remove-background PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /drafts/rbogos/remove-background PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@aishwaryamathuria aishwaryamathuria self-requested a review November 19, 2024 16:20
@@ -24,6 +24,26 @@ export default class ActionBinder {
this.errorToastEl = null;
this.psApiConfig = this.getPsApiConfig();
this.serviceHandler = null;
this.loadServiceHandler();
this.loadSVGsMaybe();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will add both progress circle and all the svgs (Including the ones that are present on the buttons that will be made visible only when user interacts) in the critical rendering path. Can we split this into two functions and call the progress circle js and css loader here and load svg in psActions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe I'm missing something, but this will not work because we'll still load the other SVGs when the user clicks on "Remove background".
This will still cause a delay between the button click and the 'show' action for the progress circle.

@aishwaryamathuria aishwaryamathuria self-requested a review November 21, 2024 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants