Skip to content

[MWPW-190551] Preflight integration with C2 blocks#5737

Merged
milo-pr-merge[bot] merged 9 commits into
stagefrom
preflight-siteredesign-integration
May 20, 2026
Merged

[MWPW-190551] Preflight integration with C2 blocks#5737
milo-pr-merge[bot] merged 9 commits into
stagefrom
preflight-siteredesign-integration

Conversation

@skholkhojaev
Copy link
Copy Markdown
Contributor

@skholkhojaev skholkhojaev commented Mar 31, 2026

This PR makes it so that utils.js would make an exception for prelfight when running on a page that has C2 blocks.
in addition it adds some css and code to help it be more compatible with the C2 blocks

Test URLs:

@skholkhojaev skholkhojaev requested a review from a team as a code owner March 31, 2026 15:10
@aem-code-sync
Copy link
Copy Markdown
Contributor

aem-code-sync Bot commented Mar 31, 2026

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

  • Re-sync branch
Commits

Comment thread libs/blocks/preflight/checks/assets.js Outdated
asset.addEventListener(event, resolve, { once: true });
})));
})),
new Promise((resolve) => { setTimeout(resolve, 5000); }),
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.

Why the 5s timeout? 🤔

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.

so i've been testing the preflight in multiple different pages and in one of the draft pages that you gave me (https://main--milo--adobecom.aem.page/drafts/rbogos/c2/multimedia-marquee-21) the Assets never loaded so i figured that it might becuase the element never fired either "loadedmetaddata" or "error" so i added a 5 seconds timeout to fix any race conditions

if 5 seconds is too long i could reduce it to 2 or i could fix the block to make sure that it listens to the correct value to fire back only "loadedmetaddata" or "error"

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.

A specific timeout can leave room for unwanted behaviour. I would try to use something like the PerformanceObserver and wait for network calls to calm down. Something along the lines of: when no networks calls are done in the past 3s, do something

Comment thread libs/utils/utils.js Outdated
@aem-code-sync aem-code-sync Bot temporarily deployed to preflight-siteredesign-integration April 1, 2026 16:18 Inactive
Comment thread libs/utils/utils.js Outdated
const isAutoBlock = AUTO_BLOCKS.some((autoBlock) => autoBlock[name]);

if (isC2Page && isC1Block && !isC2Block && !isAutoBlock) return { name, isInvalid: true };
const isPageAgnostic = name === 'preflight';
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.

can we add to an array; we might have other tools that are basically page agnostic.

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.

Yes! Done 👍

@aem-code-sync aem-code-sync Bot temporarily deployed to preflight-siteredesign-integration April 2, 2026 07:35 Inactive
@@ -4,6 +4,18 @@ import { displayPreflightVisuals } from '../visual-metadata.js';

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.

I see https://preflight-siteredesign-integration--milo--adobecom.aem.live/libs/c2/blocks/global-footer/adobe-logo-full.svg is showing that it has never been previewed or published, but accessing a file I get 200. Helix status shows 404.

Base automatically changed from site-redesign-foundation to main April 2, 2026 12:50
Comment thread libs/utils/utils.js
Comment on lines +1109 to +1110
const PAGE_AGNOSTIC_BLOCKS = ['preflight'];
const isPageAgnostic = PAGE_AGNOSTIC_BLOCKS.includes(name);
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.

super nit, but why not lump these const declarations with the rest up above

@narcis-radu narcis-radu changed the base branch from main to site-redesign-foundation April 9, 2026 11:09
Copy link
Copy Markdown
Contributor

@robert-bogos robert-bogos left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@github-actions
Copy link
Copy Markdown
Contributor

This PR has not been updated recently and will be closed in 7 days if no action is taken. Please ensure all checks are passing, https://github.com/orgs/adobecom/discussions/997 provides instructions. If the PR is ready to be merged, please mark it with the "Ready for Stage" label.

@narcis-radu
Copy link
Copy Markdown
Contributor

@biljana-cvijanovic - can you provide feedback in the PR? Looks like you had some concerns in JIRA

@biljana-cvijanovic
Copy link
Copy Markdown
Contributor

After testing, I identified several issues and added them as comments in the Jira ticket https://jira.corp.adobe.com/browse/MWPW-190551 . The issues were discussed with @robert-bogos in case he had time to review them while Sino was away.
Since there have been no updates, I guess @skholkhojaev can continue and update the PR. The ticket will be reassigned to him.

@skholkhojaev
Copy link
Copy Markdown
Contributor Author

got it, thankyou @biljana-cvijanovic !

Base automatically changed from site-redesign-foundation to stage April 27, 2026 10:11
@github-actions
Copy link
Copy Markdown
Contributor

Reminder to set the Ready for Stage label - to queue this to get merged to stage & production.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

This PR has not been updated recently and will be closed in 7 days if no action is taken. Please ensure all checks are passing, https://github.com/orgs/adobecom/discussions/997 provides instructions. If the PR is ready to be merged, please mark it with the "Ready for Stage" label.

@github-actions github-actions Bot added the Stale label May 6, 2026
@skholkhojaev skholkhojaev changed the base branch from stage to site-redesign-foundation May 7, 2026 12:40
@github-actions github-actions Bot removed the Stale label May 8, 2026
@aem-code-sync aem-code-sync Bot temporarily deployed to preflight-siteredesign-integration May 13, 2026 08:52 Inactive
@skholkhojaev
Copy link
Copy Markdown
Contributor Author

skholkhojaev commented May 13, 2026

i've added two new commits since last reivew maybe it would be a good to have someone give a quick review before the QA approval @robert-bogos @mokimo

@biljana-cvijanovic
Copy link
Copy Markdown
Contributor

Validated. Test details https://jira.corp.adobe.com/browse/MWPW-190551

@aem-code-sync aem-code-sync Bot temporarily deployed to preflight-siteredesign-integration May 20, 2026 12:16 Inactive
@narcis-radu narcis-radu changed the base branch from site-redesign-foundation to stage May 20, 2026 15:59
@narcis-radu narcis-radu changed the base branch from stage to site-redesign-foundation May 20, 2026 16:00
@skholkhojaev skholkhojaev changed the base branch from site-redesign-foundation to stage May 20, 2026 16:14
@skholkhojaev skholkhojaev force-pushed the preflight-siteredesign-integration branch from a05cfe3 to f25149b Compare May 20, 2026 16:37
@skholkhojaev skholkhojaev force-pushed the preflight-siteredesign-integration branch from f25149b to 6833229 Compare May 20, 2026 16:41
@milo-pr-merge milo-pr-merge Bot merged commit b811266 into stage May 20, 2026
19 of 20 checks passed
@milo-pr-merge milo-pr-merge Bot deleted the preflight-siteredesign-integration branch May 20, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants