Skip to content

Card Pill#15285

Open
abeddow91 wants to merge 11 commits intomainfrom
ab/card-pill-refactor
Open

Card Pill#15285
abeddow91 wants to merge 11 commits intomainfrom
ab/card-pill-refactor

Conversation

@abeddow91
Copy link
Contributor

@abeddow91 abeddow91 commented Feb 3, 2026

What does this change?

This refactor centralises all pill decision logic into a single CardPill component, which is now reused across card types.

The card footer has been reworked so that almost all pill-related logic lives inside the footer, co-locating the pill with other metadata such as age and comment count. This reduces duplication and makes the pill behaviour consistent across cards.

Why?

Pill logic was previously scattered across multiple card implementations, making it hard to reason about, update, or extend safely.

By introducing a shared CardPill component and moving responsibility into the card footer it ensures pill behaviour is consistent across card types and the decision logic is easier to maintain and test.

Screenshots

There are no visual changes as a consequence of this refactor.

@abeddow91 abeddow91 added the run_chromatic Runs chromatic when label is applied label Feb 3, 2026
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Feb 3, 2026
@abeddow91 abeddow91 force-pushed the ab/card-pill-refactor branch from e68e927 to 1049011 Compare February 3, 2026 14:28
Comment on lines +260 to +268
{isVideoArticle ? (
<Pill
content={
<time>{secondsToDuration(duration ?? 0)}</time>
}
prefix="Video"
icon={<SvgMediaControlsPlay width={18} />}
/>
) : (
Copy link
Contributor Author

@abeddow91 abeddow91 Feb 3, 2026

Choose a reason for hiding this comment

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

We have to use Pill directly here, rather than letting CardFooter decide, as we do not have access main media.

@abeddow91 abeddow91 self-assigned this Feb 3, 2026
@abeddow91 abeddow91 requested a review from domlander February 3, 2026 14:30
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

@abeddow91 abeddow91 added fronts + curation run_chromatic Runs chromatic when label is applied maintenance Departmental tracking: maintenance work, not a fix or a feature labels Feb 3, 2026
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Feb 3, 2026
@abeddow91 abeddow91 marked this pull request as ready for review February 3, 2026 14:43
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

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.

@abeddow91 abeddow91 force-pushed the ab/card-pill-refactor branch from 4b18e81 to 786c993 Compare February 5, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fronts + curation maintenance Departmental tracking: maintenance work, not a fix or a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant