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

Improve accessibility of more options button and notification cell #119

Merged
merged 13 commits into from Jul 19, 2017

Conversation

@BasThomas
Copy link
Collaborator

@BasThomas BasThomas commented Jul 12, 2017

Ref #118

This PR:

  • Makes the More Options button in the issue overview say "More Options" instead of "bullets-hollow"
  • Makes the notification cell accessible as a whole, as well as mentioning its type (issue, pr or commit)
BasThomas and others added 7 commits Jul 11, 2017
…abels

This makes the cell an accessibility element (eg. Review GitHub Access under Settings) and mention that A: the cell is a button and B: its label is "Review GitHub Access"

Before this change, the label was an element and did not mention it was also a button
@BasThomas BasThomas mentioned this pull request Jul 12, 2017
29 tasks
@@ -98,6 +100,10 @@ final class NotificationCell: SwipeSelectableCell {
textLabel.attributedText = viewModel.title.attributedText
dateLabel.setText(date: viewModel.date)
reasonImageView.image = viewModel.type.icon?.withRenderingMode(.alwaysTemplate)
accessibilityLabel = contentView.subviews
.flatMap { $0.accessibilityLabel }
.reduce("", { $0 + ".\n" + $1 })
Copy link
Collaborator Author

@BasThomas BasThomas Jul 12, 2017

the ./n-s makes VoiceOver read these as sentences instead of just one, long sentence, making the different labels / elements separated.

Copy link
Member

@rnystrom rnystrom Jul 12, 2017

Same note about moving this to override?

Copy link
Member

@rnystrom rnystrom Jul 14, 2017

What about this one?

Copy link
Collaborator Author

@BasThomas BasThomas Jul 15, 2017

See the comment on the other one:

That would be a little restricting though - we can't access the viewModel in the NotificationCell, which I used to provide the type (Issue / PR / commit).

@@ -47,6 +57,9 @@ class SelectableCell: UICollectionViewCell {

override func layoutSubviews() {
super.layoutSubviews()
accessibilityLabel = contentView.subviews
.flatMap { $0.accessibilityLabel }
.reduce("", { "\($0 ?? "").\n\($1)" })
Copy link
Member

@rnystrom rnystrom Jul 12, 2017

Mind moving this to an override of accessibilityLabel? Then it only executes when necessary instead of every layout pass.

Copy link
Collaborator Author

@BasThomas BasThomas Jul 12, 2017

That would be a little restricting though - we can't access the viewModel in the NotificationCell, which I used to provide the type (Issue / PR / commit).

@@ -98,6 +100,10 @@ final class NotificationCell: SwipeSelectableCell {
textLabel.attributedText = viewModel.title.attributedText
dateLabel.setText(date: viewModel.date)
reasonImageView.image = viewModel.type.icon?.withRenderingMode(.alwaysTemplate)
accessibilityLabel = contentView.subviews
.flatMap { $0.accessibilityLabel }
.reduce("", { $0 + ".\n" + $1 })
Copy link
Member

@rnystrom rnystrom Jul 12, 2017

Same note about moving this to override?

@rnystrom
Copy link
Member

@rnystrom rnystrom commented Jul 12, 2017

SO GOOD, I love it

@rnystrom rnystrom merged commit 6859fdb into master Jul 19, 2017
rnystrom added a commit that referenced this issue Jul 19, 2017
@BasThomas BasThomas deleted the improve-accessibility branch Jul 24, 2017
@BasThomas BasThomas changed the title Improve accessibility Improve accessibility of more options button and notification cell Oct 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants