Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSTEAM1-TRANSCRIPT-MASTER-BRANCH: Add signpost and transcript components. #12201

Draft
wants to merge 88 commits into
base: latest
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
f187449
Transcript Front End: Initial commit
Isabella-Mitchell Jun 7, 2024
2255797
Transcript - render on local article
Isabella-Mitchell Jun 21, 2024
3929222
Fix errors
Isabella-Mitchell Jul 3, 2024
acdcbe6
Use display: block
Isabella-Mitchell Jul 3, 2024
df49ad1
Transcript-front-end: A11y updates
Isabella-Mitchell Jul 19, 2024
9a11125
Merge branch 'latest' into Transcript-front-end
Isabella-Mitchell Jul 19, 2024
b4c3709
Merge branch 'latest' into Transcript-front-end
Isabella-Mitchell Aug 30, 2024
d68de51
Transcript front end: Adds SVG and makes disclaimer optional
Isabella-Mitchell Aug 30, 2024
af89963
Transcript front end: Updates stories
Isabella-Mitchell Aug 30, 2024
a1a75e1
Transcript front end: Fix unit tests
Isabella-Mitchell Aug 30, 2024
328a686
Transcript-front-end: Replaces svg with css triangle
Isabella-Mitchell Aug 30, 2024
0a7e90a
Transcript front end: tidy
Isabella-Mitchell Aug 30, 2024
0244a53
Transcript front end: Adds initial readme
Isabella-Mitchell Aug 30, 2024
5f0432a
Trancript-front-end: apply darkUi styles
Isabella-Mitchell Aug 30, 2024
4d13863
Replace custom css arrow with SVG
Isabella-Mitchell Sep 13, 2024
10d67a4
Merge branch 'latest' into Transcript-front-end
Isabella-Mitchell Sep 13, 2024
96bf199
Typeify
Isabella-Mitchell Sep 13, 2024
f1c2a21
WSTEAM1-POC: Add button and signpost
shayneahchoon Sep 13, 2024
5a87973
WSTEAM1-POC: Add button and signpost
shayneahchoon Sep 13, 2024
14f2bbb
WSTEAM1-POC: Add button and signpost
shayneahchoon Sep 13, 2024
0cdcf3d
WSTEAM1-POC: Add button and signpost
shayneahchoon Sep 13, 2024
e4163cc
WSTEAM1-POC: Add button and signpost
shayneahchoon Sep 13, 2024
18e4b64
WSTEAM1-POC: Add button and signpost
shayneahchoon Sep 13, 2024
98374f7
WSTEAM1-POC: Add button and signpost
shayneahchoon Sep 13, 2024
e51f4c6
WSTEAM1-POC: Add button and signpost
shayneahchoon Sep 13, 2024
801f9d5
Update mediaLoader to render Transcript if provided
Isabella-Mitchell Sep 13, 2024
7bd1587
Adds unit tests. Updates listItem rendering logic
Isabella-Mitchell Sep 13, 2024
134586a
Add basic transcript tests
Isabella-Mitchell Sep 13, 2024
c9e8ef8
Refines listitem logic and styles
Isabella-Mitchell Sep 13, 2024
1e35f04
Merge branch 'latest' into WSTEAM1-TRANSCRIPT-SIGN-BUTTON
shayneahchoon Sep 16, 2024
317f3a8
Merge branch 'latest' into Transcript-front-end
Isabella-Mitchell Sep 27, 2024
ec0f986
Transcript-front-end: lint post merge
Isabella-Mitchell Sep 27, 2024
f0017a7
Transcript: Update bundle size
Isabella-Mitchell Sep 27, 2024
d493e12
Transcript-front-end: Moves margin
Isabella-Mitchell Sep 27, 2024
dfe8d46
Transcript-front-end: add article with transcript story
Isabella-Mitchell Sep 27, 2024
0d0e6b2
Transcript-front-end: Try fix github alert
Isabella-Mitchell Sep 27, 2024
4167937
Transcript-front-end: SVG align adjust. Tries move visually hidden text
Isabella-Mitchell Sep 27, 2024
b344efc
Transcript-front-end: attempt improve summary text swiping
Isabella-Mitchell Sep 27, 2024
9ff1160
Update snapshot
Isabella-Mitchell Sep 27, 2024
d7b30bb
Transcript-front-end: Mock up Talkback bug fix - introduces bug to Vo…
Isabella-Mitchell Sep 29, 2024
4568711
Transcrip-front-end: Reverts changes. Removes A11y comments
Isabella-Mitchell Sep 29, 2024
defa588
WSTEAM1-POC: Add media indicator and SVG
shayneahchoon Oct 11, 2024
5c34e8a
Merge branch 'WSTEAM1-TRANSCRIPT-SIGN-BUTTON' of github.com:bbc/simor…
shayneahchoon Oct 11, 2024
126dc18
WSTEAM1-POC: Bits and pieces/
shayneahchoon Oct 11, 2024
e6f934f
WSTEAM1-POC: Update
shayneahchoon Oct 11, 2024
e565213
Merge branch 'latest' into WSTEAM1-TRANSCRIPT-SIGN-BUTTON
shayneahchoon Oct 14, 2024
edcf5a1
Merge branch 'latest' into WSTEAM1-TRANSCRIPT-SIGN-BUTTON
shayneahchoon Oct 16, 2024
5946c14
WSTEAM1-POC: Update snapshots
shayneahchoon Oct 16, 2024
ffa0550
WSTEAM1-POC: Update snapshots
shayneahchoon Oct 16, 2024
001c84d
WSTEAM1-POC: Update:
shayneahchoon Oct 18, 2024
157c817
Merge Latest
Isabella-Mitchell Nov 8, 2024
3ac2fcb
WSTEAM1-Transcript: Updates button title and timestamp
Isabella-Mitchell Nov 8, 2024
38c886a
WSTEAM1-Transcript: Updates tests and bundle size
Isabella-Mitchell Nov 8, 2024
4602361
Merge remote-tracking branch 'origin' into WSTEAM1-TRANSCRIPT-SIGN-BU…
shayneahchoon Nov 8, 2024
14439af
WSTEAM1-Transcript: Renders Transcript on .lite site
Isabella-Mitchell Nov 8, 2024
f2d20bf
WSTEAM1-POC: Update noJS
shayneahchoon Nov 8, 2024
f41d4a5
WSTEAM1-Transcript: Bundle size
Isabella-Mitchell Nov 22, 2024
e66a052
merge in latest
Isabella-Mitchell Nov 22, 2024
2d8abbd
Merge branch 'latest' into WSTEAM1-TRANSCRIPT-SIGN-BUTTON
shayneahchoon Nov 22, 2024
9a3e76b
WSTEAM1-POC: Update
shayneahchoon Nov 22, 2024
44c5eb7
WSTEAM1-POC: Update
shayneahchoon Nov 22, 2024
c2fa1e2
Merge branch 'WSTEAM1-TRANSCRIPT-SIGN-BUTTON' into Transcript-front-end
Isabella-Mitchell Nov 22, 2024
327042a
WSTEAM1-POC: Update snapshots
shayneahchoon Nov 22, 2024
b69d473
WSTEAM1-POC: Update snapshots
shayneahchoon Nov 22, 2024
0847c22
Merge branch 'WSTEAM1-TRANSCRIPT-SIGN-BUTTON' into Transcript-front-end
Isabella-Mitchell Nov 22, 2024
51297b9
WSTEAM1-POC: Update storybook
shayneahchoon Nov 22, 2024
b7d8460
Merge branch 'WSTEAM1-TRANSCRIPT-SIGN-BUTTON' into Transcript-front-end
Isabella-Mitchell Nov 22, 2024
1e36a6a
Transcript: Resolve merge conflict
Isabella-Mitchell Nov 22, 2024
89eb549
Merge pull request #12202 from bbc/clone-transcript-front-end
Isabella-Mitchell Nov 22, 2024
5dbc8f3
WSTEAM1-Transcript: Adds experiment_stages control to Article Page story
Isabella-Mitchell Nov 22, 2024
bd182b1
WSTEAM1: Fix unit tests
Isabella-Mitchell Nov 22, 2024
6efe03c
WSTEAM1-POC: Add hook
shayneahchoon Nov 22, 2024
9345436
Merge branch 'WSTEAM1-TRANSCRIPT-SIGNPOST-CLONE' of github.com:bbc/si…
shayneahchoon Nov 22, 2024
418a046
WSTEAM1-POC: Add hook
shayneahchoon Nov 22, 2024
725b8c1
WSTEAM1-POC: Add noJS lock
shayneahchoon Nov 22, 2024
6258918
WSTEAM1-POC: Update styling
shayneahchoon Dec 12, 2024
f9b83ac
WSTEAM1-POC: Update
shayneahchoon Dec 13, 2024
f7c9150
WSTEAM1-POC: Add styling
shayneahchoon Dec 20, 2024
6f5e38e
WSTEAM1-POC: Add styling
shayneahchoon Dec 20, 2024
9ca4af1
WSTEAM1-POC: Add styling
shayneahchoon Dec 20, 2024
9e05727
WSTEAM1-POC: Add styling
shayneahchoon Dec 20, 2024
8ab3978
WSTEAM1-POC: Update
shayneahchoon Dec 20, 2024
456228e
Merge branch 'latest' into WSTEAM1-TRANSCRIPT-SIGNPOST-CLONE
shayneahchoon Jan 10, 2025
2e3e4e4
Merge branch 'latest' into WSTEAM1-TRANSCRIPT-SIGNPOST-CLONE
shayneahchoon Jan 13, 2025
dde84fd
WSTEAM1-POC: Update
shayneahchoon Jan 15, 2025
546f5ef
Merge branch 'latest' into WSTEAM1-TRANSCRIPT-SIGNPOST-CLONE
Isabella-Mitchell Jan 17, 2025
8bca0a1
WSTEAM1-TRANSCRIPT: Lint and tests
Isabella-Mitchell Jan 17, 2025
d11b1d0
WSTEAM1-Transcript: Update Integration snapshots
Isabella-Mitchell Jan 17, 2025
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
1,091 changes: 1,091 additions & 0 deletions data/mundo/articles/ce42wzqr2mko-old.json

