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

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.
<View
style={ [ styles.titleContainer, borderStyle, { borderColor } ] }
accessible={ ! this.state.isSelected }
accessibilityLabel={ __( 'Post title' ) + '. ' + ( isEmpty( title ) ? __( 'Empty' ) : title ) }

This comment has been minimized.

Copy link
@Tug

Tug Apr 22, 2019

Contributor

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.

This comment has been minimized.

Copy link
@pinarol

pinarol Apr 22, 2019

Author Contributor

Updating this according to what we discussed

This comment has been minimized.

Copy link
@pinarol

pinarol Apr 22, 2019

Author Contributor

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

@Tug

This comment has been minimized.

Copy link
Contributor

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

left a comment

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

This comment has been minimized.

Copy link
Contributor Author

commented Apr 22, 2019

hey @Tug are you ok with the last changes?

@Tug

This comment has been minimized.

Copy link
Contributor

commented Apr 22, 2019

Yes! let's 🚢 !!

@pinarol pinarol merged commit eacadbc into master Apr 23, 2019
1 check passed
1 check passed
Travis CI - Pull Request Build Passed
Details
@pinarol pinarol deleted the rnmobile/post-title-accessibility branch Apr 23, 2019
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)
@pinarol pinarol referenced this pull request Apr 23, 2019
6 of 6 tasks complete
hypest added 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
sbardian added a commit to sbardian/gutenberg that referenced this pull request Jul 29, 2019
* Add accessibilityLabel to post title

* Update accessibilityLabel

* Update accessibilityLabel

* Remove unnecessary line

* Import sprintf from i18n
dd32 pushed a commit to dd32/gutenberg that referenced this pull request Sep 27, 2019
* Add accessibilityLabel to post title

* Update accessibilityLabel

* Update accessibilityLabel

* Remove unnecessary line

* Import sprintf from i18n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.