Prioritise replacement images over cutouts #278
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change?
Per @davidfurey's suggestion in an out-of-band discussion, this PR prioritises resolving image replacements over cutouts when we're getting images from trail meta.
This solves a problem where, for content with the Comment tone, replacement images are being ignored in favour of cutouts. This happens because we set
imageCutoutReplace
automatically when we encounter that tone.AFAICS we don't set
imageReplace
automatically within this repo, andfacia-tool
sets that value exclusively ofimageCutoutReplace
(when one image value istrue
, the others are not), so we should not run into problems where this priority is incorrect.Dev notes
It's worth noting that this might not be the most comprehensive way of solving this problem – I'm fairly convinced it'd be better to make the decision about tags and defaults in the Fronts tool, and pass those decisions down as data –
A previous PR attempting to solve this problem took the above approach, but was reverted as the changes required were more involved and would have required some co-ordination.
This codebase moves slowly, and this is a problem that's come up a few times recently, so I think this is a good patch even if we end taking the above approach in the future.
How to test
How can we measure success?
Fewer editorial complaints about unexpected behaviour.