Large diffs are not rendered by default.

867 changes: 627 additions & 240 deletions data/mundo/articles/ce42wzqr2mko.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions scripts/bundleSize/bundleSizeConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
* We are allowing a variance of -5 on `MIN_SIZE` and +5 on `MAX_SIZE` to avoid the need for frequent changes, as bundle sizes can fluctuate
*/

export const MIN_SIZE = 646 - 5;
export const MAX_SIZE = 1185 + 5;
export const MIN_SIZE = 635 - 5;
export const MAX_SIZE = 1204 + 5;
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ exports[`Media Player: Placeholder should render a video placeholder 1`] = `
background-color: #B80000;
}

.emotion-0:hover .experimentButtonFocus,
.emotion-0:focus .experimentButtonFocus {
background-color: #B80000;
color: #FFFFFF;
}

.emotion-0:hover .experimentButtonFocus svg,
.emotion-0:focus .experimentButtonFocus svg {
color: #FFFFFF;
}

@media screen and (forced-colors: active) {
.emotion-0:hover>button,
.emotion-0:focus>button {
Expand Down Expand Up @@ -258,7 +269,7 @@ exports[`Media Player: Placeholder should render a video placeholder 1`] = `

<div>
<div
class="emotion-0"
class="placeholder emotion-0"
data-e2e="media-loader__placeholder"
>
<div
Expand Down Expand Up @@ -313,6 +324,7 @@ exports[`Media Player: Placeholder should render a video placeholder 1`] = `
2:30
</time>
</button>
<noscript />
<div
class="emotion-9"
style="padding-bottom: 0px; overflow: hidden;"
Expand Down Expand Up @@ -343,6 +355,17 @@ exports[`Media Player: Placeholder should render a video placeholder with guidan
background-color: #B80000;
}

