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: Front End Changes for Transcript First Video #12201

Open
wants to merge 106 commits into
base: latest
Choose a base branch
from

Conversation

shayneahchoon
Copy link
Contributor

@shayneahchoon shayneahchoon commented Nov 22, 2024

Transcript Experiment. No JIRA ticket. Notes to Reviewers

Overall changes

Adds transcript component and updates mediaLoader to allow Transcript First Video experience.

Code changes

Data

  • Adds fixture data files for storybook (Article Page & Media Article Page)

Components

  • Updates Media Loader, which affects video on newer Article, Media Article Pages.
  • Adds Transcript component
  • Adds media indicator & signposting

Hooks

  • Adds 'useExperiementHook' which works out which variant to use.

Plus updates snapshots

Testing

Local test link: http://localhost:7080/mundo/articles/cle16n19nd9o
Storybook permalinks & more testing info in this paper doc

Helpful Links

AAC
A11y swarm
Screen reader UX

@Isabella-Mitchell
Copy link
Contributor

Amends please
...

  • @Isabella-Mitchell can we make the focus indicator look better when it's around '+ Load video'

I've updated this to use the inverted focus indicator. Is this ok?

Screenshot 2025-02-14 at 09 07 52

@greenc05
Copy link

greenc05 commented Feb 17, 2025

Links for component health

@greenc05
Copy link

Question: On your local env, when you press TAB on the keyboard to move focus to 'Load video' where does focus go after this link is actioned? Does it move to the player? (Hard to tell on storybook - seems to be ok e.g. it doesn't go to the top of the page)

@Isabella-Mitchell
Copy link
Contributor

Question: On your local env, when you press TAB on the keyboard to move focus to 'Load video' where does focus go after this link is actioned? Does it move to the player? (Hard to tell on storybook - seems to be ok e.g. it doesn't go to the top of the page)

Yep - it moves to the player. (Checked on http://localhost.bbc.com:7080/mundo/articles/cle16n19nd9o).

@Isabella-Mitchell
Copy link
Contributor

Links for component health

Have added, though not the swarm doc since it's not set up for sharing

@Isabella-Mitchell Isabella-Mitchell changed the title WSTEAM1-TRANSCRIPT-MASTER-BRANCH: Add signpost and transcript components. WSTEAM1-TRANSCRIPT-MASTER-BRANCH: Front End Changes for Transcript First Video Feb 28, 2025
@Isabella-Mitchell Isabella-Mitchell changed the title WSTEAM1-TRANSCRIPT-MASTER-BRANCH: Front End Changes for Transcript First Video WSTEAM1-TRANSCRIPT: Front End Changes for Transcript First Video Feb 28, 2025
@Isabella-Mitchell Isabella-Mitchell marked this pull request as ready for review February 28, 2025 16:17
@@ -17,6 +17,13 @@ const styles = {
'> button': {
backgroundColor: palette.POSTBOX,
},
'.experimentButtonFocus': {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we planning to run this as an experiment? Or can we use the word transcript instead?

/>
);

const experimentPlayButton = (
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use transcript instead of experiment in variable names? (Let's pretend it's not an experiment any more!)

playButtonWithTranscript or something along those lines?

/>
);

const experimentSignPost = <SignPost title={title} />;
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the signpost component? Can we give it a better name (and remove experiment)?

Comment on lines +83 to +85
{experimentStage === Stages.STAGE_3 ? guideComponent : null}
{experimentStage === Stages.STAGE_2 ? experimentPlayButton : playButton}
{experimentStage === Stages.STAGE_2 ? experimentSignPost : null}
Copy link
Contributor

Choose a reason for hiding this comment

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

Reorder stages numerically

Suggested change
{experimentStage === Stages.STAGE_3 ? guideComponent : null}
{experimentStage === Stages.STAGE_2 ? experimentPlayButton : playButton}
{experimentStage === Stages.STAGE_2 ? experimentSignPost : null}
{experimentStage === Stages.STAGE_2 ? experimentPlayButton : playButton}
{experimentStage === Stages.STAGE_2 ? experimentSignPost : null}
{experimentStage === Stages.STAGE_3 ? guideComponent : null}

{experimentStage === Stages.STAGE_3 ? guideComponent : null}
{experimentStage === Stages.STAGE_2 ? experimentPlayButton : playButton}
{experimentStage === Stages.STAGE_2 ? experimentSignPost : null}
<SignPostNoJs noJsMessage={noJsMessage} />
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we name this component something other than SignPostNoJS? What exactly is it?

service: 'news',
},
);
expect(container).toMatchSnapshot();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use a better way of asserting that this component renders as expected?

@@ -37,96 +37,18 @@ export const RightChevron = ({ className }: { className?: string }) => (
</svg>
);

export const Clock = ({ className }: { className?: string }) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

Oops I am guessing we didn't mean to delete all these?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there an argument for adding these svgs to the src/app/components/icons/index.tsx file?

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should rename this hook to be very specific to this particular experiment? Because it sounds generic, and seems like it could be used for other experiments, but it can't.

Let's ensure that the name does not include "hook"

Something along the lines of useDetermineTranscriptExperimentStage (that's a bit of a mouthful! Naming things is hard!!)

Comment on lines -68 to -83
<div
class="css-czokpf"
data-e2e="media-player__guidance"
>
<strong
aria-hidden="true"
class="guidance-message css-e3010g"
>
Contains strong language and some upsetting scenes.
</strong>
<noscript
class="css-lllaou"
>
&lt;strong&gt;Dem no support media player for your device&lt;/strong&gt;
</noscript>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

I wasn't expecting these to have disappeared from the snapshots...

@karinathomasbbc
Copy link
Contributor

Links for component health

Have added, though not the swarm doc since it's not set up for sharing

Can I request that we use Dropbox Paper for the swarm when we do it?

uniqueId,
forceStage,
}: Props) => {
// TODO - refactor to improve experience on .lite
Copy link
Contributor

Choose a reason for hiding this comment

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

How might we improve the experience on lite? What type of refactoring is needed? Should we try and do that as part of this PR, or later?

parameters: {
docs: { readme },
},
};

export const ExperimentMediaLoader = ({ experimentStage }: Props) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export const ExperimentMediaLoader = ({ experimentStage }: Props) => (
export const MediaLoaderWithTranscript = ({ experimentStage }: Props) => (

</RequestContextProvider>
);

export default {
title: 'Components/MediaLoader',
Component,
argTypes: {
experimentStage: {
options: [Stages.STAGE_2, Stages.STAGE_3],
Copy link
Contributor

Choose a reason for hiding this comment

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

Why don't we add all stages here? Also, could it be a dropdown with a default option selected?

Comment on lines +43 to +52
if (service !== 'mundo' && !lowPower && !dataSaver && !isOperaMini) {
return Stages.STAGE_3;
}

if (
(service === 'mundo' || dataSaver || isOperaMini || lowPower) &&
hasTranscript
) {
return Stages.STAGE_2;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Reorder stages

Suggested change
if (service !== 'mundo' && !lowPower && !dataSaver && !isOperaMini) {
return Stages.STAGE_3;
}
if (
(service === 'mundo' || dataSaver || isOperaMini || lowPower) &&
hasTranscript
) {
return Stages.STAGE_2;
}
if (
(service === 'mundo' || dataSaver || isOperaMini || lowPower) &&
hasTranscript
) {
return Stages.STAGE_2;
}
if (service !== 'mundo' && !lowPower && !dataSaver && !isOperaMini) {
return Stages.STAGE_3;
}

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.

4 participants