Skip to content

WS-2615-extra: Better handles billboard image on high retina displays… - #14255

Draft
Isabella-Mitchell wants to merge 2 commits into
latestfrom
WS-2615-extra-improve-image-res
Draft

WS-2615-extra: Better handles billboard image on high retina displays…#14255
Isabella-Mitchell wants to merge 2 commits into
latestfrom
WS-2615-extra-improve-image-res

Conversation

@Isabella-Mitchell

@Isabella-Mitchell Isabella-Mitchell commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Resolves JIRA: WS-NA (Stretch task of https://bbc.atlassian.net/browse/WS-2615 - will make a separate ticket if it needs one)

Alternative (more complex yet more effective approach) to #14259

Summary

Updates the Billboard component’s responsive image srcset generation to better support high-DPI/retina displays by allowing a 2x (1320w) image candidate, and adds a regression test for the new behavior.

Code changes

  • Add a retina target width (1320) and pass custom imageResolutions into createSrcsets for high-prominence billboards.
  • Update originalImageWidth used for createSrcsets to allow generating a 1320w srcset candidate.
  • Add a test asserting that the retina width is present in the generated srcset.

Considerations

  • Ascertain that browsers are smart enough to load lower res images on devices with reduced display quality/ low bandwidth. (copilot suggests yes - but more research needed)
  • Ascertain that editorial will use high res images (since originalImageWidth is high, will this cause issues with poorer quality images)

Testing

Use storybook or compare test asset, e.g. http://localhost:7081/kyrgyz?renderer_env=test and https://www.test.bbc.com/kyrgyz
See image is a considerably less blurry

Useful Links

Copilot AI 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.

Pull request overview

Updates the Billboard component’s responsive image srcset generation to better support high-DPI/retina displays by allowing a 2x (1320w) image candidate, and adds a regression test for the new behavior.

Changes:

  • Add a retina target width (1320) and pass custom imageResolutions into createSrcsets for high-prominence billboards.
  • Update originalImageWidth used for createSrcsets to allow generating a 1320w srcset candidate.
  • Add a test asserting that the retina width is present in the generated srcset.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/app/components/Billboard/index.tsx Adds retina-aware image resolution handling for high prominence billboard images.
src/app/components/Billboard/index.test.tsx Adds coverage for the new 2x srcset behavior.

// 2x the fixed 660px display width (desktop ≥1280px), so high-DPI/retina
// screens get a sharp source instead of upscaling the 660w image.
const IMAGE_WIDTH_RETINA = IMAGE_WIDTH * 2;
const IMAGE_RESOLUTIONS = [240, 320, 480, 624, 800, IMAGE_WIDTH_RETINA];
Comment on lines +296 to +310
it('includes a retina (2x) resolution in the srcset so high-DPI screens are not upscaled', () => {
render(
<Billboard
heading={title}
description={description}
link={link}
image={imageUrl}
altText={imageAlt}
prominence={VISUAL_PROMINENCE.HIGH}
/>,
);

const image = screen.getByAltText(imageAlt);
expect(image.getAttribute('srcset')).toContain('1320w');
});
Comment on lines +39 to +41
// 2x the fixed 660px display width (desktop ≥1280px), so high-DPI/retina
// screens get a sharp source instead of upscaling the 660w image.
const IMAGE_WIDTH_RETINA = IMAGE_WIDTH * 2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants