User avatar
🪨 @Varpie@peculiar.florist
3y
If you use and would like to automatically delete your old notes, I created a for it.
You can find it on
Firefish's GitLab snippets (which I may or may not have inaugurated, we'll see if it stays there in the future ​:blobcateyes:​)

The plugin was recently updated to v0.2, which fixed a bug on the
timeToKeep and adds a confirmation when installing the plugin, to make sure that nobody ends up with deleted notes by mistake.

The base of the code was inspired by
@box464's great Plugins doc, thanks a bunch for that.
⭐8:aiscript@firefish.social:1:merci@kwak.cab:1:ms_robot_surprised@hol.ogra.ph:1
3
22
0
11
User avatar
box464 @box464@firefish.social
3y
@Varpie Hey, great work! If you want to place an extra layer of caution, you can add an Mk:Comfirm prompt (“This will delete the last 90 days of notes, are you sure?”) and if they answer yes, move forward otherwise stop. Or add multiple layers “Are you REALLY sure?” 😅

codeberg.org/box464/firefish-plugins/src/branch/main/docs/Reference_PluginApi.md#mk-confirm-title-text-type
1
0
0
0
User avatar
🪨 @Varpie@peculiar.florist
3y
@box464 Thanks for the suggestion! I also saw your comment on the GitLab snippet, I originally used this plugin as a Button widget but I found that it was something I wanted to let run in the background and forget rather than have to think about pressing the button, which is why I released it as a plugin.

Regarding the addition of
Mk:Confirm, I think it is a good idea and will definitely save some people, but my main concern is to not have a popup every time the loop runs. After testing it quickly, I saw that the plugin is re-installed every time Firefish is reloaded, so I had a dialog every time, which didn't work for me.

I thought about re-using the
Mk:load trick to avoid that, but then the dialog showed up once I changed device, so I had to look into that as well...
I thought about using the user registry, which is synchronized between devices, to go around that. After playing on the AiScript scratchpad for a while, I had a solution I was happy with, however, it used secure endpoints, and it isn't possible for a plugin to access or modify the registry, so I had to give up on that. I kept the local storage though.

I also added a bit of quality of life on the dialog, showing the default parameters and how many Notes it will delete on the first run.

v0.2 is available on
the snippet now!
⭐1
1
0
0
1

User avatar
box464 @box464@firefish.social
3y
@Varpie That initial confirmation is a great balance. The detail on what will happen when run is excellent!

I’m curious about the user registry. Haven’t considered that as part of a plugin, a page AiScript module, or button dialog before. I wonder if it would run from a page section with AiScript.
1
0
0
0
User avatar
🪨 @Varpie@peculiar.florist
3y
@box464 I think using the user registry with a plugin is not possible because of the security aspect (we would not want plugins to be able to modify our defaultNoteVisibility or break the deck view for instance, not to mention if it is used by a plugin A, we do not want a plugin B to modify the settings of A by mistake if both use the same registry keys)

I would assume the same restrictions apply to pages and other sources using AiScript. Although there is a
get-unsecure endpoint that allows to fetch registry values if you know their keys, so maybe it can be used for something.
⭐1
0
0
0
1