dginev / ar5iv

A web service offering HTML5 articles from arXiv.org as converted with latexml
https://ar5iv.org
MIT License
795 stars 20 forks source link

Possibility of having shortcuts for some functionalities #25

Open p16i opened 2 years ago

p16i commented 2 years ago

Hi,

Thank you for developing the website. I really like it.

I wonder whether we could also have shortcuts from some functionalities, especially when the toolbar is at the bottom below. For example, having shortcuts for Feeling Lucky? and Report an Issue could fasten the process of testing and reporting issues.

Below is a JS snippet that I've written to add a shortcut for the Feeling Lucky? feature

// Shortcut `shift+r` for `ar5iv.org`'s `Feeling lucky?` functionality 
document.onkeydown = function(ev) {
    ev = window.event||ev;
    if (ev.keyCode == 82 && ev.shiftKey) {
      window.location  = "/feeling_lucky"
    }
}
dginev commented 2 years ago

Well, the problem is predictability - can we find what the least surprising keys would be for "Feeling lucky?" and "Report"?

At first I was even thinking of binding the left and right arrow to go to the previous/next article - but most arXiv authors wouldn't expect that, and they may instead want to horizontally scroll through e.g. a very wide table. So I dropped all thoughts of shortcuts.

Maybe something fun and exotic also works for feeling lucky - ctrl + ? where the question mark stands for "take me anywhere"

Something to think about... Thanks for joining in!

p16i commented 2 years ago

Well, the problem is predictability - can we find what the least surprising keys would be for "Feeling lucky?" and "Report"?

imho, it is probably quite challenging to find a common set of shotcuts; however, given the site is quite new, we might just pick a set of these shotcuts and educate the user somehow, e.g., using brackets image.

For example, if one does leading-key + F, one activates the Feeling Lucky? functionality. The tricky part is which leading key to be used. Generally, I would try to avoid ctrl and alt because they are commonly used for the functionalities of OS and browsers. What do you think?

dginev commented 2 years ago

Right, well, I am still looking at what other platforms have done, which is what I'd like to stay close to if I'm to claim I tried to be "predictable".

For the previous/next buttons, I remembered that the youtube shortcuts bind Shift+P and Shift+N. This kind of convinces me using Shift is fine.

I still like the idea of Shift+? for the random "feeling lucky" navigation.

The conversion report really shouldn't need a shortcut, but maybe Shift+R for reporting an issue is sensible, as is Shift+X to go to the main arXiv page.

Also a Shift+C may be nice to toggle the color theme, would get quite handy if we get more than two -- then one can iterate through them.

I wouldn't mark that in the letters of the footer buttons, since it gets a bit harsh on the eyes. It may be better to pop-up a little modal legend with all possible shortcuts when shift is pressed and held?

p16i commented 2 years ago

I wouldn't mark that in the letters of the footer buttons, since it gets a bit harsh on the eyes. It may be better to pop-up a little modal legend with all possible shortcuts when shift is pressed and held?

I agree. I like the idea of the modal. Github has it, and you can use ? to activate the panel.

dginev commented 2 years ago

Github has it, and you can use ? to activate the panel.

Ha! It looks familiar, so I must have seen it before, but had totally forgotten github has such a handy modal. Yes, basically exactly that 🚀