Skip to content

Read more button poc #12563

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

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

Read more button poc #12563

wants to merge 104 commits into from

Conversation

LilyL0u
Copy link
Contributor

@LilyL0u LilyL0u commented Mar 24, 2025

Resolves JIRA: https://jira.dev.bbc.co.uk/browse/WORLDSERVICE-505
A11y and screenreader requirements: https://paper.dropbox.com/doc/Article-Continue-Reading-button-a11y-screen-reader-UX--CjmSUEpk7TxVMR4HWApmH8HGAg-LZvihgQf7tXdezcUfP1ZB

Summary

Two variations on the now named 'Continue Reading' button are created. They are one component, with conditionally different styling. The functionality is the same for both variations.

Currently the variations are hard coded to be available on Pidgin and Urdu for variation A and Mundo and Arabic for variation B. This will be removed for the experiment. You can view the component on pages by changing continueReadingEnabled = false, to true in ArticlePage.tsx, and making the page smaller than desktop size. You can view the component on storybook.

The component only shows on mobile widths.

When you click the button it moves the focus to the newly revealed paragraph, including a custom focus indicator. This also happens when navigating on keyboard or tapping on mobile.

Some pages have a lite site CTA under the headline which adds to the count of the blocks above the button. This is why we have a check for the lite site CTA being enabled: to see whether we need to add one to our count of where to put the button. The button should appear after 3 paragraphs.

Code changes

  • A bullet point list of key code changes that have been made.

Developer Checklist

  • UX
    • UX Criteria met (visual UX & screenreader UX)
  • Accessibility
    • Accessibility Acceptance Criteria met
    • Accessibility swarm completed
    • Component Health updated
    • P1 accessibility bugs resolved
    • P2/P3 accessibility bugs planned (if not resolved)
  • Security
    • Security issues addressed
    • Threat Model updated
  • Documentation
    • Docs updated (runbook, READMEs)
  • Testing
    • Feature tested on relevant environments
  • Comms
    • Relevant parties notified of changes

Testing

  • Manual Testing required?
    • Local (Ready-For-Test, Local)
    • Test (Ready-For-Test, Test)
    • Preview (Ready-For-Test, Preview)
    • Live (Ready-For-Test, Live)
  • Manual Testing complete?
    • Local
    • Test
    • Preview
    • Live

Additional Testing Steps

  1. List the steps required to test this PR.

Useful Links

<button
css={[buttonStyle, styles.hideButtonOnDesktop]}
type="button"
onMouseDown={handleEvent}
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for context on why these event handlers were used instead of onClick.

https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#notes

We want to show a focus indicator on the revealed element after the button is clicked/tapped/keyed. onClick didn't behave this way as focus was lost after clicking the button.

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.

6 participants