laurent22 / joplin

Joplin - the privacy-focused note taking app with sync capabilities for Windows, macOS, Linux, Android and iOS.
https://joplinapp.org
Other
45.12k stars 4.91k forks source link

Desktop: Command "moveToFolder" when bound to an accelerator only works when focus is on codemirror editor #6063

Open Daeraxa opened 2 years ago

Daeraxa commented 2 years ago

Environment

Joplin 2.7.7 (dev, linux) (post 2.7.8 release) - also 2.6.9 on Win10

Client ID: d08d5bc755c54181991b90586e53cd0d Sync Version: 3 Profile Version: 41 Keychain Supported: No

Revision: bb464d8a5 (dev)

Linux Mint 20.3 (Una) + Windows 10

Steps to reproduce

  1. Bind moveToFolder to an accelerator:
    {
    "command": "moveToFolder",
    "accelerator": "Ctrl+M"
    },
  2. Focus anywhere but the CM editor and press the configured accelerator - nothing happens
  3. Focus the CM editor and retry - moveToFolder command runs

Describe what you expected to happen

The command should be able to run using that accelerator from anywhere providing a note is displayed. For clarification, the only area it seems to run from is the CM editor itself, the view pane and richtext editor do not allow command to run. Command will run from any focused pane if run from the command palette. Tried with a number of different accelerators and tried other "note scoped" commands like note statistics and print PDF. The chosen accelerators do not seem to be the issue (tried Ctrl + M, and Ctrl + Alt + R as example) as they work when bound to showNoteContentProperties("Statistics...") and exportPDF

Logfile

No events are created in either log when attempting this

laurent22 commented 2 years ago

Hmm I think that's expected because the command in the not in the menu. It's only when it's there that it works globally. In this case it probably works in the editor because CodeMirror somehow loads the shortcuts independently, but the expectation is that it shouldn't work at all.

So I guess the "fix" would be to add the command to the menu, but should we? I don't really know actually.

Daeraxa commented 2 years ago

I think there are a couple of shortcuts which would make sense to work universally - moveToFolder and toggleEditors which I think are probably used more frequently than some of the commands that do have binding options (copyDevCommand, toggleSafeMode to name a couple).

If it is as simple as adding them as a menu item to make them work in a global context then perhaps it is worth either re-evaluating the list or even placing all items in the list then create function groupings or have the uncommon commands under an "advanced" dropdown section.

Having semi-available functionality just seems a little odd to keep around, either it should be allowed or prevented in which case any commands not available in the menu should be prevented from working at all via a manual method.

sebadrude commented 1 month ago

Aswering Laurents question: So I guess the "fix" would be to add the command to the menu, but should we?

Indeed, I believe you should. Please. Here are my reasons:

I am applying an implementation of the "getting things done" methodology. My workflow heavily depends on collecting notes in an INBOX, and regularly process these notes, tagging and then filing them into the correct notebook. Not being able to do that with a shortcut (on my Linux Mint system, the shortcut does not even always work in the editor window) nor even from the menu is slowing me down considerably.

I cannot believe that no other users find this a very serious limitation -- does everybody create their notes already in the final notebook where the note lives forever, without any need to regularly move notes from one place to another? This would be one of the first keyboard shortcuts that I would have expected to be working, but even after two years, nothing seems to have happened on this front.

By the way, relevant for the same workflow, after processing (in particular, moving or deleting) a note from the note list, regularly, the focus is not in the note list panel any more, but has to be brought back there with Ctrl+Shft+l.

And finally, I believe it would be good if the default keyboard shortcuts would be indicated on a page below https://joplinapp.org/help/, and not somewhere on a discourse thread (https://discourse.joplinapp.org/t/shortcuts-overview/).