Skip to content

Bump models to include new video captions field - #28728

Merged
simonbyford merged 7 commits into
mainfrom
rjr-bump-capi-model-to-include-new-video-caption-field
May 20, 2026
Merged

Bump models to include new video captions field#28728
simonbyford merged 7 commits into
mainfrom
rjr-bump-capi-model-to-include-new-video-caption-field

Conversation

@RikRootsGuardian

@RikRootsGuardian RikRootsGuardian commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

What does this change?

Composer users need an easier way to update captions for video atoms. The current process of updating them in MAM is laborious and prevents us from showing different captions for the same video on different articles, which is sometimes helpful.

The work in this PR is part of a chain of PRs to add a new caption field to the atom editor in Composer. This field should:

  • Default to the Media atom's title value, set in the Media Atom Maker tool
  • Be editable within Composer
  • Allow users to clear the field, which would remove the caption entirely from videos used in an article (including standfirst videos)

See the Rethink media atom captions in Composer issue (in the Arts&Pubs project) for further details

Testing

We have tested this by running frontend locally and also running DCR locally and then visiting:

http://localhost:9000/science/grrlscientist/2012/aug/07/3.json?dcr

And observing caption is being populated correctly in the relevant MediaAtomBlockElement element.

Before After
Screenshot 2026-05-20 at 10 05 05 Screenshot 2026-05-20 at 10 02 42

Deployment

Some PRs include model pre-releases. Before deploying to PROD, these pre-releases will need to become full releases, and code in affected PRs updated to reflect these changes.

TODO: come up with an appropriate sequencing for merging and closing PRs. The PRs do not need to all be deployed at the same time, but some - such as those requiring associated releases - need to be performed before others.


Checklist

@RikRootsGuardian
RikRootsGuardian requested a review from a team as a code owner April 14, 2026 13:06
@RikRootsGuardian RikRootsGuardian self-assigned this Apr 14, 2026
@RikRootsGuardian
RikRootsGuardian marked this pull request as draft April 14, 2026 13:06
@RikRootsGuardian RikRootsGuardian added the feature Departmental tracking: work on a new feature label Apr 14, 2026
@RikRootsGuardian

Copy link
Copy Markdown
Contributor Author

Concerning the build error:

Screenshot 2026-04-14 at 14 15 49

... I think I need to perform a pre-release of the content-api-scala-client library and update the capiVersion value in the project/Dependencies.scala file ...?

Screenshot 2026-04-14 at 14 18 36

@jonathonherbert jonathonherbert added this to the Requests milestone Apr 15, 2026
@github-actions

github-actions Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

@RikRootsGuardian

Copy link
Copy Markdown
Contributor Author

Current build failure is due to a Scala formatting issue:

Screenshot 2026-04-16 at 10 17 12

@RikRootsGuardian
RikRootsGuardian marked this pull request as ready for review May 18, 2026 15:53

@simonbyford simonbyford left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR just needs to transform a contentatom from CAPI into a MediaAtomBlockElement which DCR can render. Take a look at this PR which does something very similar:

#28616

In our case we'll need to pass in something like:

element.contentAtomTypeData.flatMap(_.caption)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We shouldn't need to touch this part of the system which deals with email templates

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed change

@simonbyford simonbyford left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've included some testing instructions in the PR description which should help check whether this change has worked correctly!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've been trying to understand the purpose of this file and I believe it is no longer used.

According to this comment, transformation logic used to belong in BlockElement.scala but now lives in PageElement.scala.

Therefore I suggest we omit this change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actioned

@RikRootsGuardian

Copy link
Copy Markdown
Contributor Author

I agree that this is ready to merge, following the successful testing

@simonbyford
simonbyford merged commit 71584ea into main May 20, 2026
11 checks passed
@simonbyford
simonbyford deleted the rjr-bump-capi-model-to-include-new-video-caption-field branch May 20, 2026 14:05
@gu-prout

gu-prout Bot commented May 20, 2026

Copy link
Copy Markdown

Seen on ADMIN-PROD (created by @RikRootsGuardian and merged by @simonbyford 21 minutes and 44 seconds ago)

@gu-prout

gu-prout Bot commented May 20, 2026

Copy link
Copy Markdown

Seen on FRONTS-PROD (created by @RikRootsGuardian and merged by @simonbyford 21 minutes and 59 seconds ago)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature Seen-on-ADMIN-PROD Seen-on-FRONTS-PROD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants