sindresorhus/refined-github

Add a keyboard shortcut to select all notifications #3876

mwz posted onGitHub

I think that a keyboard shortcut to select all visible notifications on https://github.com/notifications would be a good addition to this project.

There are already built-in keyboard shortcuts to make selected notifications as read (shift+i) and done (e), but there isn't one to select all notifications. I think it's a fairly common workflow for people to open the notification centre, scroll through and open some notifications in new tabs and then select all and mark as done. It's a bit annoying that one has to click on the checkbox (see below) to select all instead of being able to do that just via a keyboard shortcut.

Screenshot 2021-01-09 at 23 48 28

I'd definitely prefer to type a (to select all) followed by e to mark all as done once I get to the bottom of the list rather having to scroll back up and click on the checkbox. GitHub doesn't seem to be keen on adding this shortcut, which seems to me like a small but a nice improvement to one's daily workflow.

Is it something that others would also find useful and would a contribution for this feature be welcomed?


Sounds good.

It's as easy as setting an attribute, but if you mark as done the "Select all" checkbox is removed. Maybe this takes care of that

import onElementRemoval from '....../on-element-removal.ts'

function init() {
    const checkbox = select('.js-notifications-mark-all-prompt');
    if (!checkbox) {
        return false;
    }

    checkbox.dataset.hotkey = 'a';
    onElementRemoval(checkbox).then(init);
}
posted by fregante about 4 years ago

Fund this Issue

$0.00
Funded

Pull requests