[TW5][PLUGIN] Trashbin / Revisions plugin [mod]

151 views
Skip to first unread message

HC Haase

unread,
Sep 19, 2019, 9:05:14 AM9/19/19
to TiddlyWiki
A small mod of Kookma's trashbin plugin so it will be compatible with JD's Plain Revisions plugin.


The problem

If you use JD's very nice Plain Revisions plugin and also want to use Kookma's very nice Trashbin plugin you have a problem! when a tiddler go in the trash bin, the revisions are not touched, and if you later delete the tiddler from trash, you will have revisions of non-existing tiddlers filling up the wiki and a hard time locating these revisions.


The solution

The solution is my Trashbin-mod. With this mod, the revision tiddlers will be deleted whenever the corresponding tiddlers is deleted permanently from the trash bin.

The revisions are not changed nor deleted as long as the corresponding tiddler is in the trash bin. Therefore, if you restore a tiddler from the trash bin, the revisions will still be there.


Features

  1. When a tiddler is permanently deleted from the trash (individually or in bulk), the corresponding revisions of these tiddlers are also deleted.
  2. In the trashbin sidebar I added a count items in trash that will appear when the trashbin is not empty.

(@Kookma and @JD)

TonyM

unread,
Sep 19, 2019, 9:26:45 AM9/19/19
to TiddlyWiki
Nice,

I think both will go in my sandbox tiddlywiki template, where I am always hacking. No need to make tiddler copies and get others out of the way with a Reversible delete.

Good stuff
Tony

@TiddlyTweeter

unread,
Sep 19, 2019, 10:15:05 AM9/19/19
to TiddlyWiki
VERY good idea.


I'm crossing my fingers it might work with it too?

What I like about your approach is it brings tools together. 

TT

Mohammad Rahmani

unread,
Sep 19, 2019, 12:16:09 PM9/19/19
to tiddl...@googlegroups.com
This is great to integrate different plugins.

Some comments

If you move to trash a tiddler say test, it will be seen as test inside trash bin

Next you can create another test tiddler
If again move this to trash, you see it as test 1

If you restore any of these, you will have  a test tiddler not test 1

So, if the second test tiddler has some revisions, and you restore the first test tiddler what will happen to revisions?

It seems on moving to trash you need also move all revisions.
On restore you need the restore all revisions

Mohammad

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/cdb52435-fc6f-4257-9d62-2480887edee3%40googlegroups.com.

HC Haase

unread,
Sep 20, 2019, 3:47:44 AM9/20/19
to TiddlyWiki


torsdag den 19. september 2019 kl. 16.15.05 UTC+2 skrev @TiddlyTweeter:
VERY good idea.

(and @TonyM) thansk 


I'm crossing my fingers it might work with it too?

It will not, but... it is a as simple as changing the filters in my modified tiddlers.. I can properly do it soon (and properly you can also do it (; ). a better solution would properly be to make a input field, to let a user define a filter of what will be included when a tiddler is deleted, that would make the trashbin more flexible.. but I dno't know if I have the skills to do that yet. 

What I like about your approach is it brings tools together. 


Thansk. I think this is a symptom of a bigger TW issue. core vs plugin! The discussion has been here before.
I agree, that it is a good thing to keep the core as small as possible, but cases like this shows the weakness of plugings.

I initially asked Mohammad if he could include this functionality in his plugin but he argued (and I agree), that it would be best to keep the plugin tied to the standard distribution. So I made it my self and lo and behold, now yet another cross plugin specific issue. This is why it would make some development easier, if more (relevant) plugins was made part of the core. who knows when a 3,4,6th revision plugin needs specific integration with the trashbin.


HC Haase

unread,
Sep 20, 2019, 3:57:12 AM9/20/19
to TiddlyWiki


torsdag den 19. september 2019 kl. 18.16.09 UTC+2 skrev Mohammad:
This is great to integrate different plugins.

Some comments

If you move to trash a tiddler say test, it will be seen as test inside trash bin

Next you can create another test tiddler
If again move this to trash, you see it as test 1

If you restore any of these, you will have  a test tiddler not test 1

So, if the second test tiddler has some revisions, and you restore the first test tiddler what will happen to revisions?

You are right.. I did not think of this use case. 

Again the problem of not unique tidder IDs shows itself..

It seems on moving to trash you need also move all revisions.
On restore you need the restore all revisions

Yes that would be the most safe option, but I am not sure I can do that without breaking something else.. I am coding with a hammer, not a scalpel.

HC Haase

unread,
Sep 20, 2019, 4:42:19 AM9/20/19
to TiddlyWiki


fredag den 20. september 2019 kl. 09.47.44 UTC+2 skrev HC Haase:



I'm crossing my fingers it might work with it too?

It will not, but... it is a as simple as changing the filters in my modified tiddlers.. I can properly do it soon (and properly you can also do it (; ). a better solution would properly be to make a input field, to let a user define a filter of what will be included when a tiddler is deleted, that would make the trashbin more flexible.. but I dno't know if I have the skills to do that yet. 



I have included the filter to handle Mal's version also (olny in the attached). please test TT. as I dont have that plugin myself.
 
$__plugins_kookma_trashbin_macros_bulk-operation.tid
$__plugins_kookma_trashbin_sidebar-tab.tid

@TiddlyTweeter

unread,
Sep 20, 2019, 4:54:43 AM9/20/19
to TiddlyWiki
Thanks!

I'll likely respond in a couple of days.

Best
TT

Mohammad

unread,
Sep 20, 2019, 6:40:05 AM9/20/19
to TiddlyWiki
I think when a tiddler is deleted, or moved to trashbin, all its version shall be deleted or go to trasbin!
This is what I see with Windows recycle bin!

@TiddlyTweeter

unread,
Sep 21, 2019, 6:20:57 AM9/21/19
to TiddlyWiki
Ciao HC & Mohammad

Tested with Mal's Versioning system.

This was a short test. Seems to work well! :-) 
I'll use it longer term and comment more if anything comes up ...

Comments ...
  • When you delete manually "_vc" items (i.e open and delete via Explorer) they correctly go to trash. ALSO Mal's versioner detects that without needing to do anything in it.
  • Nicely, when you delete the tiddler that has versions it (a) goes to trash; (b) if restored then all versions are still there; AND, (c) correctly, when you empty trash all variants are deleted too. Neat!
  • Only issue (NOT to do with your mods) is if you delete one version from the Info: Versions panel in Mal's Versioning the delete does NOT go to trash. Maybe the delete method is not compatible with Trash Bin tool??? Its not a big deal. But could be slightly confusing in practical use.
Best wishes
TT

  

On Friday, 20 September 2019 10:42:19 UTC+2, HC Haase wrote:
Reply all
Reply to author
Forward
0 new messages