Skip to content

Dynamic data attribute for self hosted video, remove wrapper#16322

Open
frederickobrien wants to merge 2 commits into
mainfrom
class-name-for-long-non-yt-vids
Open

Dynamic data attribute for self hosted video, remove wrapper#16322
frederickobrien wants to merge 2 commits into
mainfrom
class-name-for-long-non-yt-vids

Conversation

@frederickobrien

Copy link
Copy Markdown
Contributor

A bit of tidying around self hosted videos, this adjusts the figure's gu data element to be dynamic like the class name is and also removes an unnecessary wrapper <div> element by moving some bottom padding to the figure element inside the island, where it probably belongs anyway.

@frederickobrien frederickobrien self-assigned this Jul 3, 2026
@frederickobrien frederickobrien added the maintenance Departmental tracking: maintenance work, not a fix or a feature label Jul 3, 2026
@frederickobrien frederickobrien added this to the Interactives milestone Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

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.

@frederickobrien frederickobrien added the run_chromatic Runs chromatic when label is applied label Jul 3, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

return (
<figure
css={css`
margin-bottom: ${space[3]}px;

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.

Just a note that this will affect self hosted video rendered on fronts, as well as articles, which I don't think is intended.

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.

Ah good catch, sorry. Have made it apply only in articles in 15fb6de

@frederickobrien frederickobrien added the run_chromatic Runs chromatic when label is applied label Jul 3, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jul 3, 2026
@frederickobrien frederickobrien force-pushed the class-name-for-long-non-yt-vids branch from 15fb6de to a0bfbc1 Compare July 7, 2026 16:05
@frederickobrien frederickobrien requested a review from domlander July 7, 2026 16:05
css={
isInArticle
? css`
margin-bottom: ${space[3]}px;

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'm not a huge fan of adding margins to the child component, instead of the parent controlling the spacing. I think the code can end up a bit messy with this approach.

I see from following the code upwards that it is not easy to add this margin to a parent container and creating a new div seems quite unnecessary. I think my preference is for the latter (and current) of these three options but happy to be overruled.

role === 'immersive' ? 'element-video-immersive' : ''
}`}
data-component="gu-video-loop"
data-component={`gu-video-${videoStyleFormat}`}

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.

Nice spot. I would run this change by the Fronts & Curation team. I think their analytics might be relying on this name

isExternalLink: boolean;
};
isInLoopClickTestVariant?: boolean;
isInArticle?: boolean;

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.

Could this be renamed to something that describes the behaviour of this component instead of the features of the parent? It can be easier to understand how to use props and predict what they do that follow this pattern

frederickobrien and others added 2 commits July 9, 2026 14:25
Co-Authored-By: Pip <47357469+pippinpen@users.noreply.github.com>
Co-Authored-By: Alessia Amitrano <alessia.amitranobo@gmail.com>
@frederickobrien frederickobrien force-pushed the class-name-for-long-non-yt-vids branch from a0bfbc1 to e6e6ed8 Compare July 9, 2026 13:25
@akash1810

akash1810 commented Jul 9, 2026

Copy link
Copy Markdown
Member

Please rebase this branch against main before deploying to CODE. #16321 made some changes to CI and infrastructure. Deploying this branch without these changes present will either:

  • Fail when using Riff-Raff's default update strategy
  • OR delete the new infrastructure if using Riff-Raff's "dangerous" mode

Please rebase this branch against main before deploying to CODE.

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

Labels

maintenance Departmental tracking: maintenance work, not a fix or a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants