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

MAP fauxHeadline and visuallyHiddenHeadline logic #4582

Merged
merged 42 commits into from
Nov 12, 2019

Conversation

pjlee11
Copy link

@pjlee11 pjlee11 commented Nov 6, 2019

Resolves #4403
Further context: #4150

Related PR: BBC-archive/psammead#2575

Overall change: Explicitly creates seperate blocks fauxHeadline and visuallyHiddenHeadline for the MAP pages to allow the Headline to be displayed under the AV content while maintaining the semantic use of <h1> for a11y best practices.

Code changes:

  • Preprocessor rule for MAPs that creates fauxHeadline and visuallyHiddenHeadline blocks
  • Creates containers for the new blocks fauxHeadline and visuallyHiddenHeadline
  • Creates a <h1> using the VisuallyHiddenText psammead component and renders it above the video block for semantic HTML purposes and a11y best practices
  • Creates a <strong> element using the Headline psammead component and renders it below the video block for improved UX visual treatment, this is has aria-hidden so it is ignored in the terms of a11y

  • I have assigned myself to this PR and the corresponding issues
  • Automated (jest and/or cypress) tests added (for new features) or updated (for existing features)
  • If necessary, I have run the local E2E non-smoke tests relevant to my changes (CYPRESS_APP_ENV=local CYPRESS_SMOKE=false npm run test:e2e:interactive)
  • This PR requires manual testing

Testing notes:
As this could severely affect a11y concerns (EG: screen reader users, navigation by heading, etc) we need to test all a11y tools to ensure no regression in behaviour.

@pjlee11 pjlee11 added ws-media World Service Media MAP labels Nov 6, 2019
@pjlee11 pjlee11 added this to the [WSM] Basic MAP Page milestone Nov 6, 2019
@pjlee11 pjlee11 self-assigned this Nov 6, 2019
const FauxHeadlineContainer = ({ blocks }) => {
const { script, service } = useContext(ServiceContext);

const arrayOfFragments = blocks[0].model.blocks[0].model.blocks;
Copy link

Choose a reason for hiding this comment

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

Can you use path here please

});

describe('with headline data', () => {
const data = {
Copy link

Choose a reason for hiding this comment

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

const data = textBlock('This is a headline!');

@ryanmccombe ryanmccombe merged commit 7e6e09a into latest Nov 12, 2019
@ryanmccombe ryanmccombe deleted the MAP-hidden-headline-logic branch November 12, 2019 11:51
@ryanmccombe
Copy link
Contributor

MAPs are not live yet, and we're going to do an a11y swarm before they are, so doesn't seem worthwhile holding this PR up for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MAP ws-media World Service Media
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Heading added below media for MAP
7 participants