Leveraging the draft mechanism for multi-users

72 views
Skip to first unread message

TonyM

unread,
May 21, 2020, 9:08:21 PM5/21/20
to TiddlyWikiDev
Folks,

I was think what if we modified the draft mechanism to create tiddlers "Draft by username of `original tiddlername` then did not delete them! 
  • Let Subsequent edits overwrite same draft tiddler for that username

It would then be possible to export and import them into a master wiki and review and approve a users proposed changes using a difference comparison.

A Tricky view template may allow the source tiddler to remain unchanged and overlay it with the draft "Draft by username of `original tiddlername` as it it had being changed.
  • This would permit multiple users to edit the same wiki, and there changes will only me reflected in a set of "draft tiddler", 
  • visible to all but no clashes, 
  • The an editor could evaluate all proposed changes and apply them as desired to original tiddlername.

What do you think?
  • Is it achievable hack?
  • Or does it make sense to modify the core and provide option's
    • Option: Include username in draft tiddler titles
    • Option: Retain last draft.of for edited tiddlers by username if available.
    • Option: Display last last draft.of for edited tiddlers by username, rather than the original tiddler

Regards
Tony

Mat

unread,
May 22, 2020, 1:53:28 AM5/22/20
to TiddlyWikiDev
Here's probably what would happen:

Draft by Mat of 'Draft by TonyM of 'Draft by Mat of 'HelloThere'''

<:-)

Joshua Fontany

unread,
May 22, 2020, 2:23:02 AM5/22/20
to TiddlyWikiDev
Not a bad idea, I was also thinking that it would be a good idea to separate $:/StoryList and $:/History by user somehow...

Best,
Joshua F

Jed Carty

unread,
May 22, 2020, 7:51:59 AM5/22/20
to TiddlyWikiDev
If you have a username set it already saves drafts with the username.

The relevant function in wiki.js is

exports.generateDraftTitle = function(title) {
var c = 0,
draftTitle,
username = this.getTiddlerText("$:/status/UserName"),
attribution = username ? " by " + username : "";
do {
draftTitle = "Draft " + (c ? (c + 1) + " " : "") + "of '" + title + "'" + attribution;
c++;
} while(this.tiddlerExists(draftTitle));
return draftTitle;
};

so if you have a username set the draft tiddler gets a title in the form 'draft of <tiddler> by <username>'

Joshua Fontany

unread,
May 22, 2020, 8:46:08 PM5/22/20
to TiddlyWikiDev
Ha! I just noticed that myself. Gaah, there's really is a lot to get lined up jut right to make things work smoothly in a miltu-user environment. I edited a wiki yesteredeay for hours before I noticed that I had reset my User Name somehow, and then when I added it back I noted the Drafts are already setup like that. :D

Best,
Joshua F

TonyM

unread,
May 24, 2020, 5:35:39 AM5/24/20
to TiddlyWikiDev
Mat

This only happens in the comment plugin. See a subsequent reply by me.

Regards
Tony

TonyM

unread,
May 24, 2020, 5:43:20 AM5/24/20
to TiddlyWikiDev
Joshua,

this may be quite easy by locating all uses of the navigator widget and qualifying the history and story lists. Then change every reference to story list. Perhaps it would be easier to save and restore these tiddlers on user change.

Of note however I have come to believe the standard username field would be best considered a display name only. With an independent user management mechanisium setting this value. Since this is applied to creator and modifier fields automaticaly its also a way to capture session changes e.g. "Tony design updates" on tiddlers.

Reply all
Reply to author
Forward
0 new messages