Plugin: Note Tabs

I consider this risk to be very low. But I would rather not give a guarantee... not that I'll be sued. :sweat_smile:

Some technical background:
There is only one place in the plugin that writes the data from notes. Everywhere else it only reads the data (e.g. title, id, is_todo, ...). The place it's about is when you check to-dos directly in tabs. If this is not used, or the checkboxes in the tabs are disabled, I don't see any risk.

The settings of the plugin are of course also written to the database. However, in the extra "Settings" table and for this I use the provided API. Whether this API can corrupt the SQL database, I can not say and is also not in my hands. But I think also here the risk is very low, because this API has been tested extensively.

3 Likes

Hm...

I could add an additional command like "Open in new (pinned) tab" to the note list context menu. This command you can assign keyboard shortcuts then. But honestly I have no idea if it is possible to assign mouse buttons also.
Maybe someone else here knows if this would be possible. I would also be very interested in this, because I would like to assign the history forward and backward commands to mouse buttons.

Regarding your second request... I'm not sure if this is possible. I will check if it is possible to overwrite the click events for the rendered markdown view.

1 Like

Thanks, I appreciate you taking the time to explain - that in itself gives me confidence in your plugin.

1 Like

I was wondering if it would be possible to have a setting to automatically move to the next tab (if there is one) when a note is unpinned.

My use case is that I have mapped command-W to "unpin tab" to make it more like a browser window. In the current implementation, while the tab is unpinned, I still have to select the next one (which i can do with another keyboard shortcut).

Also this flow highlighted a different issue – when I unpin a note, the unpinned note (in italics) stays, even when I switch to a different note.

Here's repo steps:

  • While looking at Note A, 1. unpin note 2.switch to left tab.
  • Now I am looking at Note B, and Note A has moved itself to the far right of the tabs, and is italic, but to actually get it to leave the tab bar I have to hover and click pin then x appears.
  • This appears to only affect the most recently unpinned item. If I unpin Note B, Note A disappears as was originally expected, and now Note B has this issue.

I have also noticed the issue that @uxamanda points out, or something very similar.

I am not sure that it is a bug. I think it is more to do with user expectations.

If I have zero pinned tabs and open a note it will open a tab. If I open a second note it will replace the original note. I will still see just one tab. If I pin that tab and then open another note that note will open in a second tab. If I open a third note it will replace the second note in the unpinned tab. So far so good.

If I now click on the pinned tab it gains focus but the unpinned tab still remains there. I think the question at this point is: should it stay or should it go? As @uxamanda says I can make it disappear manually but by default it remains.

I am not sure if there is a right answer to this but I do know that for some reason I expected the unpinned tab to disappear :slight_smile:

By the way the plugin is 100% fantastic. This is by way of possibly useful UX discussion with no criticism intended.

That sounds like a useful extension. I will add it to the plugin. I could imagine an enum choose different behaviors: KEEP_SELECTED, SELECT_LAST_ACTIVE, SELECT_ADJACENT (left or right, depending which exists). That would then also affect the following behavior.

It's not a bug, it's a feature. :wink:

A few details about the implemented behavior... I basically adopted this from the VS Code Editor, as I like it a lot and it seemed best for me. With the difference that the plugin only knows the states temporary and pinned. VS Code has a third open. Whereas pinned in the plugin rather corresponds to the state open of VS Code.

  • When I open a note, it is first added as a temporary tab (the italic one).
    • It will only be pinned if edited or by user request.
  • There can be at most one temporary tab.
  • The last opened temporary note is saved. So it keeps open.

This currently causes that when the selected note is unpinned, it stays there as a temporary tab and overwrites the other temporary one.

But I'm just seeing that the behavior here is slightly different from the VS code. It selects the last edited one when closing the active and open tab. This would correspond to SELECT_LAST_ACTIVE with the new setting from above.

Would this be a solution for you?

Does the temporary tab really bother you or is it more of an inconvenience? As described in my last post, this is an expected behavior. Basically, the temporary tab represents the most recently viewed note.

