Pre-release 1.3 with plugin support is now available! (Updated 31/10/20)

When you right-click on a notebook? It's called "New notebook" and at least for me it's still there and works. I'll double check on macOS in case there's something wrong on that platform.

No I can't replicate even on macOS. Could you provide your keymap.json file in case the bug happens only with certain configs?

Nope, in the menu.File -> New sub-notebook. The item is gone. I wanted to assign a keyboard shortcut to it, since I create sub-notebooks much more often than a notebook.

There's no keymap-desktop.json (nor a keymap.json) file in my profile.

Do I understand correctly that I can now assign individual shortcuts to each command? If so, it seems that it not works for all commands. At least for "editAlarm" and "textCheckbox" it does not work for me. Whereby "newFolder" worked as expected.

Would it be possible to display the assigned shortcuts in the command palette? Like Visual Studio Code does? Then you would know if it worked or not.

1 Like

Hello @Laurent,

I have some feature requests for the plugin API.
Sorry for bothering you with this long list... but I have been thinking about possible plugins in the last days and stumbled over these points.
Maybe some of the points will make it into the API. I would be glad...

  1. Would it be possible to add a joplin.workspace.onNoteTitleChange event?

  2. Could you allow to add additional panels to the right of the editor?

    • I would like to show the TOC plugin on the right instead of in the middle
  3. Could you allow to add buttons after the "breadcrumbs" ("In: Notebook") button?

    • In joplin.views.toolbarButtons
    • The toolbar then should always be visible when a plugin adds a button
    • This could also be very useful for some plugins (e.g. to display a full breadcrumbs, the default one colud be disabled via css then)
  4. Could you allow you to add panels (sections) to the note list?

    • Preferably before... I mean after .rli-noteListControls and before .rli-noteList
    • So it should be possible to create a "Pin to top" plugin (see Inkdrop)
    • Or split the list into several sections (see Todoist)
  5. Is it possible to retrieve the current "Editor Layout" (Editor/Viewer/Split View) in a plugin and/or set it explicitly?

    • I want to implement a kind of "Persistent Layout" plugin, which allows to select the editor layout for each note separately.
    • For example, a note that usually is not changed any more should always be displayed in viewer mode.
  6. Is it possible to get and set the current position of the selected note in the note-list?

    • I want to implement a plugin to change the order of the notes (if custom order is selected) via commands. So I don't need to drag&drop them.
    • Then it should also be possible to set keyboard shortcuts to this commands (e.g. Move up = "Ctrl+Up Arrow"; Move to top = "Ctrl+Shift+Up Arrow")

No, it must be added to the code first, which I would have.

joplin.workspace.onNoteContentChange should already give you this as it is triggered when the note title (or any other note field) changes.

Regarding the layout questions, the plan is indeed to make it more configurable. I've implemented the underlying component so that it's possible to add arbitrary panels anywhere and resizing them, but it's not exposed to the plugin API yet.

The question is, how to provide an API that's flexible enough so that panels can be added anywhere. If you have any suggestion on how it should be feel free to let me know.

Indeed it was lost in the refactoring as well. It will be back in the next pre-release.

I've managed to replicate it and that will also be in the next version.

2 Likes

A while back I asked a few questions regarding shortcuts:

I think the first question might have been answered already because I saw Print in the editor, but no shortcut was assigned to it.

When I click on a HTML note and then on a markdown note, the background of the markdown note is off.

It also seems that some elements in the HTML note are changed by the userstyle.css.

