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-162956: Setting accessibleLabel as sr-only #3738

Open
wants to merge 4 commits into
base: stage
Choose a base branch
from

Conversation

Copy link
Contributor

aem-code-sync bot commented Feb 25, 2025

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
Contributor

aem-code-sync bot commented Feb 25, 2025

Page Scores Audits Google
📱 /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] reported by reviewdog 🐶
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] reported by reviewdog 🐶
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] reported by reviewdog 🐶
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] reported by reviewdog 🐶
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] reported by reviewdog 🐶
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

Copy link
Contributor

This pull request is not passing all required checks. Please see this discussion for information on how to get all checks passing. Inconsistent checks can be manually retried. If a test absolutely can not pass for a good reason, please add a comment with an explanation to the PR.

# Conflicts:
#	libs/deps/mas/commerce.js
#	libs/deps/mas/mas.js
#	libs/deps/mas/merch-card.js
#	libs/features/mas/dist/mas.js
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] reported by reviewdog 🐶
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] reported by reviewdog 🐶
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

@seanchoi-dev seanchoi-dev marked this pull request as ready for review March 8, 2025 02:54
Copy link
Contributor

@yesil yesil left a comment

Choose a reason for hiding this comment

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

Overall I like the direction, but I would like to consolidate all price formatting logic in price/template.js

@@ -742,7 +742,7 @@ header.global-navigation + .feds-localnav {
height: var(--global-height-navPromo);
}

.feds-sr-only {
sr-only, .feds-sr-only {
Copy link
Contributor

Choose a reason for hiding this comment

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

this should move to global.css.js from MAS otherwise, outside Milo, sr-only will be shown to MAS consumers.

@@ -136,11 +137,10 @@ function renderContainer(
taxInclusivityLabel,
true,
);

return renderSpan(cssClass, markup, {
const regularlySRLabel = accessibleLabel ? `<sr-only class="strikethrough-aria-label">${accessibleLabel}</sr-only>` : '';
Copy link
Contributor

Choose a reason for hiding this comment

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

can we instead do at the line 127:
let markup = accessibleLabel ? <sr-only class="strikethrough-aria-label">${accessibleLabel}</sr-only> : '';


// Adding logic for <sr-only>Alternatively at</sr-only>
const htmlPattern = /<\/?[^>]+(>|$)/g;
async function formatLiteral(key, parameters) {
Copy link
Contributor

Choose a reason for hiding this comment

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

formatLiteral is already in template.js, please do not duplicate it.
inline-price is used only in the Milo implementation.
Dexter, and current Offer Selector Tool will not run this logic while rendering a price.
Please find way to move this logic to template.js

@@ -15,6 +15,9 @@ const priceOptical = createPriceTemplate({
const priceStrikethrough = createPriceTemplate({
displayStrikethrough: true,
});
const priceAlternative = createPriceTemplate({
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of creating priceAlternative, can we

const priceStrikethrough = createPriceTemplate({
    displayStrikethrough: true,
    alternativePrice: true|false
});

alternativePrice could be an option set in inline-price.js based on some attributes or offer data.

Also, likely we need to add this to some of other price rendering function, maybe pricePromoWithAnnual ?

happy to discuss this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants