Home    |    GitHub Page    |    API    |    FAQ

Plugin: Note Tabs

Here's my first plugin I wrote. It shall allow you to "open" multiple notes at a time in tabs.
I hope it will help to improve your daily work with Joplin.

Basic features

  • Display selected note as tab
    • Remember last opened and unpinned note
  • Pin/Unpin selected note to/from the tabs
  • Change position of pinned tabs
  • Toggle to-do state from tab
    • Automatically unpin completed to-dos (configurable)
  • Configurable style attributes
  • Support horizontal and vertical layout

If you have any additional feature requests, please let me know. I will do my best to maintain and improve the plugin.

Screenshots

Repository

You can find a compiled version (com.benj300.joplin.tabs.jpl) of the plugin in the latest release.

Disclaimer

:construction: BETA - This is a development version at an early stage. Please make a backup copy of the user data (especially from the database) before using this plugin. I don't think that the plugin causes any damage to the database, but unfortunately I can't rule it out completely. I neither have the time nor the possibilities to test all possible use cases.

35 Likes

Great, thanks!

I can't find how to change layout to horizontal. Plugin settings look like this

Hi @danil-tolkachev,

thanks for your feedback.

The layout changes automatically when you decrease the panel width. Currently it switches at about 400px width from horizontal to vertical.

Oh, it doesn't work well on my Linux Mint 19.3

Sorry for that question, but have you tried to decrease the size of the right most panel a bit more? Could you try to drag the splitter (between content and tabs panel) to right window size?

Here are some tests.

Okay what I can see is what I expect it should do. If you decrease the width of the panel the layout of the tabs is changed.
Width > 400px => all tabs are displayed inline with the specified min and max-width
Width < 400px => all tabs are displyed in single rows and expanded to the full-width of the panel

Am I right that your expactation would rather be to use the vertical layout always indepent from the panel's width?

I just want this layout like yours :wink:

How can I configure it?

1 Like

Ah sorry... now I see. This description is currently missing... you're right.
I want to create a short screencast for that...

But for now do the following steps:

  • navigate to View > Change application layout
  • Use the arrow keys (the displayed ones, not keyboard keys) to move the panel at the desired position
  • Press ESC to save the layout and return to normal mode
  • Move the splitter (between content and tabs panel) up to reach the desired height of the panel
2 Likes

Thanks for clarification. I haven't seen View > Change application layout before.

Don't you think that check box Horizontal layout in the plugin settings would be more intuitive? Is it possible with current Joplin Plugin API?

wow, well done, I didn't even know if was possible to do this with the current plugin system.

1 Like

I'm not quite sure, because it would only control the behavior (layout) inside the panel itself.
But it is currently not possible to change the position of a panel programmatically via the plugin API.

But if it helps you to "force" the layout of the panel with a setting, I could create a feature request.

Here's a short screencast of the basic usage:

1 Like

But if it helps you to "force" the layout of the panel with a setting, I could create a feature request.

I think it would be more convenience way to change layout. But we can wait what another users think.

Maybe some API could be provided to allow positioning relatively to one of the default components (sidebar, noteList, editor).

For example with a function like moveNear(componentName, direction). So in your case, you would call moveNear("editor", "top") to put it on top of the editor, or moveNear("editor", "right") to move it to the right of the editor as a sidebar. I think that would cover most cases, without having to expose the complex tree of components that makes up the layout.

Maybe a way to set a default size would be good too.

I've created a feature request. So you can upvote it :wink: Let's see what other users think...

Yes I think this would be a good idea to at least give the initial position of a panel.
That would help most users I think. If you want to you can still move the panel as you like.

The default height would be very helpful in this case also.
Maybe as an optional parameter of the function you proposed moveNear("editor", "top", 40).

Sorry for bothering you @laurent , but I found two more points in the plugin API that I would like to clarify.

  1. Would it be possible to add an additional event that is triggered each time any note property value is changed (e.g. joplin.workspace.onNotePropertyChange())? With this plugin I came across a little unpleasantness. If a to-do is set to complete in the list, there is no event triggered to update the panel. The user has to change the selected note to update the panel. See attached screencast. The plugin currently listens to the following events to update the panel:
		WORKSPACE.onNoteSelectionChange(() => {
			updateTabsPanel();
		});

		WORKSPACE.onNoteContentChange(() => {
			updateTabsPanel();
		});

		WORKSPACE.onSyncComplete(() => {
			updateTabsPanel();
		});
  1. Is it intended that when switching to an empty list, the selected note is kept? Currently I can determine this behavior with the plugin. The selected note remains highlighted when switching to an empty list. See also the screencast.

If I remember correctly onNoteContentChange is supposed to be triggered when any property change, so it might just be that this event is buggy and needs to be fixed.

  1. Is it intended that when switching to an empty list, the selected note is kept? Currently I can determine this behavior with the plugin. The selected note remains highlighted when switching to an empty list. See also the screencast.

Also a bug. State handling is one of the oldest part of Joplin and at time is a bit messy, but if there's no note in the list the selected note state should be cleared. I'll have a look.

Thanks for your quick response and checking.
But the topics are not the highest priority, I think there are more important things to do first.

1 Like