Here are the 2notes.jex (156.5 KB) that showed that benhavior. (Use the Dark theme, otherwise you won't see the background issue.)

Update: this does not happen all the time, and sometimes only part of the markdown note is rendered differently (e.g. background is ok, but code blocks look different). I haven't been able to determine what triggers that problem.

I've managed to replicate it and that will also be in the next version.

What are you trying to say. You fixed it and created a PR?

I think he might be a bot since his posts make no sense.

Okay... thanks for your answer.

Sorry my bad... I should have read the spec better.

Regarding the panels layout...
What about a "dynamic" layout where users can drag&drop the panels to any location they want? Like most of the IDEs provide (e.g. Eclipse, Visual Studio, Visual Studio Code).
In this case it doesn't matter where a panel is created by default. One API to create a panel would be enough for the plugins.
But then Joplin needs to save the panels layout. Also for the plugins. I'm not sure if you want this.

Another question would be: Shall it be possible to "overlay" panels then? To have a "tabbed" view of panels like VS Code does for opened editors.

Here's a screenshot of what I am trying to say:

  • Green: The area where the panels can be moved
  • Orange: Here panels can be dragged to
    • Basically you can create new columns, lines and also cells within a column or line
  • This also includes that the note list and editor should be handled like all other panels
    • In the screenshot the global search is handled as an own panel (just an idea...)

I totally agree that this would be a huge change for Joplin and might not match with your intention for a simple note taking app. But that's the only idea I have for a generic panel API.

1.3.10 is now available!

  • New: Api: Added service to access resource external editing
  • New: Plugins: Add the openNote, openFolder and openTag commands
  • Fixed: Regression: Keyboard shortcut would not save in some cases
  • Fixed: Regression: Restore "New sub-notebook" command
  • Fixed: Command Palette click did not work
  • Fixed: Fix slow Katex rendering when there are many global definitions (#3993)
  • Fixed: Fix syntax of imported resources when importing ENEX as HTML
  • Fixed: Fixed OneDrive authentication
  • Fixed: Fixed sync issue when importing ENEX files that contain new line characters in the source URL attribute (#3955)
  • Fixed: Handle gzipped CSS files when importing from clipper (#3986)
  • Fixed: Update highlight.js to fix freeze for certain code blocks (#3992)
2 Likes

I've run into various types of errors with 1.3.10 while importing various .enex files. Here are three examples. Most of them have been encountered more than once.

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
    at Object.stat (node:fs:1061:10)
    at Object.stat (/Users/someuser/.joplin-bin/lib/node_modules/joplin/node_modules/graceful-fs/polyfills.js:298:16)
    at isSrcSubdir (/Users/someuser/.joplin-bin/lib/node_modules/joplin/node_modules/fs-extra/lib/move/index.js:153:6)
    at Object.move (/Users/someuser/.joplin-bin/lib/node_modules/joplin/node_modules/fs-extra/lib/move/index.js:24:3)
    at /Users/someuser/.joplin-bin/lib/node_modules/joplin/node_modules/universalify/index.js:13:12
    at new Promise (<anonymous>)
    at Object.move (/Users/someuser/.joplin-bin/lib/node_modules/joplin/node_modules/universalify/index.js:7:14)
    at saveNoteResources (/Users/someuser/.joplin-bin/lib/node_modules/joplin/lib/import-enex.js:183:12)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:93:5) {
  code: 'ERR_INVALID_ARG_TYPE'
}

...

[Error: ENOENT: no such file or directory, stat '/Users/someuser/.config/joplin/tmp/717f4e9cfd5d88b3fd8c040ccde840de.base64.decoded'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'stat',
  path: '/Users/someuser/.config/joplin/tmp/717f4e9cfd5d88b3fd8c040ccde840de.base64.decoded'
}

...

Error: EISDIR: illegal operation on a directory, read

Regarding atomic database operations, etc. This is what happens to an import process when a 'joplin sync' is triggered in the background.

It's unclear whether the "ERROR" is actually an error, or if the import process is retrying, or if a DELETE is actually failing (and potentially leaving something inconsistent):

Error: Error: SQLITE_BUSY: database is locked: INSERT INTO `note_tags` (`note_id`, `tag_id`, `updated_time`, `user_updated_time`, `id`, `created_time`, `user_created_time`) VALUES (?, ?, ?, ?, ?, ?, ?): 65982470864b43d1ab2e0d034f44e649,864e84baa5ef4dfca7d47a86035eae3d,1603993373023,1603993373023,5e5e6d57862c4cd193fa965ac820129a,1603993373023,1603993373023
    at DatabaseDriverNode.sqliteErrorToJsError (/Users/someuser/.joplin-bin/lib/node_modules/joplin/lib/database-driver-node.js:21:18)
    at JoplinDatabase.sqliteErrorToJsError (/Users/someuser/.joplin-bin/lib/node_modules/joplin/lib/database.js:25:24)
    at JoplinDatabase.tryCall (/Users/someuser/.joplin-bin/lib/node_modules/joplin/lib/database.js:104:45)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
    at async JoplinDatabase.transactionExecBatch (/Users/someuser/.joplin-bin/lib/node_modules/joplin/lib/database.js:161:4)
    at async Function.save (/Users/someuser/.joplin-bin/lib/node_modules/joplin/lib/BaseModel.js:503:4)
    at async Function.addNote (/Users/someuser/.joplin-bin/lib/node_modules/joplin/lib/models/Tag.js:64:18)
    at async saveNoteTags (/Users/someuser/.joplin-bin/lib/node_modules/joplin/lib/import-enex.js:198:3)
    at async saveNoteToStorage (/Users/someuser/.joplin-bin/lib/node_modules/joplin/lib/import-enex.js:225:22)
    at async processNotes (/Users/someuser/.joplin-bin/lib/node_modules/joplin/lib/import-enex.js:345:21) {
  code: 'SQLITE_BUSY'
}
/Users/someuser/.joplin-bin/lib/node_modules/joplin/lib/database-driver-node.js:21
        const output = new Error(msg.join(': '));
                       ^

Error: Error: SQLITE_BUSY: database is locked: DELETE FROM item_changes WHERE item_id = ?: 9896f891caef4ecc9a932985d0b191ee
    at DatabaseDriverNode.sqliteErrorToJsError (/Users/someuser/.joplin-bin/lib/node_modules/joplin/lib/database-driver-node.js:21:18)
    at JoplinDatabase.sqliteErrorToJsError (/Users/someuser/.joplin-bin/lib/node_modules/joplin/lib/database.js:25:24)
    at JoplinDatabase.tryCall (/Users/someuser/.joplin-bin/lib/node_modules/joplin/lib/database.js:104:45)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
    at async JoplinDatabase.transactionExecBatch (/Users/someuser/.joplin-bin/lib/node_modules/joplin/lib/database.js:173:5)
    at async Function.add (/Users/someuser/.joplin-bin/lib/node_modules/joplin/lib/models/ItemChange.js:25:4) {
  code: 'SQLITE_BUSY'
}

Please provide an ENEX file to replicate the issue.