Skip to content

Track card media in data-link-name #14400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 14, 2025
Merged

Track card media in data-link-name #14400

merged 5 commits into from
Aug 14, 2025

Conversation

abeddow91
Copy link
Contributor

@abeddow91 abeddow91 commented Aug 13, 2025

What does this change?

CardImageType has been renamed to CardMediaType in this PR for clarity.

Adds the card media type to the link name tracking. This field indicates what media type the card contains. It can be one of the following, which is extended from the CardMediaType.

	|'podcast'
	| 'loop-video'
	| 'youtube-video'
	| 'slideshow'
	| 'avatar'
	| 'crossword'
	| 'picture'
	| 'none';

If there is no media, this is resolved to none.

The link name is set during card enhancement but we do not know at this stage what the card's media is. This is because we do not know details such as card size, which can impact rendered media.

As a result of this, we append the media type to the data link name during rendering.
this results in
dataLinkName: 'news | group-0 | card-@3',
turning into
resolvedDataLinkName: 'news | group-0 | card-@3 | media-picture'

Why?

Screenshots

Before After
before after

This makes tracking the video context somewhat easier
This field indicates what media type the card contains. If there is no media, this is resolved to `none`.

We set the link name during card enhancement but we do not know at this stage what the card's media is. This is because we do not know details such as card size, which can impact rendered media.

As a result of this, we potentially override the media section of the link name at the card level IF media is displayed on the card.
@abeddow91 abeddow91 changed the title Ab/data link name media Track card media in data-link-name Aug 13, 2025
Copy link

github-actions bot commented Aug 13, 2025

Copy link

github-actions bot commented Aug 14, 2025

@abeddow91 abeddow91 requested a review from domlander August 14, 2025 10:48
@abeddow91 abeddow91 marked this pull request as ready for review August 14, 2025 10:50
Copy link

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.

@domlander domlander added the run_chromatic Runs chromatic when label is applied label Aug 14, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Aug 14, 2025
@abeddow91 abeddow91 merged commit 8177a27 into main Aug 14, 2025
32 checks passed
@abeddow91 abeddow91 deleted the ab/data-link-name-media branch August 14, 2025 14:14
@gu-prout
Copy link

gu-prout bot commented Aug 14, 2025

Seen on PROD (merged by @abeddow91 7 minutes and 36 seconds ago) Please check your changes!

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

Successfully merging this pull request may close these issues.

2 participants