Search 3.0: add author to expanded results-list meta row (RSM-2999)#48751
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
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 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Search plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Code Coverage SummaryCoverage changed in 2 files.
|
…matAuthor (comments #3230642237, claude[bot] review)
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…e (claude[bot] re-review)
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🤖 Review-cycle summary —
|
| Source | Comment | Resolution |
|---|---|---|
| Copilot (inline) | result-utils.js:445 — authorLabel derived but author wasn't in SEARCH_FIELDS, so it would always be empty at runtime. |
Added 'author' to SEARCH_FIELDS; flipped the api.test.js assertion to require it. Resolved in 44cd5c6c664. |
| claude[bot] (review) | formatAuthor doesn't call decodeEntities; names like O’Brien would render literally via data-wp-text. |
Wired both string and array paths through decodeEntities; added a test case for numeric/named entity coverage. Resolved in 44cd5c6c664. |
| claude[bot] (re-review) | Stale test at result-utils.test.js:699 had a dotted fixture ('author.name') and a name that read as a prohibition of behavior the PR now provides. |
Renamed test, swapped fixture to the real author field, added explicit authorLabel === 'Ada Lovelace' assertion. Resolved in 88cbc2a1be5. |
Unaddressed (flagged for owner): None.
CI: all required checks passing.
Fixes RSM-2999
Why
Authors are a primary signal readers use to decide which result to click. Legacy Instant Search shows the post author in its expanded result card; Search 3.0's expanded
jetpack-search/results-listblock had dropped it. This PR brings that information back so site visitors and editors who migrate from Instant Search don't lose a familiar piece of context.Proposed changes
fields.authorfrom the v1.3 Search API into a singleauthorLabelon each result. Single-author posts pass through as-is; co-authored posts comma-join (Instant Search's behaviour), and >3 authors truncate to the first three + "..." so the meta row doesn't run away.show_authorper-layout flag, enabled for theexpandedlayout only (compact and product unchanged)..jetpack-search-results__metarow that holds the date — author first, then a·separator span, then the date. The separator is bound todata-wp-bind--hidden="!authorLabel || !dateLabel"so posts with only an author or only a date don't get a stray bullet.edit.js → renderExpandedPreview) so Gutenberg authors see the field in the inserter, including the multi-author and no-author edge cases..jetpack-search-results__metaas a flex row with a0.5remgap and move the meta row's top margin off of the date span so the new author span doesn't get a stale top offset. Compact layout keeps its inline-with-title behaviour via amargin-top: 0override.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Screenshots
Editor preview of the
jetpack-search/results-listblock in Expanded layout, captured locally via Playwright against the per-agent docker WordPress at 1440×900.Notice the third sample row in the After image — it intentionally has no author, and the
·separator is suppressed.Testing instructions
Acceptance criteria from RSM-2999, in checklist form:
jetpack-search/results-listblock in Expanded layout, a result with a single author shows that author in the meta row, before the date, separated by a·."..."(e.g.Ada, Bob, Cris...).·separator and no empty author span.