-
Notifications
You must be signed in to change notification settings - Fork 234
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
base: latest
Are you sure you want to change the base?
Conversation
I've updated this to use the inverted focus indicator. Is this ok? |
Links for component health |
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). |
Have added, though not the swarm doc since it's not set up for sharing |
@@ -17,6 +17,13 @@ const styles = { | |||
'> button': { | |||
backgroundColor: palette.POSTBOX, | |||
}, | |||
'.experimentButtonFocus': { |
There was a problem hiding this comment.
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 = ( |
There was a problem hiding this comment.
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} />; |
There was a problem hiding this comment.
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)?
{experimentStage === Stages.STAGE_3 ? guideComponent : null} | ||
{experimentStage === Stages.STAGE_2 ? experimentPlayButton : playButton} | ||
{experimentStage === Stages.STAGE_2 ? experimentSignPost : null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reorder stages numerically
{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} /> |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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 }) => ( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!!)
<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" | ||
> | ||
<strong>Dem no support media player for your device</strong> | ||
</noscript> | ||
</div> |
There was a problem hiding this comment.
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...
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 |
There was a problem hiding this comment.
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) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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], |
There was a problem hiding this comment.
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?
if (service !== 'mundo' && !lowPower && !dataSaver && !isOperaMini) { | ||
return Stages.STAGE_3; | ||
} | ||
|
||
if ( | ||
(service === 'mundo' || dataSaver || isOperaMini || lowPower) && | ||
hasTranscript | ||
) { | ||
return Stages.STAGE_2; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reorder stages
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; | |
} | |
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
Components
Hooks
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