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

[Q1 FY25 | SEO] Discover More Cards #248

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

Conversation

jsandland
Copy link
Collaborator

@jsandland jsandland commented Mar 12, 2025

Describe your specific features or fixes:

Authoring Example: milo-discover-more-cards.docx

Resolves: MWPW-166954
discover-more-cards

Test URLs:

…dge, and on wide screens space between cards remains uniform
…f the view and gaps remain uniform on wide screens
Copy link

aem-code-sync bot commented Mar 12, 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

aem-code-sync bot commented Mar 12, 2025

@codecov-commenter
Copy link

codecov-commenter commented Mar 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.43%. Comparing base (1d7887e) to head (33fc3e9).
Report is 60 commits behind head on stage.

Additional details and impacted files
@@            Coverage Diff             @@
##            stage     #248      +/-   ##
==========================================
- Coverage   67.12%   66.43%   -0.69%     
==========================================
  Files          63       62       -1     
  Lines       10353    10345       -8     
==========================================
- Hits         6949     6873      -76     
- Misses       3404     3472      +68     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

scroll-behavior: smooth;
padding: 0 16px;
scroll-padding: 0 16px;
.gallery,
Copy link
Collaborator

Choose a reason for hiding this comment

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

this might affect other galleries on the same page right? Maybe this line is not wanted?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

these are the default rules that existed for the gallery - in order to avoid duplicating rules - I added the variant rule to all the rules that are identical

.discover-cards.more .card {
background-color: transparent;
min-width: 250px;
width: 250px;
Copy link
Collaborator

Choose a reason for hiding this comment

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

do you have cases where both need to be defined to be the same values?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If I don't include min-width- the cards collapse when the view gets small - these rules ensure no matter how wide the viewport - the cards are always the same size

Copy link
Collaborator

Choose a reason for hiding this comment

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

i see, there are conflicting rules for .discover-cards .cards-container .card

I would recommend making them min-width: initial to be clearer that you're intentionally overriding other rules tho

const isFlipped = card.classList.contains('is-flipped');
card.setAttribute(
'aria-label',
isFlipped ? `Go back to ${card.cardTitle}` : `Learn more about ${card.cardTitle}`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

do these need to be authorable? What about localization?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No authoring requirements were given for these.

Copy link
Collaborator

Choose a reason for hiding this comment

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

could you check with the designers and authors? Because technically as an accessibility practice, those labels should be in different languages when deployed internationally. Otherwise users will only hear about those labels in the hardcoded English values.
But it can be a follow up too, if it's going to be deployed on EN pages first.
@fullcolorcoder are you familiar with how Milo supports authoring for this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@jsandland @JingleH Placeholders can handle this, and authoring is generally aware of that but if it can be avoided I'd favor that and I suspect they would too if given the option. Since this isn't just a test/jdi, I'd pair up with Earnest and come to an agreement since authoring efforts would be duplicated if we change the approach as a fast follow.


card.setAttribute('tabindex', '0');
card.setAttribute('role', 'button');
card.setAttribute('aria-label', `Learn more about ${card.cardTitle}`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as below: do these need to be authorable? What about localization?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have reached out to design but no heard back - can do a fast follow in a future pr


const cards = block.querySelectorAll(':scope > div:not(:first-child)');
const numCards = cards.length;
cardsWrapper.setAttribute('aria-label', `${numCards} cards in this section`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as below: do these need to be authorable? What about localization?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will do a fast follow

firstChild.classList.add('center-title');
const header = firstChild.querySelector('h1, h2, h3');
header.setAttribute('aria-label', `${header.textContent.trim()} cards`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as below: do these need to be authorable? What about localization?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will do a fast follow

@jsandland jsandland added the Ready for Review Ready for peer review. label Mar 12, 2025
@aem-code-sync aem-code-sync bot temporarily deployed to milo-discover-more-cards March 12, 2025 22:25 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to milo-discover-more-cards March 12, 2025 22:26 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to milo-discover-more-cards March 12, 2025 22:36 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to milo-discover-more-cards March 12, 2025 22:39 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for Review Ready for peer review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants