Django Admin Save Shortcuts

Hello Django Community!

I’ve created a PR for the addition of keyboard save shortcuts on the django admin. I’ve created a PR, but it’s be suggested that I open some discussion here about the new feature.

The PR with a detailed technical description can be found here.

Some starters on these as suggested by @thibaudcolas :

  • Which actions should have shortcuts, based on frequency of use, availability in other similar tools.
  • What key combinations should be used. Based on consistency with other tools.
  • How we could make those shortcuts discoverable by end users (for example, in GitHub on macOS I can press Shift + ? to view a list)

Antidotally, I’ve had this feature in my stack for a while now and it’s been a really nice power user feature.

2 Likes

As far as discoverability, I like adding the Shift + ?. In addition, we could also show a hint on hover with the keyboard shortcut.

1 Like

@michaelschem if you’re able to please move this to the “Accessibility” category under Django Internals so this will be easier for people interested in Django product direction to spot.

My feeling is there’s no use in adding this unless it can really save everyone time and it’s easily discoervable.

So two things:

First, I think the better place to start here is the changelist page. We can use vim keys (j / k) to move up and down, x to mark rows for selection, and some other key to move focus to the actions select box. This speeds up a very common flow for everyone.

I’m not dead set on starting here, it just seems like the most interesting to me.

The thing we really need however is discoverability. A help overlay displayed using the ? key that tells the user which keys can be used. See GitHub or GMail for an example here.

I think without this, admin users (who are typically not always the people developing the site, so don’t read the docs or release notes) have no way to know what they can do. Ideally we’d have some kind of prompt that they can press ? to get the help screen in the first place.

Fwiw I just googled “django admin shortcuts” to find out if there was a shortcut for “Save” and ended up here. The proposed PR would help us even without a help overlay since we’re building an interface for power users.

1 Like

@danmichaelo some time ago I started working on something more full-featured. with the intent to merge it into core when it’s ready (current aim is 6.0 but we’re all volunteers here). You can find the repo at GitHub - knyghty/django-admin-keyboard-shortcuts - I would certainly welcome any contributions. Right now I’d especially welcome help on Add a shortcut to jump to any model instance · Issue #5 · knyghty/django-admin-keyboard-shortcuts · GitHub but any other open issue would also help immensely.

The benefit of this approach is that it’s relatively straightforward to people to add their own project-specific shortcuts, and while the focus is on accessibility for keyboard users, helping out power users is definitely one of the goals.

Not sure why this post got hidden as off topic when it’s exactly the topic - it is the only way a save shortcut is likely to be merged IMO.