The Trash bin idea

183 views
Skip to first unread message

Mohammad

unread,
Mar 3, 2019, 1:29:06 AM3/3/19
to tiddl...@googlegroups.com
Developing Tiddler Commander, I got some ideas how to have an UNDO operation.
Deleting tiddlers is a dangerous one which my have much interest to be undone! So, I propose the
below mechanism:

 Trash bin

Mohammad 3rd March 2019 at 9:47am
idea
  • A tiddler when deleted gets a new name: $:\z-trash\tiddler-name
  • The new title is added to $:/commander/trash-bin JSON tiddler
  • On recycle, the name is changed to its original one
  • On recycle, it is removed from $:/commander/trash-bin
  • Empty trash bin
    • All tiddlers listed in $:/commander/trash-bin deleted
    • Trashbin indexes are removed
I don't use Node.JS right now, but this feature may be helpful also for those use TW on node.js

Please send your comments, feedback on this.

--Mohammad




Eric Shulman

unread,
Mar 3, 2019, 3:00:38 AM3/3/19
to TiddlyWiki
On Saturday, March 2, 2019 at 10:29:06 PM UTC-8, Mohammad wrote:
 Trash bin

For some ideas from the TWClassic world, see here:

-e

TonyM

unread,
Mar 3, 2019, 3:35:29 AM3/3/19
to TiddlyWiki
Mohammad,

Another idea would be to develop a method to move tiddlers into a json tiddler one of these would be on delete to $:/trash this mechanisium would allow trash to be saved out and deleted or imported bach in.

A related mechanisium would be to select one or more tiddlers inside a json and restore it perhaps even using a revised import mechanisium.

A single tiddler to bundle multiple tiddlers would be good for trash handing, intentional bundling, import and export, multiple tiddler clipboards, macro, plugin and template stores and more. Thus to solve one problem we facilitate a lot more opportunities.

Regards
Tony

@TiddlyTweeter

unread,
Mar 3, 2019, 4:51:40 AM3/3/19
to TiddlyWiki
Ciao Mohammad

For serious UNDO 
... why not just use the mechanism of one of the Version Control systems we have already? 


This would allow multiple levels of undo. 
And would also provide the mechanism for trash organisation and restore.

Best wishes
Josiah

Mohammad

unread,
Mar 3, 2019, 6:32:53 AM3/3/19
to TiddlyWiki
Thank you all!
My plan is to have this feature ONLY in Tiddler Commander and I like to have the minimum
coding! 

I will try to study the proposed solution and see how can I implement a suitable one in TC.

Cheers
Mohammad

@TiddlyTweeter

unread,
Mar 3, 2019, 6:39:19 AM3/3/19
to TiddlyWiki
On how an UNDO system in s-n-r might work ... one thought is NOT to backup all s-n-r change. 
Often its not needed and gets too complex.

Rather there is auto-clone to version/trash on FIRST open. 
On subsequent runs where that tiddler is still being worked on there is a button for "TAKE SNAPSHOT" now. 
Then you don't get too many versions, but can still always revert to where you started.

Just thoughts
Josiah

Mal

unread,
Mar 3, 2019, 6:49:42 AM3/3/19
to TiddlyWiki
Josiah,

Thanks for the endorsement.

Mohammad,

When you change the name, you will probably need to add a timestamp in case another tiddler with the same name is subsequently deleted. You will probably also need to change the names of the other fields because they might have some functionality in the wiki. For example, there could be a system tag like $:/tags/Macro that would still be active in the deleted tiddler.

Also, I don't think you need to list all the deleted tiddlers in a tiddler - just tag them with $:/tags/Trash, for example, and they can then be easily listed as required.

Anyway, I think you've come up with a good suggestion that should not be too hard to implement.

Regards,

Mal

Mohammad

unread,
Mar 3, 2019, 7:03:16 AM3/3/19
to TiddlyWiki
Mal,
 Many thanks for your suggestion. One question, do you recommend the version control plugin? Or you propose something else.
Also, you pointed out to an important fact! The tiddlers with system tags like $:/tags/Macro are alive even changed their title.

--Mohammad

Mohammad

unread,
Mar 3, 2019, 7:04:38 AM3/3/19
to TiddlyWiki
Hi Tony,
 I dont know how to pack tiddlers inside a JSON tiddler! I would appreciate of you explain me.
Furthermore, the size is always a concern, I think your solution may results in a smaller wiki size!

--Mohammad

Mohammad

unread,
Mar 3, 2019, 7:07:19 AM3/3/19
to TiddlyWiki
Thnaks Eric,
 One question: I did not understood from TrashPlugin how does it it handle system tags (the point raised by Mal).

--Mohammad

On Sunday, March 3, 2019 at 11:30:38 AM UTC+3:30, Eric Shulman wrote:

Mal

unread,
Mar 3, 2019, 7:16:42 AM3/3/19
to TiddlyWiki
Mohammad,

My version control plugin uses a similar technique to what you are proposing, but the end result is a bit different. It depends on the original tiddler still existing to provide the interface for showing the saved versions.

