manuerwin / joplin-plugin-attache

Mass replacement of resources such as resized image files.
GNU General Public License v3.0
11 stars 0 forks source link

Feature suggestion: UX: Human readable file names #10

Closed graphit0 closed 2 years ago

graphit0 commented 2 years ago

Summary

Use attachment filenames instead of resource ID as a filename in Replace Resources folder

Description

While importing the resource for replacement to the plugin folder, instead of resource ID allow the resource to have a human readable name (let's call it "user filename") that the file has when it is uploaded to Joplin. Looks like this in Joplin:

image

Disclaimer

I realize Joplin stores resources with resource ID as filename, I understand that this suggestion might require to reorganize the plugin and create "some unnecessary bloat" by introducing a separate cache of user filenames.

Why

I think it is one of the most important changes to the plugin from a standpoint of non-technical user. Most of Joplin users don't know what resource is, let alone rely on resource ID to track the file.

The key piece of motivation why this plugin would benefit from human readable names is it has no other interface to deal with the files.

Joplin has no interface to interact with the files because user doesn't need to deal with the files. Joplin has plenty of identification data around the attachment. As a user, everything you add to a note is your document, photo, executable i.e. it is an attachment to the note, not a file or resource. Example of domain specific language that note-taking audience is familiar with. You know what it is because it's in notebook you created, in the note with certain text inside.

On contrast to Joplin, interacting with Resource Replacement plugin, user has to deal not only with files and file system but, at the moment, also with resource ID as file name. Searching the exact file in the list of hundreds of files using resource ID as file names is, to put mildly, undesirable.

An example

A user wants to keep and regularly update 3 specific contracts with Replace Resource plugin. Here's how his interface looks like

image

To achieve this user needs to find each note containing the contract, find the attachment in the note, save the resource ID and compare it with the filename in the resource folder, copy the file outside the resource folder, edit it, and save to Replace Resources folder.

manuerwin commented 2 years ago

Nice idea @graphit0, I think I can get this to work, provided the resource filename has NOT been changed in the Note Body after being attached/inserted by the user. Because I can successfully query a Resource based on the "filename" being equal to the Resource.Title as stored in the DB.

Will see what I can do.

manuerwin commented 2 years ago

@graphit0 - please do check out latest release and let me know if I've missed anything.

graphit0 commented 2 years ago

You did it :clap: ! It's doing great: it gracefully handled spaces, numbers, non-latin symbols and characters (tho I only tested a few, not trying break it apart hehe).

A minor quirk that I noticed is the version number: instead of 0.13-beta it shows as 0.12.2 in plugin list. I suppose because of that the plugin update didn't show up in the Joplin plugin repo. plugin-didn't-change-version

In general It's getting real exciting now. I think I'll start documenting a guide / an example of advanced usage, maybe even in combination with other plugins and programs. That would demonstrate the potential of this plugin. If you've got a good setup or use case but too lazy to write a post about it :smiley:, let me know, I'll include it in some of mine.

manuerwin commented 2 years ago

Thanks for the positive feedback! The guide sounds really great, please do link to it and I'll include in the readme. My only use case so far was the core one of reducing resource consumption of the remote (in my case the free version of Dropbox) :)

Re: the version, I forgot to update the manifest, have bumped it and hopefully will show up shortly? At least I hope that will fix it?

graphit0 commented 2 years ago

(this is a dup of the direct message from Joplin forum, I couldn't find any other contacts so had to post it here)

Hi Manu, the post about the plugin use cases is about to be rage quit completed and before posting I wanted to maybe get a feedback from you if you got time. It's a work in progress but at this rate I might never publish it, so better just to let it out at some point.

Here it goes, feel free to leave comments, change and delete things, I've got the original file, nothing would be lost: to edit it you can click on a pencil at the top bar.

link to hedgedoc