.emotion-0:hover .experimentButtonFocus,
.emotion-0:focus .experimentButtonFocus {
background-color: #B80000;
color: #FFFFFF;
}

.emotion-0:hover .experimentButtonFocus svg,
.emotion-0:focus .experimentButtonFocus svg {
color: #FFFFFF;
}

@media screen and (forced-colors: active) {
.emotion-0:hover>button,
.emotion-0:focus>button {
Expand Down Expand Up @@ -611,7 +634,7 @@ exports[`Media Player: Placeholder should render a video placeholder with guidan

<div>
<div
class="emotion-0"
class="placeholder emotion-0"
data-e2e="media-loader__placeholder"
>
<div
Expand Down Expand Up @@ -672,6 +695,7 @@ exports[`Media Player: Placeholder should render a video placeholder with guidan
2:30
</time>
</button>
<noscript />
<div
class="emotion-10"
style="padding-bottom: 0px; overflow: hidden;"
Expand Down Expand Up @@ -702,6 +726,17 @@ exports[`Media Player: Placeholder should render a video placeholder without dur
background-color: #B80000;
}

.emotion-0:hover .experimentButtonFocus,
.emotion-0:focus .experimentButtonFocus {
background-color: #B80000;
color: #FFFFFF;
}

.emotion-0:hover .experimentButtonFocus svg,
.emotion-0:focus .experimentButtonFocus svg {
color: #FFFFFF;
}

@media screen and (forced-colors: active) {
.emotion-0:hover>button,
.emotion-0:focus>button {
Expand Down Expand Up @@ -928,7 +963,7 @@ exports[`Media Player: Placeholder should render a video placeholder without dur

<div>
<div
class="emotion-0"
class="placeholder emotion-0"
data-e2e="media-loader__placeholder"
>
<div
Expand Down Expand Up @@ -976,6 +1011,7 @@ exports[`Media Player: Placeholder should render a video placeholder without dur
</svg>
</div>
</button>
<noscript />
<div
class="emotion-8"
style="padding-bottom: 0px; overflow: hidden;"
Expand Down Expand Up @@ -1006,6 +1042,17 @@ exports[`Media Player: Placeholder should render an audio placeholder 1`] = `
background-color: #B80000;
}

.emotion-0:hover .experimentButtonFocus,
.emotion-0:focus .experimentButtonFocus {
background-color: #B80000;
color: #FFFFFF;
}

.emotion-0:hover .experimentButtonFocus svg,
.emotion-0:focus .experimentButtonFocus svg {
color: #FFFFFF;
}

@media screen and (forced-colors: active) {
.emotion-0:hover>button,
.emotion-0:focus>button {
Expand Down Expand Up @@ -1248,7 +1295,7 @@ exports[`Media Player: Placeholder should render an audio placeholder 1`] = `

<div>
<div
class="emotion-0"
class="placeholder emotion-0"
data-e2e="media-loader__placeholder"
>
<div
Expand Down Expand Up @@ -1296,6 +1343,7 @@ exports[`Media Player: Placeholder should render an audio placeholder 1`] = `
2:30
</time>
</button>
<noscript />
<div
class="emotion-9"
style="padding-bottom: 0px; overflow: hidden;"
Expand Down Expand Up @@ -1326,6 +1374,17 @@ exports[`Media Player: Placeholder should render an audio placeholder without du
background-color: #B80000;
}

.emotion-0:hover .experimentButtonFocus,
.emotion-0:focus .experimentButtonFocus {
background-color: #B80000;
color: #FFFFFF;
}

.emotion-0:hover .experimentButtonFocus svg,
.emotion-0:focus .experimentButtonFocus svg {
color: #FFFFFF;
}

@media screen and (forced-colors: active) {
.emotion-0:hover>button,
.emotion-0:focus>button {
Expand Down Expand Up @@ -1552,7 +1611,7 @@ exports[`Media Player: Placeholder should render an audio placeholder without du

<div>
<div
class="emotion-0"
class="placeholder emotion-0"
data-e2e="media-loader__placeholder"
>
<div
Expand Down Expand Up @@ -1593,6 +1652,7 @@ exports[`Media Player: Placeholder should render an audio placeholder without du
</svg>
</div>
</button>
<noscript />
<div
class="emotion-8"
style="padding-bottom: 0px; overflow: hidden;"
Expand Down Expand Up @@ -1623,6 +1683,17 @@ exports[`Media Player: Placeholder should render no-js styles when noJsClassName
background-color: #B80000;
}

.emotion-0:hover .experimentButtonFocus,
.emotion-0:focus .experimentButtonFocus {
background-color: #B80000;
color: #FFFFFF;
}

.emotion-0:hover .experimentButtonFocus svg,
.emotion-0:focus .experimentButtonFocus svg {
color: #FFFFFF;
}

@media screen and (forced-colors: active) {
.emotion-0:hover>button,
.emotion-0:focus>button {
Expand Down Expand Up @@ -1891,7 +1962,7 @@ exports[`Media Player: Placeholder should render no-js styles when noJsClassName

<div>
<div
class="emotion-0"
class="placeholder emotion-0"
data-e2e="media-loader__placeholder"
>
<div
Expand Down Expand Up @@ -1952,6 +2023,7 @@ exports[`Media Player: Placeholder should render no-js styles when noJsClassName
2:30
</time>
</button>
<noscript />
<div
class="emotion-10"
style="padding-bottom: 0px; overflow: hidden;"
Expand Down
7 changes: 7 additions & 0 deletions src/app/components/MediaLoader/Placeholder/index.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ const styles = {
'> button': {
backgroundColor: palette.POSTBOX,
},
'.experimentButtonFocus': {
backgroundColor: palette.POSTBOX,
color: palette.WHITE,
svg: {
color: palette.WHITE,
},
},
},
[mq.FORCED_COLOURS]: {
'&:hover, &:focus': {
Expand Down
8 changes: 8 additions & 0 deletions src/app/components/MediaLoader/Placeholder/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
fireEvent,
getByText,
} from '#app/components/react-testing-library-with-providers';
import { Stages } from '#app/hooks/useExperimentHook';
import Placeholder from '.';

describe('Media Player: Placeholder', () => {
Expand All @@ -25,6 +26,7 @@ describe('Media Player: Placeholder', () => {
src="http://foo.bar/placeholder.png"
mediaInfo={{ title: 'Dog chases cat.', ...withDuration }}
noJsMessage="no js"
experimentStage={Stages.STAGE_3}
/>,
{ service: 'news' },
);
Expand All @@ -38,6 +40,7 @@ describe('Media Player: Placeholder', () => {
src="http://foo.bar/placeholder.png"
mediaInfo={{ title: 'Dog chases cat.' }}
noJsMessage="no js"
experimentStage={Stages.STAGE_3}
/>,
{ service: 'news' },
);
Expand All @@ -55,6 +58,7 @@ describe('Media Player: Placeholder', () => {
...withDuration,
}}
noJsMessage="no js"
experimentStage={Stages.STAGE_3}
/>,
{ service: 'news' },
);
Expand All @@ -68,6 +72,7 @@ describe('Media Player: Placeholder', () => {
src="http://foo.bar/placeholder.png"
mediaInfo={{ type: 'audio', title: 'Dog barks at cat.' }}
noJsMessage="no js"
experimentStage={Stages.STAGE_3}
/>,
{ service: 'news' },
);
Expand All @@ -81,6 +86,7 @@ describe('Media Player: Placeholder', () => {
src="http://foo.bar/placeholder.png"
mediaInfo={{ title: 'Dog chases cat.', ...withDuration }}
noJsMessage="no js"
experimentStage={Stages.STAGE_3}
/>,
{ service: 'news' },
);
Expand All @@ -101,6 +107,7 @@ describe('Media Player: Placeholder', () => {
...withDuration,
}}
noJsMessage="no js"
experimentStage={Stages.STAGE_3}
/>,
{ service: 'news' },
);
Expand All @@ -119,6 +126,7 @@ describe('Media Player: Placeholder', () => {
...withDuration,
}}
noJsMessage="no js"
experimentStage={Stages.STAGE_3}
/>,
{ service: 'news' },
);
Expand Down
65 changes: 47 additions & 18 deletions src/app/components/MediaLoader/Placeholder/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
/** @jsx jsx */
import { jsx } from '@emotion/react';
import { Stages } from '#app/hooks/useExperimentHook';
import SignPost from '#app/components/TranscriptExperiment/SignPost';
import SignPostNoJs from '#app/components/TranscriptExperiment/SignPostNoJs';
import Image from '../../Image';
import styles from './index.styles';
import PlayButton from './PlayButton';
import Guidance from './Guidance';
import { MediaInfo } from '../types';
import MediaIndicator from '../../TranscriptExperiment/MediaIndicator';

interface Props {
onClick: React.MouseEventHandler<HTMLDivElement>;
src?: string;
srcSet?: string;
mediaInfo?: MediaInfo;
noJsMessage?: string;
experimentStage?: Stages;
}

const MediaPlayerPlaceholder = ({
Expand All @@ -20,6 +25,7 @@ const MediaPlayerPlaceholder = ({
srcSet,
mediaInfo,
noJsMessage = '',
experimentStage = Stages.STAGE_3,
}: Props) => {
const {
title,
Expand All @@ -30,31 +36,54 @@ const MediaPlayerPlaceholder = ({
guidanceMessage,
} = mediaInfo ?? {};

const playButton = (
<PlayButton
css={styles.playButton}
// eslint-disable-next-line @typescript-eslint/no-empty-function
onClick={() => {}}
title={title}
datetime={datetime}
duration={duration}
durationSpoken={durationSpoken}
type={type}
guidanceMessage={guidanceMessage}
className="focusIndicatorRemove"
/>
);

const experimentPlayButton = (
<MediaIndicator
title={title}
datetime={datetime}
duration={duration}
durationSpoken={durationSpoken}
type={type}
guidanceMessage={guidanceMessage}
/>
);

const guideComponent = (
<Guidance
css={styles.guidance}
guidanceMessage={guidanceMessage}
noJsMessage={noJsMessage}
/>
);

const experimentSignPost = <SignPost title={title} />;

return (
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
<div
onClick={onClick}
css={styles.placeholder}
data-e2e="media-loader__placeholder"
className="placeholder"
>
<Guidance
css={styles.guidance}
guidanceMessage={guidanceMessage}
noJsMessage={noJsMessage}
/>
<PlayButton
css={styles.playButton}
// eslint-disable-next-line @typescript-eslint/no-empty-function
onClick={() => {}}
title={title}
datetime={datetime}
duration={duration}
durationSpoken={durationSpoken}
type={type}
guidanceMessage={guidanceMessage}
className="focusIndicatorRemove"
/>

{experimentStage === Stages.STAGE_3 ? guideComponent : null}
{experimentStage === Stages.STAGE_2 ? experimentPlayButton : playButton}
{experimentStage === Stages.STAGE_2 ? experimentSignPost : null}
<SignPostNoJs noJsMessage={noJsMessage} />
<Image alt="" src={src} srcSet={srcSet} />
</div>
);
Expand Down
Loading
Loading