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

Add accessibility actions for jumping between level 1 comments #1053

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

codeofdusk
Copy link
Contributor

@codeofdusk codeofdusk commented Mar 26, 2023

This PR adds actions for jumping among level 1 comments, using the existing previousButton/nextButton logic. While it isn't quite my vision (collapsing the nearest l1), this will significantly ease navigation when it works properly.

While this does jump among l1s, focus is set extremely unreliably. @QuantumBadger might you be able to look into why?

Closes #964.

@codeofdusk codeofdusk marked this pull request as ready for review March 26, 2023 22:47
@codeofdusk
Copy link
Contributor Author

CC @QuantumBadger.

@QuantumBadger
Copy link
Owner

Thank you @codeofdusk! I'll review this soon and will look into the focus issue.

@QuantumBadger
Copy link
Owner

QuantumBadger commented Apr 8, 2023

@codeofdusk After spending a while investigating this, I've put in a hack which explicitly sets the accessibility focus to the jumped-to element, after a delay of 500ms to allow the RecyclerView to re-layout.

Please let me know if this works for you!

@codeofdusk
Copy link
Contributor Author

@QuantumBadger This does improve reliability, though not perfectly. Also, we're now getting #1023 type behaviour when invoking the actions – I find the other accessibility subtitle style more readable. That said, I imagine the new subtitle might be better for Braille users as it's more compact.

@codeofdusk
Copy link
Contributor Author

@QuantumBadger Any more thoughts on what to do here?

@QuantumBadger
Copy link
Owner

Thanks @codeofdusk, don't worry I haven't forgotten about this :) I'll be looking at normal development tasks again once #1059 is resolved, as it is an existential threat to RedReader and will probably need some significant dev effort to work around unless Reddit change their minds. I'm also moving house next week which is taking up most of my time at the moment.

By #1023-type behaviour, I take it you mean that the accessibility subtitle doesn't get read out, but rather the visible text gets read out instead?

@codeofdusk
Copy link
Contributor Author

@QuantumBadger Glad to see that RedReader survives (at least for now)!

By #1023-style behaviour, I mean that TalkBack says things like "pts" instead of "up votes" or "up" and reads things in a more abbreviated style. That style works well for Braille (it's compact) but the normal accessibility subtitle works better for speech.

@codeofdusk
Copy link
Contributor Author

One possibility (suggested to me by @Simon818) is that we mark all l1 comments as headings, so TalkBack's previous/next heading commands can move among them. Not sure how feasible this'd be, but I'd be okay with that solution.

@QuantumBadger
Copy link
Owner

Thanks @codeofdusk, yes I'm glad the app's been given a stay of execution, in no small part thanks to the accessibility work! The "L1 comments as headings" idea seems like it might work, it looks like we can use the setAccessibilityHeading() method on the top-level comment views.

@codeofdusk
Copy link
Contributor Author

The "L1 comments as headings" idea seems like it might work, it looks like we can use the setAccessibilityHeading() method on the top-level comment views.

It's been a while since I've looked at the app. Want to take this one, or should I? If the latter, is there an easy way to determine whether a comment is an l1?

@QuantumBadger
Copy link
Owner

Happy to take a look at this myself in a moment! I should be able to use the indent level inside RedditCommentView for detecting L1 comments.

@QuantumBadger
Copy link
Owner

Hmm, looks like it's more complicated than that unfortunately. Since the RecyclerView lazily generates the View instances, the view for the next "heading" doesn't exist yet, so there's nothing to jump to.

When I get a chance I'll take another look at the original PR and try to fix the remaining reliability issues.

@codeofdusk
Copy link
Contributor Author

@QuantumBadger Any updates on this?

@QuantumBadger
Copy link
Owner

@codeofdusk No, I haven't had time to look into this further unfortunately. I'm still planning to take one more look to see if I can fix the original PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add TalkBack accessibility actions
2 participants