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

[Mobile] Improving accessibility on Post title #15106

Merged
merged 6 commits into from
Apr 23, 2019

Conversation

pinarol
Copy link
Contributor

@pinarol pinarol commented Apr 22, 2019

Description

This PR improves accessibility on the Post title.
Fixes wordpress-mobile/gutenberg-mobile#912

To test:
Please refer to the gutenberg-mobile side PR.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

@pinarol pinarol added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) labels Apr 22, 2019
@pinarol pinarol requested review from Tug and etoledom April 22, 2019 14:40
@pinarol pinarol self-assigned this Apr 22, 2019
<View
style={ [ styles.titleContainer, borderStyle, { borderColor } ] }
accessible={ ! this.state.isSelected }
accessibilityLabel={ __( 'Post title' ) + '. ' + ( isEmpty( title ) ? __( 'Empty' ) : title ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a quick note about this:

Although most languages use a period (.) to end a sentence, some don't, and we might think that it would be more correct to use sprintf in this case to concatenate the 2 sentences.

sprintf( __( 'Post title. %s' ), isEmpty( title ) ? __( 'Empty' ) : title )

However I don't think it's worth it at this point. it's not very clear for translators what the Post title. %s string means (even with a comment). Moreover Post title will probably be reused at other places so it makes more sense to translate that only.

Lastly, this sentence is built to be heard not read by the user.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updating this according to what we discussed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! We can refer to this one for the future accessibility labels

@Tug
Copy link
Contributor

Tug commented Apr 22, 2019

Tested on iOS, this worked well 👍. I noticed it says "actions available" at the end, not sure why?
On Android however, I'm hearing: Editing "Welcome to gutenberg" edit box "Add title" cursor.... A swipe left actually selects the post title and I'm hearing Post title Welcome to Gutenberg.
So it seems related to the fact that android can access children of accessible elements...

Copy link
Contributor

@etoledom etoledom left a comment

Choose a reason for hiding this comment

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

Tested via wordpress-mobile/gutenberg-mobile#916 (review)

@Tug , for the Android issues we created a new ticket. There seems to be an issue with the Android side of the Aztec Wrapper: wordpress-mobile/gutenberg-mobile#918

Actions Available: It's good to let the user know that something will happen if they double tap on it (this element has an action).
It's also good practice to mark these elements as button (as they are tappable).

Let's :shipit: after @Tug 's ✅ :)

@pinarol
Copy link
Contributor Author

pinarol commented Apr 22, 2019

hey @Tug are you ok with the last changes?

@Tug
Copy link
Contributor

Tug commented Apr 22, 2019

Yes! let's 🚢 !!

@pinarol pinarol merged commit eacadbc into master Apr 23, 2019
@pinarol pinarol deleted the rnmobile/post-title-accessibility branch April 23, 2019 06:35
daniloercoli added a commit that referenced this pull request Apr 23, 2019
…rnmobile/887-History-stack-is-not-empty-on-a-fresh-start-of-the-editor

* 'master' of https://github.com/WordPress/gutenberg:
  'string' misspelled as 'srting' (#15118)
  [Mobile] Improving accessibility on Post title (#15106)
  Fix 13776: Format is already registered to handle class name (#15072)
  Add wpDataSelect WordPress end 2 end test util (#15052)
  Block Editor: move selection state from RichText to the store (#14640)
  chore: Fix: Lint error that makes unit tests (and CI tests) fail. (#15073)
  Set ownProps.onFocus when context.onFocus is undefined. (#15069)
hypest pushed a commit that referenced this pull request May 2, 2019
* Add accessibilityLabel to post title

* Update accessibilityLabel

* Update accessibilityLabel

* Remove unnecessary line

* Import sprintf from i18n
@youknowriad youknowriad added this to the 5.6 (Gutenberg) milestone May 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Screen Reader support for Post Title.
4 participants