In fact, we could start an endless discussion about how the tabs should behave. :wink:
Personally, I wouldn't like it if the temporary tab constantly disappeared and reappeared after selecting another note. However, I see the whole also rather from a software developer's point of view. Perhaps the users think quite differently about it.

If more users expect another behavior, I could add an option like "Do not remember last temporary tab".

As it is, the plugin is very convenient to keep a few notes always visible, and I like this feature. (I have 2 notes that I use all the time and having them permanently in front of me is a time saver)

What I would like is to have... as many tabs as I want :slight_smile:

Not only pinned tabs but also 5, 10, 20 other tabs without the need to pin them all to make them accessible faster.

In fact I was expecting, more or less, the same behavior as in a browser. In Firefox, I keep a lot of tabs open when I work on a project, I switch between them, pin some of them, close others, open new tabs, etc.

But I guess this is not what you had in mind whan you created this plugin :slight_smile:

A thought more about this, based on the "feature not a bug" report :slight_smile: I realized I actually like the "keep my last note around as a temp temp" tab feature so that I can open a tab, then switch to a pinned tab and back without having to remember to pin the other. This worked so well I didn't realize I was using it like this. I think the friction I was noticing is that unpinning a tab puts into the "temporary" state. In my mind I am "closing" that tab when I unpin it, and then I notice its "ghost" is still there. I think if you removed a tab completely when unpinned (or made it an option), that would solve it for me, but I understand if that is not your desire.

As for the:

This would be a great improvement, and would make the "ghost" tabs less of an issue.

Thanks for all your hard work!

I have found the new feature of "Automatically pin notes when edited" has solved this use case for me, especially now that I have mapped Command-W to close the tab. Just wanted to point it out in case you haven't seen that. Still doesnt fix the open but not edit, but I now find myself just adding a return when I want to "pin" a tab.

How do you do that ? I see nothing in Options > keyboards shortcuts related to this command.
And thanks for the tip !

Sorry should have been more specific, I have Tabs: Unpin note mapped to Command-W. That command is in use by default to close the Joplin window, so I had to clear it from that shortcut first.

If you don't see any Tabs related shortcuts, you can see this discussion for how to enable Plugin: Note Tabs - #37 by uxamanda

In fact, this should only "happen" when you unpin the currently selected note. Inactive tabs are always removed completely. The behavior comes from the current implementation that when you unpin a note, it remains selected. Therefore, the note immediately reappears as a temporary tab.

However, the more I think about the SELECT_LAST_ACTIVE option, the better I like it. You are right of course that when you unpin a note you have usually finished it and want to move on to the next one. So keeping the old one doesn't make that much sense. Besides, you can still restore the old tab using the history back command.

I will schedule the feature for the next release.

Thanks for sharing your ideas.

1 Like

BTW: You can also pin tabs by double-clicking on it :wink:

1 Like

You're right, it seems that the tabsUnpinNote command is not shown in the keyboard shortcuts editor. That's really strange. Maybe there's still issue in the App because I don't know what's the difference between this command and the other ones of the plugin.

image

For now you should be able to set the shortcuts directly in keymap-desktop.json as @uxamanda posted.

Would the planned command from Plugin: Note Tabs - #70 by benji300 be an option for you? With this you can open multiple selected notes directly as pinned tabs.

Great! I appreciate it.

Now I have thought about it and used it more, it is not even an inconvenience. :grinning:

I agree with you: its a philosophical discussion about expected behaviour, at best!

Having spent much of yesterday in Joplin using tabs, I now agree with @uxamanda. I like the ”pinned tabs + 1” arrangement, and I think it is better than having a tab keep opening and closing pointlessly.

If anyone asks, its definitely a feature not a bug!

I have even less options than that :slight_smile:

20210109_100218

Windows 10, Joplin 1.6.5 (prod, win32)

Yes ! And the trick mentionned by uxamanda can be also useful, I'll look into keymaps-desktop.json.