Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
631997b
Merge branch 'latest' of ssh://github.com/bbc/simorgh into latest
louisearchibald Dec 4, 2025
e62bcb8
Merge branch 'latest' of ssh://github.com/bbc/simorgh into latest
louisearchibald Dec 9, 2025
b05d784
Merge branch 'latest' of ssh://github.com/bbc/simorgh into latest
louisearchibald Dec 16, 2025
971b5dc
Merge branch 'latest' of ssh://github.com/bbc/simorgh into latest
louisearchibald Dec 16, 2025
a710ee8
move scrollable promo to components location and update imports
louisearchibald Dec 17, 2025
4ad283d
more import and reference updates
louisearchibald Dec 17, 2025
84c2311
update component name
louisearchibald Dec 17, 2025
0d41fd2
remove some experiment tests and code
louisearchibald Dec 17, 2025
b2d561c
Merge branch 'latest' into WS-1883-bring-article-link-block-up-to-com…
louisearchibald Dec 17, 2025
7332cd2
Merge branch 'WS-1883-bring-article-link-block-up-to-component-standa…
louisearchibald Dec 17, 2025
73238dc
Merge branch 'latest' into WS-1883-bring-article-link-block-up-to-com…
louisearchibald Dec 17, 2025
50486b6
Merge branch 'WS-1883-bring-article-link-block-up-to-component-standa…
louisearchibald Dec 17, 2025
88b476d
update name references
louisearchibald Dec 17, 2025
3b813c8
update name references
louisearchibald Dec 17, 2025
1935590
update name references
louisearchibald Dec 17, 2025
e845b86
removal of experiment code from Promo
louisearchibald Dec 17, 2025
a7d1eff
remove experiment code from promo list
louisearchibald Dec 17, 2025
d760e56
remove unused code
louisearchibald Dec 17, 2025
501e3f4
remove experiment storybook examples
louisearchibald Dec 17, 2025
7b17470
Merge branch 'latest' into WS-1883-bring-article-link-block-up-to-com…
louisearchibald Dec 17, 2025
0e0f40f
Merge branch 'WS-1883-bring-article-link-block-up-to-component-standa…
louisearchibald Dec 17, 2025
de75dff
updated snapshots
Nabeel1276 Dec 18, 2025
d10b529
updated a.jsx to typescript
Nabeel1276 Dec 18, 2025
2c00a90
updated heading.jsx to typescript
Nabeel1276 Dec 18, 2025
edcd91c
updated body.jsx to typescript
Nabeel1276 Dec 18, 2025
93c14d5
updated footer.jsx to typescript
Nabeel1276 Dec 18, 2025
11e6062
undid recent typescript conversion changes due to incorrect file loca…
Nabeel1276 Dec 18, 2025
3b50ac8
updated index file from jsx to tsx
Nabeel1276 Dec 18, 2025
9f2335e
added a11yAttributes prop and fixed reactNode issue
Nabeel1276 Dec 18, 2025
9995ed1
removed script and service
Nabeel1276 Dec 18, 2025
67dd345
Merge branch 'WS-1883-bring-article-link-block-up-to-component-standa…
louisearchibald Dec 18, 2025
a4fbb02
remove unused fixture imports
louisearchibald Dec 18, 2025
0eab522
removed jsx file tsc supersedes
Nabeel1276 Dec 18, 2025
f0a7e2d
add metadata file
louisearchibald Dec 18, 2025
f37e460
add readme file
louisearchibald Dec 19, 2025
c2552f8
WIP change stories file to tsx
louisearchibald Dec 19, 2025
47e9e13
Merge branch 'WS-1883-bring-article-link-block-up-to-component-standa…
louisearchibald Dec 19, 2025
dc22ca7
updated snapshots
Nabeel1276 Dec 19, 2025
176d95f
updaated promo index.jsx to tsx [copilot]
Nabeel1276 Dec 19, 2025
5ef8383
Merge branch 'WS-1883-bring-article-link-block-up-to-component-standa…
louisearchibald Dec 23, 2025
612845d
replace path and pathOr with optional chaining
louisearchibald Dec 23, 2025
342ff40
update PromoProps and remove service and script
louisearchibald Dec 23, 2025
46ac923
replace path with optional chaining
louisearchibald Dec 23, 2025
0d25fdd
fix type errors
louisearchibald Dec 23, 2025
b0c950e
remove ramda imports
louisearchibald Dec 23, 2025
cb15ae0
change promoList to tsx and update types
louisearchibald Dec 23, 2025
9e7d656
Revert "change promoList to tsx and update types"
louisearchibald Dec 23, 2025
b0478fb
update PromoList
louisearchibald Dec 23, 2025
a551af9
update Promo test file
louisearchibald Dec 23, 2025
1b55e53
test file update
louisearchibald Dec 23, 2025
4059a6d
convert styles to emotion and delete styled components
louisearchibald Dec 23, 2025
c9cc80c
update styles for Promo
louisearchibald Dec 24, 2025
37016de
update references in e2e tests
louisearchibald Dec 24, 2025
3c66a10
update references in e2e tests
louisearchibald Dec 24, 2025
77bcd2e
convert styles and fix margin issue on promoList
louisearchibald Dec 30, 2025
c623945
stack items
louisearchibald Dec 30, 2025
db91375
remove first list item margins as no longer required
louisearchibald Dec 30, 2025
8b7a53d
change width and adjust margins between items
louisearchibald Dec 30, 2025
1cc5d47
implement chevron
louisearchibald Dec 30, 2025
b706f87
update margin properties at all breakpoints
louisearchibald Dec 30, 2025
88254a5
remove scrollable css and update variable names
louisearchibald Dec 30, 2025
58fc832
remove ScrollPromo and replace with div
louisearchibald Dec 30, 2025
d10cd15
fix stories file
louisearchibald Dec 31, 2025
74e44ee
remove import
louisearchibald Dec 31, 2025
69886da
Merge branch 'WS-1883-bring-article-link-block-up-to-component-standa…
louisearchibald Dec 31, 2025
7ceb81a
Merge branch 'WS-1884-update-article-links-block-to-reflect-new-desig…
louisearchibald Dec 31, 2025
b9d29c2
name change
louisearchibald Dec 31, 2025
eab1066
remove role=list
louisearchibald Dec 31, 2025
d03abca
Merge branch 'WS-1883-bring-article-link-block-up-to-component-standa…
louisearchibald Dec 31, 2025
79502b4
Merge branch 'WS-1884-update-article-links-block-to-reflect-new-desig…
louisearchibald Dec 31, 2025
b2e085a
resolving conflict
louisearchibald Dec 31, 2025
4fbf401
fix styling error after merge
louisearchibald Dec 31, 2025
7947fa9
fix margin issue and delete leftover scroll css
louisearchibald Dec 31, 2025
116a868
Merge branch 'latest' into WS-1883-bring-article-link-block-up-to-com…
Nabeel1276 Jan 5, 2026
d9b0de1
Merge branch 'WS-1883-bring-article-link-block-up-to-component-standa…
louisearchibald Jan 6, 2026
b394417
change to arrow function
louisearchibald Jan 6, 2026
e9ce557
removed clickTracker
Nabeel1276 Jan 6, 2026
f66612a
removed import
Nabeel1276 Jan 6, 2026
62cda30
Merge branch 'WS-1883-bring-article-link-block-up-to-component-standa…
louisearchibald Jan 6, 2026
aca55a2
pass clickTracker prop
louisearchibald Jan 6, 2026
89a9a07
remove operaMini detection hook
louisearchibald Jan 7, 2026
f38dc3d
remove unused import
louisearchibald Jan 7, 2026
60e0eae
remove unused import
louisearchibald Jan 7, 2026
9458196
add viewTracker as a prop and pass at top level
louisearchibald Jan 7, 2026
ab8c87d
resolve merge conflict
louisearchibald Jan 7, 2026
53969f0
update bundle size
louisearchibald Jan 7, 2026
121aa22
update snapshot
louisearchibald Jan 7, 2026
2aa6e15
addressing comments
louisearchibald Jan 7, 2026
9cb1396
Merge branch 'latest' into WS-1883-bring-article-link-block-up-to-com…
louisearchibald Jan 7, 2026
b965aa9
Merge branch 'WS-1883-bring-article-link-block-up-to-component-standa…
louisearchibald Jan 7, 2026
8483feb
resolving conflicts after merging in styling pr
louisearchibald Jan 7, 2026
b6107dc
change name of css class
louisearchibald Jan 7, 2026
95ff152
reinstate dir for chevron
louisearchibald Jan 7, 2026
b317421
update snapshots
louisearchibald Jan 7, 2026
9e628bf
remove grid component
louisearchibald Jan 7, 2026
1d5139a
remove grid import
louisearchibald Jan 7, 2026
2a82ba4
snapshot updates
louisearchibald Jan 8, 2026
989cab4
Merge branch 'latest' into WS-1883-bring-article-link-block-up-to-com…
louisearchibald Jan 8, 2026
318d854
fix width issue with label and container
louisearchibald Jan 8, 2026
bd279f7
Merge branch 'WS-1883-bring-article-link-block-up-to-component-standa…
louisearchibald Jan 8, 2026
08a1ea5
snapshots
louisearchibald Jan 8, 2026
b85c383
fix forced colours issue and adjust margin sizes
louisearchibald Jan 8, 2026
eb3373d
Merge branch 'latest' into WS-1883-bring-article-link-block-up-to-com…
louisearchibald Jan 8, 2026
ae637b0
Merge branch 'latest' into WS-1883-bring-article-link-block-up-to-com…
louisearchibald Jan 8, 2026
f0faa17
remove a11yattributes from Promolist
louisearchibald Jan 8, 2026
8b45d17
change div to section and remove as prop
louisearchibald Jan 8, 2026
a1432f1
Merge branch 'WS-1883-bring-article-link-block-up-to-component-standa…
louisearchibald Jan 8, 2026
87d55d4
snapshots
louisearchibald Jan 8, 2026
9ec7428
Merge branch 'latest' into WS-1883-bring-article-link-block-up-to-com…
louisearchibald Jan 8, 2026
9a8c36d
Merge branch 'WS-1883-bring-article-link-block-up-to-component-standa…
louisearchibald Jan 8, 2026
188bc93
update file name
louisearchibald Jan 8, 2026
2c95208
update import path and component test names
louisearchibald Jan 8, 2026
291d44b
remove dir
louisearchibald Jan 8, 2026
8f09149
remove operamini detection hook and update styles to use opera mini c…
louisearchibald Jan 8, 2026
fe2a860
snapshots
louisearchibald Jan 8, 2026
43542d1
rogue import
louisearchibald Jan 8, 2026
95d3d0f
reinstate dir and delete missed code from stories file
louisearchibald Jan 8, 2026
e86e0c0
Merge branch 'latest' into WS-1883-bring-article-link-block-up-to-com…
louisearchibald Jan 8, 2026
e47e315
snapshots again
louisearchibald Jan 8, 2026
6b4c44d
Merge branch 'WS-1883-bring-article-link-block-up-to-component-standa…
louisearchibald Jan 8, 2026
a6c3b90
Merge branch 'latest' into WS-1883-bring-article-link-block-up-to-com…
louisearchibald Jan 8, 2026
39f5c89
add skip link button
louisearchibald Jan 9, 2026
5798495
Merge branch 'WS-1883-bring-article-link-block-up-to-component-standa…
louisearchibald Jan 9, 2026
bbd582b
small tweak to fix focus box
louisearchibald Jan 9, 2026
eb6b223
Merge remote-tracking branch 'origin/latest' into WS-1883-bring-artic…
louisearchibald Jan 9, 2026
e3d2ba6
update bundle threshhold
louisearchibald Jan 9, 2026
5ac4059
snapshots again
louisearchibald Jan 9, 2026
516c23b
fix slight regression
louisearchibald Jan 9, 2026
ce3ca89
remove dir
louisearchibald Jan 9, 2026
427f646
Storybook `dir` fix
amoore108 Jan 9, 2026
19b0397
Remove `dir` from Promo components and wrappers
amoore108 Jan 9, 2026
5560cc2
Merge branch 'WS-1883-bring-article-link-block-up-to-component-standa…
louisearchibald Jan 9, 2026
a747926
rename files from js to ts
louisearchibald Jan 9, 2026
c12ccc7
tweak to skip link
louisearchibald Jan 9, 2026
a3bc6b7
Merge branch 'latest' into WS-1883-bring-article-link-block-up-to-com…
amoore108 Jan 12, 2026
9fab773
Update index.test.tsx.snap
amoore108 Jan 12, 2026
4b00570
Remove `ramda` uses
amoore108 Jan 12, 2026
90c6805
Merge branch 'latest' into WS-1883-bring-article-link-block-up-to-com…
amoore108 Jan 12, 2026
f401b2b
Add `::before` pseudo class to link to allow hovering/focusing on ent…
amoore108 Jan 12, 2026
99b30ec
Merge branch 'latest' into WS-1883-bring-article-link-block-up-to-com…
louisearchibald Jan 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cypress/e2e/specialFeatures/atiAnalytics/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const RECENT_AUDIO_EPISODES = 'episodes-audio';
const PODCAST_LINKS = 'third-party';
const LATEST_MEDIA = 'latest';
const RECOMMENDATIONS = 'midarticle-mostread';
const SCROLLABLE_PROMO = 'edoj';
const ARTICLE_LINKS_BLOCK = 'edoj';
const BILLBOARD = 'billboard';
const SOCIAL_EMBED = 'social-consent-banner';
const LIVE_MEDIA = 'live-header-media';
Expand All @@ -52,7 +52,7 @@ export const COMPONENTS = {
RELATED_CONTENT,
RELATED_TOPICS,
SCROLLABLE_NAVIGATION,
SCROLLABLE_PROMO,
ARTICLE_LINKS_BLOCK,
SHARE,
SOCIAL_EMBED,
TOP_STORIES,
Expand Down
2 changes: 1 addition & 1 deletion scripts/bundleSize/bundleSizeConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@

export const VARIANCE = 5;

export const MIN_SIZE = 922;
export const MIN_SIZE = 921;
export const MAX_SIZE = 1292;
70 changes: 70 additions & 0 deletions src/app/components/ArticleLinksBlock/Promo/index.styles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import { OPERA_MINI_CLASSNAME } from '#app/lib/utilities/addOperaMiniClassScript';
import pixelsToRem from '#app/utilities/pixelsToRem';
import { css, Theme } from '@emotion/react';

export default {
link: ({ fontSizes, fontVariants, isDarkUi, palette }: Theme) =>
css({
...fontSizes.pica,
...fontVariants.serifBold,
display: 'inline-block',
verticalAlign: 'middle',
textDecoration: 'none',
overflowX: 'hidden',
overflowY: 'hidden',
WebkitLineClamp: 4,
WebkitBoxOrient: 'vertical',
color: isDarkUi ? palette.GREY_10 : palette.GREY_8,

'&:hover, &:focus': {
textDecoration: 'underline',
},

'&:visited': {
color: palette.GREY_6,
},

'&::before': {
bottom: 0,
content: '""',
left: 0,
overflow: 'hidden',
position: 'absolute',
right: 0,
top: 0,
zIndex: 1,
},
}),
promoBox: ({ isDarkUi, mq, palette, spacings }: Theme) =>
css({
position: 'relative',
backgroundColor: isDarkUi ? palette.GREY_3 : palette.WHITE,
padding: `${spacings.DOUBLE}rem`,
paddingInlineEnd: `${pixelsToRem(38)}rem`,
height: 'auto',
display: 'block',
width: '100%',
[`.${OPERA_MINI_CLASSNAME} &`]: {
position: 'relative',
backgroundColor: isDarkUi ? palette.GREY_3 : palette.WHITE,
padding: `${spacings.DOUBLE}rem`,
marginBottom: `${spacings.DOUBLE}rem`,
width: `calc(100% - ${spacings.FULL}rem)`,
[mq.GROUP_2_MIN_WIDTH]: {
width: `calc(50% - ${spacings.DOUBLE}rem)`,
},
},
}),
timestamp: ({ isDarkUi, palette, spacings }: Theme) =>
css({
marginTop: `${spacings.FULL}rem`,
color: isDarkUi ? palette.GREY_6 : undefined,
}),
chevron: () =>
css({
position: 'absolute',
top: '50%',
transform: 'translateY(-50%)',
insetInlineEnd: `${pixelsToRem(12)}rem`,
}),
};
45 changes: 45 additions & 0 deletions src/app/components/ArticleLinksBlock/Promo/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { render } from '../../react-testing-library-with-providers';
import { PromoSingleBlock, oneLinkWithTimestamp } from '../helpers/fixtureData';
import Promo from '.';
import { ServiceContextProvider } from '../../../contexts/ServiceContext';

const ArticleLinksBlock = ({ block }) => (
<ServiceContextProvider service="pidgin">
<Promo block={block} />
</ServiceContextProvider>
);

describe('Article Links Block', () => {
it('should render a link', () => {
const { queryByRole } = render(
<ArticleLinksBlock block={PromoSingleBlock} />,
);
expect(queryByRole('link')).toBeInTheDocument();
});

it('should extract and render the correct title', () => {
const { getByText } = render(
<ArticleLinksBlock block={PromoSingleBlock} />,
);
expect(
getByText(
'This is a very long headline. I am creating this for a test purpose. I love creating these type of tests. I really do not know what to write.',
),
).toBeTruthy();
});

it('should extract and render the correct href', () => {
const { queryByRole } = render(
<ArticleLinksBlock block={PromoSingleBlock} />,
);
const link = queryByRole('link') as HTMLAnchorElement;
expect(link?.href).toEqual('https://www.bbc.com/mundo');
});

it('should render timestamp if timestamp is available', () => {
const { container } = render(
<ArticleLinksBlock block={oneLinkWithTimestamp[0]} />,
);
expect(container.getElementsByTagName('time')[0]).toBeInTheDocument();
});
});
56 changes: 56 additions & 0 deletions src/app/components/ArticleLinksBlock/Promo/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { use } from 'react';
import filterForBlockType from '#lib/utilities/blockHandlers';
import PromoTimestamp from '#components/Promo/timestamp';
import { OptimoBlock } from '#app/models/types/optimo';
import useClickTrackerHandler from '#app/hooks/useClickTrackerHandler';
import { Chevron, ChevronOrientation } from '#app/components/icons';
import { ServiceContext } from '../../../contexts/ServiceContext';
import styles from './index.styles';

interface PromoProps {
block: OptimoBlock;
clickTracker?: ReturnType<typeof useClickTrackerHandler>;
}

const Promo = ({ block, clickTracker }: PromoProps) => {
const { serviceDatetimeLocale, dir } = use(ServiceContext);

const textBlock = filterForBlockType(
(block?.model as { blocks?: Record<string, unknown> })?.blocks || {},
'text',
);
const aresLinkBlock = filterForBlockType(
(block?.model as { blocks?: Record<string, unknown> })?.blocks || {},
'aresLink',
);
const timestamp =
aresLinkBlock?.model?.blocks?.[0]?.model?.timestamp ?? undefined;

const href =
textBlock?.model?.blocks?.[0]?.model?.blocks?.[0]?.model?.locator ?? '';
const title =
textBlock?.model?.blocks?.[0]?.model?.blocks?.[0]?.model?.text ?? '';

return (
<div css={styles.promoBox}>
<a css={styles.link} href={href} {...clickTracker}>
{title}
<Chevron
dir={dir}
css={styles.chevron}
orientation={ChevronOrientation.FORWARD}
/>
</a>
{timestamp && (
<PromoTimestamp
css={styles.timestamp}
serviceDatetimeLocale={serviceDatetimeLocale}
>
{timestamp}
</PromoTimestamp>
)}
</div>
);
};

export default Promo;
60 changes: 60 additions & 0 deletions src/app/components/ArticleLinksBlock/PromoList/index.styles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { OPERA_MINI_CLASSNAME } from '#app/lib/utilities/addOperaMiniClassScript';
import pixelsToRem from '#app/utilities/pixelsToRem';
import { css, Theme } from '@emotion/react';

export default {
promo: ({ spacings }: Theme) =>
css({
'& ul': {
listStyle: 'none',
paddingInlineStart: '0',
margin: '0',
display: 'flex',
flexDirection: 'column',
gap: `${spacings.FULL}rem`,
width: '100%',
},
[`.${OPERA_MINI_CLASSNAME} &`]: {
listStyle: 'none',
paddingInlineStart: '0',
margin: '0',
},
}),
list: ({ mq, spacings }: Theme) =>
css({
display: 'flex',
flexShrink: 0,
marginInline: `${spacings.FULL}rem`,
':last-of-type': {
marginBottom: `${spacings.TRIPLE}rem`,
},
[mq.FORCED_COLOURS]: {
border: `solid ${pixelsToRem(3)}rem transparent`,
},

[mq.GROUP_2_MIN_WIDTH]: {
marginInline: `${spacings.DOUBLE}rem`,
},

[mq.GROUP_3_MIN_WIDTH]: {
marginInline: `${spacings.DOUBLE}rem`,
},

[mq.GROUP_4_MIN_WIDTH]: {
marginInline: 0,
},
[`.${OPERA_MINI_CLASSNAME} &`]: {
[mq.GROUP_0_MAX_WIDTH]: {
marginInline: `${spacings.FULL}rem`,
},

[mq.GROUP_2_MIN_WIDTH]: {
marginInline: `${spacings.DOUBLE}rem`,
},

[mq.GROUP_4_MIN_WIDTH]: {
marginInline: 0,
},
},
}),
};
35 changes: 35 additions & 0 deletions src/app/components/ArticleLinksBlock/PromoList/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { OptimoBlock } from '#app/models/types/optimo';
import { ViewTracker } from '#app/lib/analyticsUtils/types';
import useClickTrackerHandler from '#app/hooks/useClickTrackerHandler';
import Promo from '../Promo';
import styles from './index.styles';

interface PromoListProps {
blocks: OptimoBlock[];
viewTracker?: ViewTracker;
clickTracker?: ReturnType<typeof useClickTrackerHandler>;
}

const PromoList = ({ blocks, viewTracker, clickTracker }: PromoListProps) => {
const listBlocks = blocks.slice(0, 3);

return (
<div css={[styles.promo]} {...viewTracker}>
<ul>
{listBlocks.map((block, index) => {
return (
<li
css={styles.list}
// eslint-disable-next-line react/no-array-index-key
key={index}
>
<Promo block={block} clickTracker={clickTracker} />
</li>
);
})}
</ul>
</div>
);
};

export default PromoList;
Empty file.
Loading
Loading