Skip to content

WS-2690 - Article OJ Padding [BUG FIX]#14159

Open
pvaliani wants to merge 3 commits into
latestfrom
WS-2690-oj-article-padding-fix
Open

WS-2690 - Article OJ Padding [BUG FIX]#14159
pvaliani wants to merge 3 commits into
latestfrom
WS-2690-oj-article-padding-fix

Conversation

@pvaliani

@pvaliani pvaliani commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Resolves JIRA:
https://bbc.atlassian.net/browse/WS-2690

Summary

  • Fixes inconsistent spacing after the Continue Reading button on article pages when onward journey components render below the collapsed article

Code changes

  • See files changed

Problem

On mobile, the Continue Reading button hides the remaining article content inside <main>, but the article layout still kept its normal bottom padding. The primary article column also kept its own bottom padding. When an OJ such as Top Stories, Portrait Video Carousel, or Related Content rendered after the collapsed article area, its own spacing stacked with the hidden article/layout padding, causing large inconsistent gaps.

Fix

Added collapsed-article spacing styles to ArticlePage:

  • removes <main> bottom padding while the article is collapsed
  • removes primary column bottom padding while the article is collapsed
  • restores the normal spacing once Continue Reading is clicked
  • preserves existing behaviour for desktop, no-JS, and Opera Mini

This is handled at the article layout level rather than patching individual OJs, because the extra gap seems to have come from from the shared article

Testing

  1. Navigate to an article containing the continue reading button and notice the padding between the button and the subsequent OJ is consistent
    http://localhost.com:7081/mundo/articles/cly7qe4542xo?renderer_env=live
    http://localhost.bbc.com:7081/hausa/articles/cgepxyl21g3o?renderer_env=live

It was difficult to find a Hausa article that had the same OJ as the Mundo one for like-for-like comparison.

The current fix removes the unintended stacked layout padding from the collapsed article area. The remaining difference between Mundo and Hausa appears to come from the OJs’ own section-label spacing: Related Content has default top margin, while Top Stories overrides it to zero. If going forward the requirement is that every first OJ after Continue Reading should align identically, we need a follow-up decision/change to standardise the 1st OJ spacing. The current fix just removes extra hidden article padding

Screen.Recording.2026-06-26.at.09.40.21.mov
image

Useful Links

@pvaliani pvaliani self-assigned this Jun 26, 2026
@pvaliani pvaliani marked this pull request as ready for review June 26, 2026 13:18

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

Fixes WS-2690 by preventing “stacked” bottom padding when an article is collapsed behind the Continue Reading button and an onward-journey component renders immediately after the collapsed area, while preserving existing behaviour for desktop, no-JS, and Opera Mini.

Changes:

  • Adds a derived flag to detect the “collapsed article” state (Continue Reading enabled + content still hidden).
  • Applies additional Emotion styles to remove <main> and primary column bottom padding while collapsed.
  • Restores the original padding rules for desktop breakpoints and no-JS/Opera Mini fallbacks.

Reviewed changes

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

File Description
src/app/pages/ArticlePage/ArticlePage.tsx Adds conditional styling hooks on the primary column and <main> when the article is collapsed.
src/app/pages/ArticlePage/ArticlePage.styles.ts Introduces collapsedArticleColumn and collapsedMainContent styles to remove/restore padding based on collapse state and platform fallbacks.

Comment on lines +447 to +448
const useCollapsedArticleSpacing =
showContinueReadingButton && !showAllContent;
Comment on lines +504 to +514
<div
css={[
!isPGL ? styles.primaryColumn : styles.pglColumn,
useCollapsedArticleSpacing && styles.collapsedArticleColumn,
]}
>
<main
css={[
styles.mainContent,
useCollapsedArticleSpacing && styles.collapsedMainContent,
]}

@HarveyPeachey HarveyPeachey 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.

Is continue reading rendered within the <main> element? If so why does the continue reading component have any bottom padding at all? Can't you just have no bottom padding on it and keep the <main> padding of the article? Instead of having this collapsed article logic?

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.

3 participants