-
Notifications
You must be signed in to change notification settings - Fork 799
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
Instant Search: add image alt text from API #22295
Conversation
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack plugin:
|
677c0be
to
cb9be12
Compare
@@ -77,7 +77,7 @@ export default function SearchResultExpanded( props ) { | |||
<div className="jetpack-instant-search__search-result-expanded__image-container"> | |||
{ firstImage ? ( | |||
<PhotonImage | |||
alt={ fields[ 'title.default' ] } | |||
alt={ fields[ 'image.alt_text' ] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about keeping title.default
as a fallback here, but it's complicated by the fact that alt=""
is valid alt text.
Feels best to rely on the alt text from the API in all cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tests well and looks good to me 👍
Some checks are failing, and the errors don't seem relevant to the PR - probably just need to rebase and have the checks re-run and see.
ea47400
to
26f082b
Compare
Well, you don't need to, you could do the version bumps manually. 😀 But fixup-project-versions saves the trouble of figuring out all the details. P.S. if you're on a Mac and that command is really slow, you might see p7H4VZ-3gs-p2 (or https://apple.stackexchange.com/questions/338415/php-incredibly-slow-since-upgrading-macos-to-10-14-mojave) |
Thanks @anomiex! Do we need to do this on every search PR in the future? |
a462b58
to
177ec23
Compare
I usually run it on my PRs that touch any project, just before pushing. It doesn't take that long and it'll safely do nothing if nothing is needed. In general for a composer package it's only needed if you're doing the first "minor" or "major" PR since the last time the package was released (which will generally be weekly, since packages used by Jetpack get released as part of the weekly Jetpack release for Atomic), unless the package is configured with a version number constant. |
@@ -0,0 +1,5 @@ | |||
Significance: patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think keeping projects/plugins/jetpack/changelog/add-instant-search-alt-text-where-available
is sufficient enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! It looks good and works well 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid this is going to need a rebase now. :(
177ec23
to
9118cc8
Compare
…instant-search-alt-text-where-available
Fixes #19273.
Changes proposed in this Pull Request:
The Instant Search API now provides
image.alt_text
as a field we can request.This PR adds the new field and switches to use it for alt text in the expanded and product result formats.
I've also reduced the fields fetched for the minimal result format (image fields are not needed).
Does this pull request change what data or activity we track or use?
No.
Testing instructions
/?s=
).