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

Reader: Discover featured posts accessibility improvements #27089

Merged
merged 5 commits into from
Oct 9, 2018

Conversation

bluefuton
Copy link
Contributor

@bluefuton bluefuton commented Sep 10, 2018

The featured posts block, as used in Discover, doesn't currently pass our a11y lint check.

screen shot 2018-09-10 at 16 07 20

This PR aims to fix that by using a button element and re-styling accordingly.

To test

Visit http://calypso.localhost:3000/discover.

You can also run the linter and check that there are no a11y warnings:

npx eslint client/reader/site-stream/* --ext js,jsx

Ensure that the appearance of the featured block is the same, both above and below 960px width:

http://calypso.localhost:3000/discover

vs

https://wpcalypso.wordpress.com/discover

screen shot 2018-09-21 at 15 41 49

screen shot 2018-09-21 at 15 41 56

Todo

  • Remove border in Safari
  • Fix display in vertical stacked view (<960px)

@bluefuton bluefuton added [Status] In Progress [Feature] Reader The reader site on Calypso. labels Sep 10, 2018
@bluefuton bluefuton added this to the Reader: Bug Backlog milestone Sep 10, 2018
@bluefuton bluefuton self-assigned this Sep 10, 2018
@matticbot
Copy link
Contributor

@bluefuton bluefuton added the Accessibility (a11y) label Sep 10, 2018
@bluefuton bluefuton changed the title Reader: make featured posts keyboard-accessible Reader: Discover featured posts accessibility improvements Sep 21, 2018
@bluefuton bluefuton added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Sep 21, 2018
class FeedFeatured extends React.PureComponent {
static displayName = 'FeedFeatured';

componentDidMount() {
this.props.requestPage( { streamKey: this.props.streamKey } );
if ( ! this.props.posts || this.props.posts.length < FEED_FEATURED_MAX_POST_COUNT ) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously, it was possible for the same set of posts to appear twice if the component re-mounted.

@bluefuton
Copy link
Contributor Author

Looks good in IE11:

screen shot 2018-09-21 at 16 15 33

screen shot 2018-09-21 at 16 14 54

position: relative;
padding: 0 24px 0 24px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Small nitpick: I would just do 0 24px here.

@westi
Copy link
Contributor

westi commented Oct 1, 2018

I think this is good to go @bluefuton ?

@bluefuton bluefuton added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Oct 3, 2018
@@ -63,14 +68,14 @@ class FeedFeatured extends React.PureComponent {
};

return (
<div
<button
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe make this a big anchor instead of a button? It has a URL after all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's actually a better idea than my button, but also scuppers all the styles, especially in the small viewport version 🤦‍♂️

I'll ship this for now and bear it in mind for future improvements 👍

@bluefuton bluefuton merged commit 0cc48f4 into master Oct 9, 2018
@bluefuton bluefuton deleted the fix/a11y/site-stream-featured branch October 9, 2018 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility (a11y) [Feature] Reader The reader site on Calypso.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants