Skip to content

Make commit reordering keyboard accessible#17671

Merged
sergiou87 merged 36 commits intodevelopmentfrom
reorder-with-keyboard
Nov 16, 2023
Merged

Make commit reordering keyboard accessible#17671
sergiou87 merged 36 commits intodevelopmentfrom
reorder-with-keyboard

Conversation

@sergiou87
Copy link
Member

@sergiou87 sergiou87 commented Nov 3, 2023

xref. https://github.com/github/accessibility-audits/issues/5715

Description

This PR makes changes to our flat lists to support reordering commits using the keyboard. Now users can reorder a commit by right-click on the commits they want to move in the history, and then clicking on Reorder commits in the context menu presented.

After that, the list will enter in a "keyboard insertion mode" where they can use the up and down arrow keys to decide where the commits will be moved to, and then press Enter to confirm the operation (or Escape to cancel it). Alternatively, while in this mode users can also use their mouse to click on the position where they want their commits. The ability to use the mouse in this mode was removed because it felt too annoying, specially with screen readers.

Other improvements to implement in different PRs:

  • Consider adding shortcuts to reorder/squash/cherry-pick context menu actions.
  • Improve accessibility label of commit rows.

Screenshots

CleanShot.2023-11-07.at.13.17.49.mp4
CleanShot.2023-11-07.at.13.20.02.mp4

Release notes

Notes: [Improved] Reordering commits is now keyboard accessible

It was too annoying specially with screen readers 😞
For some reason, NVDA doesn't like "optional rendering" for this element, otherwise it doesn't read the message when the element is added
@sergiou87 sergiou87 marked this pull request as ready for review November 7, 2023 12:26
niik
niik previously requested changes Nov 8, 2023
Copy link
Member

@niik niik left a comment

Choose a reason for hiding this comment

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

Gave this a quick first look. I'll take another look tomorrow but here are some mostly nitpicky requests for changes. Overall I'm pumped about this!

tidy-dev
tidy-dev previously approved these changes Nov 9, 2023
Copy link
Contributor

@tidy-dev tidy-dev left a comment

Choose a reason for hiding this comment

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

I tested it on macOS and Windows with and without screen readers. It works so seamlessly. :)

I think your tooltip/popover idea for showing visual instructions to our non screenreader and particularly mouse users would be a great iteration to add in another PR. :)

I was thinking maybe the tooltip/popover could also have a hint about drag/drop for our mouse users? That way we don't enable mouse placement in the keyboard mode and muddy the keyboard experience up for keyboard only/screen reader users.

I have thought about that for cherry-picking and squashing too.. Since drag and drop is so undiscoverable, it might be nice to have some sort of call out in the dialogs when it is invoked by the context menu. We have that sort of thing in the let's get started page for being able to drag repos onto the app.. tho we have much more real estate there for that.

sergiou87 and others added 5 commits November 10, 2023 09:13
Co-authored-by: Markus Olsson <j.markus.olsson@gmail.com>
Co-authored-by: Markus Olsson <j.markus.olsson@gmail.com>
Co-authored-by: Markus Olsson <j.markus.olsson@gmail.com>
Co-Authored-By: Markus Olsson <634063+niik@users.noreply.github.com>
@sergiou87 sergiou87 requested review from niik and tidy-dev November 10, 2023 08:24
@sergiou87
Copy link
Member Author

In the end I decided to add the tooltip/popover with the hint to this PR, I think it's a nice addition and it wasn't too hard to implement:

image

Copy link
Contributor

@tidy-dev tidy-dev left a comment

Choose a reason for hiding this comment

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

This works great! ✨ Thank you for all your hard work on this!

We have chatted in slack and team sync about iterating on the popover design to include keyboard shortcut visuals and that it needs to not be a role of dialog since it is not something to interact with/grab the users focus. When the final iteration is done, be good to run by accessibility design to make sure there isn't any other gotcha with this since I would call it custom ui - not an established pattern.

@sergiou87 sergiou87 dismissed niik’s stale review November 16, 2023 14:49

Just chatted with Markus and he's happy to merge this PR after having @tidy-dev's approval!

@sergiou87 sergiou87 merged commit 5200f1a into development Nov 16, 2023
@sergiou87 sergiou87 deleted the reorder-with-keyboard branch November 16, 2023 14:50
@b7r3333

This comment was marked as spam.

@akash07k
Copy link

akash07k commented Nov 21, 2023

@sergiou87 Thanks a lot for this.
I can say that this implementation will be extremely useful for keyboard and screen reader users.
Being a screen reader user myself, I'm looking forward to try this and I'll do a local build of the app today.
I always had a very hard time with reordering the commits and this PR will fix it for good.
Edit: Voila! I do not need to do a local build as the build is already up.
Thanks all for working on this.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants