JackGruber / joplin-plugin-hotfolder

A plugin to Monitor a locale folder and import the files as a new note.
46 stars 4 forks source link

Importing to a named notebook is unintuitive and a bit broken by design #26

Closed docphees closed 1 year ago

docphees commented 1 year ago

The "Notebook" field in the Plugin's settings is finicky beast:

You can just type the name of the notebook, and it works. But then:

While Joplin allows you to give Notebook names with spaces, Hotfolder does not. Why? I don't know. It is one text field.

You shoved that notebook into another one to make it a sub-notebook.

OK, maybe write it as a path: superbook/subnotebook? No? (As a linux user the backslash does not come naturally as a path divider)

Things to be done differently, aka solutions:

  1. DON'T ACCEPT A NON-EXISTANT NOTEBOOK! Give the user an error, let the plugin at least check if it can find the given Notebook! And make sure the error is marked in red or so. And add two or three examples to help the user understand how to use nested a notebook: "You can use nested or 'sub-notebooks' like this: top notebook\sub-notebook"

Or, better yet: Make the entry a filter field, show a list of partly matching note-book next to it and have the user select one. No text-entry, no errors, no further checks needed (except when a notebook is deleted).

  1. I would love the plugin to simply create a default notebook on root level, named for example "hotfolder_default_import", if a stubborn user feeds it a non-existing notebook, renames it without telling Hotfolder, or simply deletes it. The name would make it clear, that I have to check Hotfolder's settings. There it would provide a well formed error message: "This notebook does not exist."

  2. Allow space as part of the notebook's name. Joplin does, why impose this restriction on the user?

docphees commented 1 year ago

I have simply added the better help text to the settings file as a proposal: https://github.com/JackGruber/joplin-plugin-hotfolder/commit/41ab8e6c651906b8d557ae87a44b44b005c51c73 (Edit: Made it a merge request/pull request)

Further things like checking the notebook's existence would still be good. I will possibly have a go at it, as Joplin slowly gets its roots into my life organization, but I am new to Joplin's code and will have to get a bit more used to it before proposing any change.

Also I will have to set up a closed off test environment so I do not risk any interference with my own Joplin setup!! Does anyone have a hint without setting up a virtual machine? Maybe some sandboxing experience with Joplin? (Well, possibly a virtual machine might actually be the way to go. Sigh!)

JackGruber commented 1 year ago

While Joplin allows you to give Notebook names with spaces, Hotfolder does not. Why? I don't know. It is one text field.

Noteboos with spaces work in my tests without problems

Make the entry a filter field, show a list of partly matching note-book nex ...

Unfortunately, a list can only be created at the start time of Joplin as soon as a notebook is renamed or moved, the list in the hotfolder settings is no longer correct.

Yes, currently the import is placed in the last displayed notebook if the folder does not exist.

docphees commented 1 year ago

At least on Linux Notebooks with spaces do not work. I have tested that just now again. Trust me. It does not!

Ok. The list generation is a bummer, but can not be changed.

It would really be great if a new, very obviously named something like "HOTFOLDER_DEFAULT_IMPORT" could be created to import such notes. It would help users find out why imports suddenly stop showing up.

An import notebook can be moved or renamed over years of usage, when one simply forgets that imports are being handled by a plugin and has to be set separately...

JackGruber commented 1 year ago

Add a warning msg 00d102b