There is also JD's version control plugin (sorry, I'm replying by mobile phone, so it's a bit difficult to provide a link) which saves a new version every time you edit a tiddler.

Either of these could provide some code to achieve a trash bin mechanism.

Regards,

Mal


Mohammad

unread,
Mar 3, 2019, 7:34:07 AM3/3/19
to TiddlyWiki
Thank you Mal,
I go through both of theme and write you back.

--Mohammad

TonyM

unread,
Mar 3, 2019, 7:58:30 AM3/3/19
to TiddlyWiki
A quick note,

Noteself also has version control. Perhaps the new local storage plugin could be adapted to do versons. This would have the advantage you could easily back out of a large change.

Just food for thought, but maybe too big a reach.

Tony

Mohammad

unread,
Mar 3, 2019, 8:03:09 AM3/3/19
to TiddlyWiki
Thanks Tony!
I take a look !

--Mohammad

TonyM

unread,
Mar 3, 2019, 8:07:18 AM3/3/19
to TiddlyWiki
Maybe ask jeremy, I imagin there could even be and independant trash storage?

Just speculation.

Tony

@TiddlyTweeter

unread,
Mar 3, 2019, 9:04:31 AM3/3/19
to TiddlyWiki
FYI Mohammad

The overhead of individual tiddlers is low since the header section is very small in bytes. The issue, that Mal pointed to, is that solo Tiddlers can do things that records in internal databases can't.

But those issues are manageable. 
Also on the upside, the value of maintaining individual tiddlers on UNDO in Versioning is a lot easier I think. 

My two pence
Josiah

Jeremy Ruston

unread,
Mar 3, 2019, 9:10:20 AM3/3/19
to tiddl...@googlegroups.com
Hi Mohammad

The trash can is an interesting idea, and there's certainly nothing like it in the core.

The core does pack multiple tiddlers into a single JSON tiddler because that's what plugins are. We use the plugin format for some internal things, like the $:/Import tiddler, as well as the obvious usage for plugins themselves. The plugin format doesn't permit multiple tiddlers with the same title, so I think you'd have to develop a custom format if you wanted to go that way.

Best wishes

--
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 post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a2040275-fcf3-45ef-882a-1c031fe6dab1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mohammad Rahmani

unread,
Mar 3, 2019, 9:14:44 AM3/3/19
to tiddl...@googlegroups.com
Many thanks for your comments.

--Mohammad

Birthe C

unread,
Mar 3, 2019, 9:57:34 AM3/3/19
to TiddlyWiki
Hi Mohammad,

TWclassic used tag systemConfig. When trashed it becomes systemConfigDisable.

Birthe

Mohammad

unread,
Mar 3, 2019, 10:21:41 AM3/3/19
to TiddlyWiki
Hi Birthe,
 Thanks I got it!
But seems there is no mechanism in TW5 and I have to remove all tags
and store in a hidden filed!

--Mohammad

Thomas Elmiger

unread,
Mar 4, 2019, 3:14:56 PM3/4/19
to TiddlyWiki
Hi Mohammad

Would renaming tags be an option?

$:/tags/Stylesheet => $:/trash/$:/tags/Stylesheet

Just a thought
Thomas

Mohammad

unread,
Mar 4, 2019, 3:20:05 PM3/4/19
to TiddlyWiki
Hi Thomas,
 Good point! 
Yes, I think it works on all system tags like $:/tags/Macro.

Thank you
Mohammad

Joshua Fontany

unread,
Mar 4, 2019, 5:26:05 PM3/4/19
to TiddlyWiki
This is an interesting idea, and one that users expect from their OS interactions.

The [encodetiddler[]] filter from my JsonMangler plugin will allow you to store and retrieve full tiddlers in another Json data tiddler without having to change any of the tags, etc. As long as the target Json tiddler is NOT marked as a plugin, TW will not attempt to read the subtiddlers stored there.

I'll have to think on how to set that up... maybe an automate [decodetiddler[]] filter? Otherwise there would be some complex wikitext scripts to re-create the tiddler and restore all the fields. An then you have to deal with how to handle duplicates/existing versions of the deleted tiddler.

Best,

Joshua Fontanay


TonyM

unread,
Mar 4, 2019, 5:34:19 PM3/4/19
to TiddlyWiki
Joshua,

Decode sounds like good idea but can we use a variation of the import mechanisium to extract tiddlers because this can also handle overwrites.

Regards
Tony

Mohammad

unread,
Mar 6, 2019, 7:39:02 AM3/6/19
to TiddlyWiki
Great idea Joshua,

I would appreciate if you give a try on this new Trash bin idea!
and let us know the result!

--Mohammad

TonyM

unread,
Mar 6, 2019, 4:27:24 PM3/6/19
to TiddlyWiki
Handling duplicates ie when the same tiddler is backed up multiple times should be as simple as applying a Generation suffix to each tiddler title

Tiddlername gen(n)
Tiddlername gen(0)
Tiddlername gen(1)

Regards
Tony
Reply all
Reply to author
Forward
0 new messages