Skip to content

Update ContentAtomBlockElement to include caption field - #15717

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

Update ContentAtomBlockElement to include caption field#15717
simonbyford merged 11 commits into
mainfrom
rjr-bump-capi-model-to-include-new-video-caption-field

Conversation

@RikRootsGuardian

@RikRootsGuardian RikRootsGuardian commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

What does this change?

Does two things:

  • supports the new caption field which - if present - overrides the existing video caption. This is enabled by: Bump models to include new video captions field frontend#28728
  • adds some bottom margin to videos elements to allow for the case where caption is omitted. I chose 12px because this is what the YoutubeBlockElement uses.

Testing

This has been tested by running DCR locally and manually fixing the value of element.caption.

Empty caption

Before After
Screenshot 2026-05-20 at 10 57 05 Screenshot 2026-05-20 at 10 56 45

Non-empty caption

Before After
Screenshot 2026-05-20 at 10 58 34 Screenshot 2026-05-20 at 10 58 09

Broader context

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 plan document

@RikRootsGuardian RikRootsGuardian self-assigned this Apr 16, 2026
@RikRootsGuardian RikRootsGuardian added the feature Departmental tracking: work on a new feature label Apr 16, 2026
@RikRootsGuardian
RikRootsGuardian marked this pull request as draft April 16, 2026 09:07
@github-actions

Copy link
Copy Markdown

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@github-actions

github-actions Bot commented Apr 16, 2026

Copy link
Copy Markdown

@RikRootsGuardian

Copy link
Copy Markdown
Contributor Author

Current build failure is due to a model mismatch issue
Screenshot 2026-04-16 at 10 18 48

Comment thread dotcom-rendering/src/types/content.ts Outdated
Comment thread dotcom-rendering/src/types/content.ts
Comment thread dotcom-rendering/src/types/content.ts Outdated
Comment thread dotcom-rendering/src/types/content.ts Outdated
Comment thread dotcom-rendering/src/types/content.ts Outdated
Comment thread dotcom-rendering/src/types/content.ts Outdated
Comment thread dotcom-rendering/src/types/content.ts
@simonbyford

Copy link
Copy Markdown
Contributor

Current build failure is due to a model mismatch issue Screenshot 2026-04-16 at 10 18 48

Possibly this happens if you attempt to manually edit schemas instead of running make gen-schemas. Try that?

@simonbyford
simonbyford force-pushed the rjr-bump-capi-model-to-include-new-video-caption-field branch from 1109401 to 5837b46 Compare May 19, 2026 13:12
@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown

@simonbyford
simonbyford marked this pull request as ready for review May 19, 2026 13:30
@simonbyford
simonbyford force-pushed the rjr-bump-capi-model-to-include-new-video-caption-field branch from 5837b46 to a0bb3ac Compare May 20, 2026 10:33
@RikRootsGuardian RikRootsGuardian added the run_chromatic Runs chromatic when label is applied label May 20, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label May 20, 2026
@simonbyford
simonbyford force-pushed the rjr-bump-capi-model-to-include-new-video-caption-field branch from a0bb3ac to 436110f Compare May 20, 2026 13:38
@simonbyford
simonbyford force-pushed the rjr-bump-capi-model-to-include-new-video-caption-field branch from 436110f to fb9c872 Compare May 20, 2026 13:40
@simonbyford simonbyford added the run_chromatic Runs chromatic when label is applied label May 20, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label May 20, 2026
@RikRootsGuardian

Copy link
Copy Markdown
Contributor Author

Now that this PR is passing its Chromatic tests, I'm happy for the work to merge into PROD

@simonbyford
simonbyford merged commit 5c75bdc into main May 20, 2026
29 checks passed
@simonbyford
simonbyford deleted the rjr-bump-capi-model-to-include-new-video-caption-field branch May 20, 2026 14:31
@gu-prout

gu-prout Bot commented May 20, 2026

Copy link
Copy Markdown

Seen on PROD (created by @RikRootsGuardian and merged by @simonbyford 9 minutes and 38 seconds ago) Please check your changes!

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-PROD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants