benji300 / joplin-note-tabs

Allows to open several notes at once in tabs and pin them.
MIT License
251 stars 16 forks source link

Context menu for tab #13

Open danil-tolkachev opened 3 years ago

danil-tolkachev commented 3 years ago

It would be great if the context menu showed by right click on tab.

image

benji300 commented 3 years ago

This is an interesting idea. Unfortunately, it is probably not technically feasible at the moment. There are essentially two problems.

  1. I can't reuse the note list context menu. That means I would have to implement it by myself. I would even have to reimplement some of the functionalities, because they are not available as commands. That would be quite a lot of work.

  2. The second problem (the bigger one) is that the context menu is locked within the panel. That means it cannot be displayed outside the boundaries of the panel. I've also tested with "z-index" in the CSS. The following screenshots show what I mean. The menu just disappears "under" the editor.

image

image

The code can be found in test branch: https://github.com/benji300/joplin-note-tabs/tree/context-menu

ajay-gh commented 3 years ago

In order to use space in the Joplin window efficiently, it seem important to me to turn tabs visibility on and off in the course of using Joplin. Right now this requires three precision point-and-click s with the mouse (in the tools menu). I would really appreciate a keyboard shortcut, and if this was not possible, that the toggle visibility switch was move up to the main tools menu.

benji300 commented 3 years ago

I don't know what this has to do with the context menu but well...

You can assign a keyboard shortcut to the tabsToggleVisibility command. You can do that easily in the keyboard shortcuts editor. If the command is not listed, please ask the developer, why still not all plugin commands are listed. As a workaround you can also define the keyboard shortcut directly in keymap-desktop.json. How to do this has already been described in the forum.

The second possibility would be to call the command via the command palette. This way you could execute the command without interaction with the mouse.

ajay-gh commented 3 years ago

Thanks for the hints. I simply didn't realize how easy it was to add command/shortcuts not (yet) listed in the Joplin shortcuts editor.