cpbotha / nvpy

Simplenote syncing note-taking application, inspired by Notational Velocity and ResophNotes, but uglier and cross-platformerer.
Other
849 stars 114 forks source link

Change behavior of escape key #218

Closed george-thomas-hill closed 3 years ago

george-thomas-hill commented 3 years ago

A person's usual way of using nvPY is to type something in the search box, hit enter, and then edit the resulting note.

At the conclusion of that workflow, the user who hits escape expects to go back to the search box, but nvPY's current behavior is to send the focus to the notes list, where the user becomes trapped, because hitting escape there does nothing.

This pull request changes the behavior of the escape key so that hitting escape when editing a note sends the focus back to the search box.

Additionally, it makes it so that hitting escape when in the notes list also sends the focus back to the search box.

Also: I believe that a common way to use nvPY is to configure one's system so that hitting a hot key brings up nvPY, which allows a person to quickly add notes while working in other applications.

At the conclusion of doing so, when the user is in an empty search box, hitting escape is a natural way to make nvPY go away until needed again.

Therefore, this pull request also creates the "escape_to_exit" option, which can be configured in the .nvpy.cfg file.

It defaults to false, but when set to be true, it makes it so that hitting escape when in an empty search box exits the program.

I believe that all these changes help to keep nvPY even more in the original keyboard-driven and lightning-fast spirit of Notational Velocity.

Thank you for considering these changes.

yuuki0xff commented 3 years ago

nvPY already provides two shortcuts. Are you dissatisfied with using these shortcut keys?

Ctrl-F        Focus the search box
Ctrl-Q        Exit nvPY.

This merge request modify existing shortcut behavior. I would like to merge carefully to avoid confusion for nvPY users.

george-thomas-hill commented 3 years ago

I think that it's more natural and intuitive to hit the escape key, when done editing a note, than to hit Ctrl-F.

Users won't know about the Ctrl-F shortcut unless they read the bindings, but hitting escape comes naturally.

And it's easier to hit one key than to hit a key combination.

Also, something has to happen when the user hits escape while editing a note.

The only question is, what?

I think that it makes more sense for escape to bring the focus back to the search box than to bring the focus to the notes list; the user can type in the search box, but the user never wants to type in the notes list, and the user started in the search box, so escape should bring the user back to where the user started, not to a new location.

I also think it's good to have the option to use escape on an empty search box to quit the program.

Users who don't configure that option won't notice any difference, but users who do choose to configure that option will get a faster, easier way to quit the program.

I don't think that this merge request will create any confusion.

Instead, I think that it will reduce confusion, because it's confusing to hit escape when editing a note and end up in the notes list, since that's not where the user started out.

Thank you for responding so quickly to my submission!

yuuki0xff commented 3 years ago

Thanks for your reply. I understood your opinion.

I am accustomed to nvPY because I've been using nvPY for some years. So I won't mention what's natural. The only thing I can say for certain is that the shortcuts provided by the notes list work on the search box as well (exclude Ctrl-C). Changing the behavior of the escape key does not have a big problem.

This MR makes the "copy note title" feature inconvenient. I'll fix it and merge this MR.

george-thomas-hill commented 3 years ago

Thank you very much for approving this merge request.

This is my first successful submission of code to an open source project, so it's exciting for me to see this change go through!

And thank you for taking care of nvPY. It's a really great program.