Skip to content

feat: use regular card styles for search results page#256

Merged
jawinn merged 3 commits into
mainfrom
feat-search-cards
Jun 23, 2026
Merged

feat: use regular card styles for search results page#256
jawinn merged 3 commits into
mainfrom
feat-search-cards

Conversation

@jawinn

@jawinn jawinn commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary of changes

Use regular card styles for search results page

Changes the search results to use the regular card styles/markup, as it is used on other pages. Includes the added badge with the date. Removes most of its custom card styling and markup.

Adds an option to buildCard to pass in the image URL instead of the picture element, and refactors where createOptimizedPicture is used so it runs within this function instead of having to be imported and called elsewhere.

Adds a parameter so buildCard can be created with an li container instead of a div.

Screenshot 2026-06-12 at 2 51 33 PM

Relevant Links

Test URLs:

Checklist

  • ⭐ This PR has visual changes, and the PR testing link has been reviewed by a designer. NOTE: share testing link for approval before merge.
  • This PR has code changes, and our linters still pass.
  • This PR affects production code, so it was browser tested (see below).

Validation

  1. Make sure all PR checks have passed.
  2. Pull down all related branches.
  3. The search results page shows cards with the same styles as the homepage and Ideas page article list. Cards look correct and are responsive in the same way.
  4. No regressions on the existing post lists on the homepage, tag pages, and ideas page.
  5. Voiceover reads visually hidden punctuation that gives a pause between the date and the title.

Browser Testing

We should aim to support the latest version of the listed browsers. For older versions or other browsers not on the list, content should be accessible, even if it doesn't completely match the designs.

Developers should test as they work in the browsers available on their machines. If they have access to other devices to test other browser/OS combinations, they should do that when possible.

Windows

  • Firefox
  • Chrome
  • Edge

MacOS

  • Firefox
  • Chrome
  • Safari
  • Edge

Android

  • Firefox
  • Chrome
  • Edge

iOS

  • Safari

@aem-code-sync

aem-code-sync Bot commented Jun 12, 2026

Copy link
Copy Markdown

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 all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

Change the search results to use the regular card styles/markup, as it
is used on other pages, with the added badge that includes the date.
Removes most of its custom card styling and markup.

Adds an option to `buildCard` to pass in the image url instead of the
picture element, and refactors where `createOptimizedPicture` is used
so it runs within this function instead of having to be imported and
called elsewhere.

Adds a parameter so `buildCard` can be created with an `li` container
instead of a `div`.

ADB-315
@aem-code-sync

aem-code-sync Bot commented Jun 12, 2026

Copy link
Copy Markdown
Page Scores Audits Google
📱 / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@jawinn jawinn force-pushed the feat-search-cards branch from 7c870a4 to c8f5fd6 Compare June 12, 2026 18:44
@aem-code-sync aem-code-sync Bot temporarily deployed to feat-search-cards June 12, 2026 18:44 Inactive
const image = document.createElement('img');
image.src = result.image;
image.alt = "";
image.loading = "lazy";

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Note: the new built card markup is already set loading to lazy.

Comment thread blocks/card/card.js

if (cardData?.img) {
cardData.img.classList.add('card__image');
cardData.img.setAttribute('alt', '');

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Note: this was mistakenly modifying alt on the picture element (not a thing) instead of the child img. Fixed in the new version.

@aem-code-sync aem-code-sync Bot temporarily deployed to feat-search-cards June 12, 2026 21:13 Inactive
Comment thread blocks/search-results/search-results.css Outdated
Keep the results article date reading order the same as its visual order
and add punctuation so there is a pause before the title when it is read
by a screen reader (Voiceover).
@jawinn jawinn merged commit f0c9364 into main Jun 23, 2026
5 checks passed
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