New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow plugins to customise note list items #5389
Comments
I came here from this thread: https://discourse.joplinapp.org/t/include-some-of-note-body-in-note-list/3874/39 Having a small preview of the note will be an amazing feature! |
YES! I would love thumbnails on notes. |
+1 for preview of note !! |
Another case we'd like to support with the note list update: https://discourse.joplinapp.org/t/is-joplin-a-good-alternative-for-teams-wiki/30489/3?u=laurent |
I would like a plugin that could display additional info in columns in the note list, eg. : modification date, location, number of edits, ... |
I'm happy either way. Stay with the same system, or implement a new system. I doubt I'd use a display of cards (I didn't when I used Evernote), but maybe a list with snippets and tags would be useful. |
The goal of this feature is to allow plugins to customise the note list and in particular the way each note is rendered. Then for example this kind of features could be done as plugins:
As part of this feature, it should also be set the note list flow:
All that should be done in a backward compatible way, so that the note list by default still looks like it does now.
Implementation
The app would still be responsible for displaying the note list and its items. This is necessary because it needs to be optimised so that only the visible notes are being rendered. That allows having thousands of notes inside a notebooks without any slow down.
The part that will be customisable is the the note list item. Currently it is shows the note title and, optionally, a checkbox on the left:
For maximum flexibility, the API should let plugins define the note list items as HTML. This could be done like so:
Interaction
Allowing the plugin to listen to mouse clicks or keyboard events on the items might be a bit tricky, due to the process boundaries between plugin and app. Perhaps it will require a custom solution - for example, the app could listen to event, then call an event handler on the plugin when something has been clicked.
Plugin conflicts
The above solution would allow only one plugin at a time to modify the note list items. It's not ideal but it's not clear how it could be done otherwise.
Example 1
Example 2
This other version uses a different approach which may offer better performances:
onRenderNote
method returns the values for the template placeholders.The advantage is that we no longer have a method to render the whole, but only each individual items. The inconvenient is that when the list is created we have to call
onRenderNote
multiple times, which may be slow over IPC. Should investigate if it can be called multiple times plugin-side, then the complete result (all the rendered items) is sent back to the host in one call. If that can be done, this approach should be better.Suggested features
Examples of features that we'd like to support. We should check if they can be implemented with the plugin API we provide.
Other ideas
Render list item content via filters
<div class="title">Note title</div>
, then plugin 1 change this by adding the date below:<div class="title">Note title</div><div class="date">21/08/21</div>
, then another plugin removes the title tag and replace it by a thumbnail<div class="title"><img src="..."/></div><div class="date">21/08/21</div>
, etc.Plugin defines a view instead of a renderer
Perhaps plugins could define a view instead of a renderer, then it's up to the user what view they choose. The chosen view will be fully responsible for rendering the note list content, and so no conflicts are possible.
The text was updated successfully, but these errors were encountered: