Skip to content

Conversation

@twrichards
Copy link
Contributor

@twrichards twrichards commented Nov 17, 2025

Fixes #4246

What does this change?

  • reactors the existing 'org owned' ticker to be more generic, crucially, changing the shape of the actions field in the search response from an [optional] integer, which opaquely meant the org owned count within the current search, to something more structured
    image
  • added new agencyPicks.ingredients config option to common.conf which supports a map of field name to list of words/phrases to match phrase on, e.g.
    image
  • add a new is:agency-pick search, which is a query built by ORing together each of the words/phrases from the above config as match phrase queries against the relevant field
  • added a new 'ticker' for agency picks which uses the is:agency-pick query as a 'filter aggregation' when searching (same as the 'org owned' ticker) but also does a 'sub aggregation' on the top 9 usageRights.supplier (with an other count if applicable) and presents these as a table in the tooltip (to get a breakdown at a glance)
    image
  • adds a delay to the tooltips on the tickers (as per suggestion from @paperboyo)
  • when subsequent ticker counts come in (on the polling calls which power the X new badge), they're now merged into the first set of counts (via mutation) rather than being held as a separate variable, which simplifies the html template code.
  • adds a maroon border to all images which match the config (this is done in the browser with case-insensitive matching for text based fields e.g. metadata.description and exact matching for array based fields e.g. metadata.keywords)
    image

Tested? Documented?

  • locally by committer
  • locally by Guardian reviewer
  • on the Guardian's TEST environment
  • relevant documentation added or amended (if needed)

@github-actions
Copy link

github-actions bot commented Nov 17, 2025

@twrichards twrichards force-pushed the agency-picks branch 10 times, most recently from fdc7b74 to 498bad8 Compare November 23, 2025 22:59
@twrichards twrichards self-assigned this Nov 24, 2025
…ts.supplier`) with red border on matching images (definition is in common.conf under `agencyPicks.ingredients`)
@twrichards twrichards marked this pull request as ready for review November 25, 2025 08:59
@twrichards twrichards requested a review from a team as a code owner November 25, 2025 08:59
…ig property `agencyPicks.colour` to allow override
@twrichards twrichards changed the title add is:agency-pick with 'ticker' (which has breakdown by credit/supplier) add is:agency-pick with 'ticker' (which has breakdown bysupplier) Nov 25, 2025
@twrichards twrichards changed the title add is:agency-pick with 'ticker' (which has breakdown bysupplier) add is:agency-pick with 'ticker' (which has breakdown by supplier) Nov 25, 2025
Comment on lines +44 to +46
| "SPOTLIGHT", // Rex/Shutterstock
| "spotlight", // Rex/Shutterstock
| "Spotlight" // Rex/Shutterstock
Copy link
Member

Choose a reason for hiding this comment

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

these seem to pick up a fair few non-shutterstock pics which are not an "agency pick". Since Feb shutterstock seems to provide an "EDITORS' PICKS" which looks a much clearer signal to me

Copy link
Contributor

Choose a reason for hiding this comment

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

For visibility. We have done some searches, and it may be best to match on both. This is from our friends at Shutterstock:

spotlight and editors picks can be used interchangeably. On our end we have a unique “spotlight” category which is used for filtering the best/most impactful images on the website. When that category is applied it also adds the keyword “editors picks”. On transmission to ftp clients, both “spotlight” and “editors picks” should be available in the keywords field.

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.

[feature] Agency picks

4 participants