[tw5] diffview macro plugin plus UI enhancements using jsdiff.js. Beta testers?

330 views
Skip to first unread message

wjam

unread,
Dec 8, 2017, 12:24:34 PM12/8/17
to tiddl...@googlegroups.com
hi,

I am working on a modified version of jsdiff (GitHub - kpdecker/jsdiff) for tiddlywiki 5.1++, 


The diffview macro plugin shows deletions and additions grouped by small(=character) medium, word  or large(=line) grouped data or just the modified lines.
of strings, tiddlers, subtiddlers, e.g.:


UI enhancements using the macro:

For tw5.1.14+ I use the macro to show TEXT field delta's during and after edit (info tab), and before import.

Preview diffs before commit edits, compare to shadow:
When you edit a tiddler you can view the current changes, but also changes compared to previous edits.
In the preview tab it shows the changes you made to the TEXT field during the edit of the tiddler 


The preview tabs.


Please note: diffview is a macro not a widget, so it is not rendered in real time, that would have too much performance impact, 
You have to switch manually between preview tabs for an update you can use the preview collapse tab on the left.

Zen Edit:
It also has a Zen Edit tab so editing without preview, tags, or fields is now possible

some of the edit tabs


Tags()
Alternative way to add remove tags, fields, type, also shows used by (~infotidller references)

TOC:
Alternative way to add a tiddler to the table of Contents.

Importing:
Before importing (drag drop) tiddler, you can now view the modifications to the TEXT field.


Enable disable tabs:
You can hide/show tabs using the ?-tab, which also contains some help info.


Current Status:

it is about 92% ready, 

to do 
- some minor issues, mostly clean up
packaging :
-diffview macro (as a plugin) tw5.0 or tw51+ 
-edit enhancements (about 40 tiddlers, including some core tiddlers) tw5.1.14+
-import enhancements (about 10  tiddlers, including some core tiddlers) tw5.1.14+

Any beta testers for a pre-release of the above? 

For more info see about tab at 

    _ _ _ _ _ _.tiddlyspot.com (url will be disclosed later)


KR
wjam
NL

Diego Mesa

unread,
Dec 8, 2017, 12:43:33 PM12/8/17
to TiddlyWiki
I'd gladly help beta test!


On Friday, December 8, 2017 at 11:24:34 AM UTC-6, wjam wrote:
hi,

I am working on a modified version of jsdiff (GitHub - kpdecker/jsdiff) for tiddlywiki 5.1++, 

wjam/
wiemmore  NL

wjam

unread,
Feb 14, 2018, 9:27:12 AM2/14/18
to tiddl...@googlegroups.com

Sorry for the delay, had some other priorities, I also made some UI changes, which are not yet included on tiddlyspot.

You can have a go at 


Use the tabs to change from zen edit (no preview tags,fields) edit+preview or diffview+or core shadow diff....

You select different compare algorithms (char/small, word, medium, line, delta show only changed lines, old-s, shadow...)

This version includes versioning of the body text of the tiddler. 
The old version is stored after pressing the V /\ button in the edit toolbar. tjis button appears when the draft text differs from the original text.
The original text will be stored in a separate tiddler with name formatted like: $:/oldtxt/tiddlerrtitle/datetimestamp

For more documentation see the about tiddler.

KR
wjam

wjam

unread,
Feb 15, 2018, 5:58:58 AM2/15/18
to TiddlyWiki
small update 
corrected default tiddlers, to show demo tiddler

Jeremy Ruston

unread,
Feb 15, 2018, 8:42:11 AM2/15/18
to tiddl...@googlegroups.com
Hi wjam

I am working on a modified version of jsdiff (GitHub - kpdecker/jsdiff) for tiddlywiki 5.1++, 

Awesome! I'm sorry I missed your original message: I kicked off something similar but less ambitious a couple of weeks ago:


It would be good to combine the best of the two implementations.

Best wishes


On 15 Feb 2018, at 10:58, wjam <wiem...@gmail.com> wrote:

small update 
corrected default tiddlers, to show demo tiddler

--
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/f6838f0d-dfa2-4db2-96d2-ea64f2c3cb52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

@TiddlyTweeter

unread,
Feb 15, 2018, 10:04:01 AM2/15/18
to tiddl...@googlegroups.com
wjam & Jeremy

I'm much interested in this from the points of view ...

1 - ... of an end user who writes zillions of drafts to hone writing. You can't hone writing unless you can revisit your previous drafts. Its too cumbersome in TW at the moment to remember to clone, rename and order. It makes drafting too complicated

2 - ... as an experimenter with complex regular expressions. RegEx is notoriously difficult once it gets complex to "debug". Auto-tracking and Auto-Step-Back would make it more viable for me to do more RegEx work in TW, which is what I'd like to do.

Best
Josiah

wjam

unread,
Feb 15, 2018, 12:45:59 PM2/15/18
to TiddlyWiki
@Jeremy,
thank you very much for your kind words.

@Josiah,
to support both sorts of drafting
you can use the tiddlerinfo tab to compare current version to previous versions of the tiddler.
NB if you do not want to make a backup use ctrl_enter or the standard V button.

i am also working on a versionstab for the side bar. it will show all the titles of modified tiddlers plus the titles of the oldtxt tiddlers. you can select one of those titles to compare current text with the oldtxt. or you can open the old text like the tiddler info tab. I'll upload it soonish.

wjam

wjam

unread,
Mar 11, 2018, 10:52:07 AM3/11/18
to TiddlyWiki
UPDATE

Versions tab in the sidebar

showing all revisions (last 80 days max 14/tiddler) 

including options to preview/compare changes, delete oldtxt, or restore oldtxt.
 
Logs tab, 

showing log tiddlers (log_YYYYMMDD)

with time stamps when tiddlers were changed 

including options to preview & delete one of the  log tiddlers

KR
wjam...

Jeremy Ruston

unread,
Mar 14, 2018, 5:51:49 PM3/14/18
to tiddl...@googlegroups.com
Hi wjam

This is looking good, congratulations. As discussed above, we need to figure out how to reconcile this with the PR I’ve been working on (https://github.com/Jermolene/TiddlyWiki5/pull/3112):

The first thing to note is that your version has many more more features. That’s great, but I’m also mindful of the discussion we’ve been having about whether diffing should go into the core (https://groups.google.com/d/topic/tiddlywiki/tqVmYrWCXf0/discussion). I believe that we should put it in the core for the reasons I’ve given elsewhere (because it is of universal utility, and to enable further development using the same library). However, because of concern about bloat I think only the most essential UI functions should go in the core).

The second point is that you are using a different JS library (https://github.com/kpdecker/jsdiff vs. https://github.com/google/diff-match-patch). I’m using the latter because it’s highly regarded and I’m familiar with it. There’s also the matter that your implementation incorporates the library as a macro, rather than a widget, which causes issues with the refresh mechanism.

So, I’m going to go ahead and merge #3112, and I hope we can work together to bring your additional features to the core implementation,

Best wishes

Jeremy.

--
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.

@TiddlyTweeter

unread,
Mar 15, 2018, 4:24:12 PM3/15/18
to tiddl...@googlegroups.com
Ciao wjam & Jerremy

I am using wjam's version. I have been for some weeks now. Its really excellent!

I can only comment from the surface level of what i do.

CASE 1 - Developing Regular Expressions in TW. It has been a godsend to be able to backtrack multiple versions. IMO the number of PAST VERSIONS to save should be user configurable from 1 up to infinity. The reason (that working with Regex really brings out) is that you can be developing something that later can be used to BRANCH a totally different way ... Without that version saved you lose it.

But say I have versions 1 thru 20. And realise that only version 15 and 17 are special. Can I delete the others? What happens in the editor when I load the Tiddler associated with those versions I deleted?

To sum up: Versioning is Good. Very good. For my use case I do NOT need to access in the editor directly to all the previous versions. Just know they are there if I need. But also be able to delete what I don't.

CASE 2 - Writing Screenplays. Here my need is more limited. Two backsteps is way enough for most practical purposes. There is no need for "branching" or preservation beyond two previous drafts. I'd simply like to be able to look at what I wrote before sometimes.

These variant cases indicate that in Case 1 I'd prefer infinite versions saved. In Case 2, two would be enough.

HOW SHOULD IT LOOK? -- Well, in practice I'm only using the wjam view that shows things down to character change level. I love how its configurable in-situ. In practice I have most of the options OFF. In practice I'm likely to just use one mode.

MOANS: Not sure this is solvable but full alignment of editing text and what was in the previous version. The preview area is not exactly optimal for easy comparison. Under wjam you get this (screenshot) ...



It would be better IMO to put the notes about past versions that currently appear above the text in "preview" under the text.

And, if possible, have an option to totally switch off the display of the menu in the preview pane so the previous version can be properly top-aligned. Adjustable widths for the editor and preview windows would enable better visual alignment too.

IMO that is the best way to compare versions--that the start of a line in the editor you can align with the corresponding point in previous version. at the moment that seems cumbersome.

Best wishes
Josiah
Auto Generated Inline Image 1

wjam

unread,
Mar 16, 2018, 5:19:29 AM3/16/18
to TiddlyWiki

Josiah,

On Thursday, March 15, 2018 at 9:24:12 PM UTC+1, @TiddlyTweeter wrote:
Ciao wjam & Jerremy

I am using wjam's version. I have been for some weeks now. Its really excellent!

Thanks, glad to hear some actual user feedback 

I can only comment from the surface level of what i do.

CASE 1 - Developing Regular Expressions in TW. It has been a godsend to be able to backtrack multiple versions. IMO the number of PAST VERSIONS to save should be user configurable from 1 up to infinity. The reason (that working with Regex really brings out) is that you can be developing something that later can be used to BRANCH a totally different way ... Without that version saved you lose it.

But say I have versions 1 thru 20. And realise that only version 15 and 17 are special. Can I delete the others? What happens in the editor when I load the Tiddler associated with those versions I deleted?

The revision contain a complete copy of original text (before you started editing) The revision is only stored when you press the commit with /\  (empty texts are not stored) 
If you press the garbage can next to an old version is will have no effect on any of the other oldtexts, , all others in /\-old  tabs will still look the same.
If you don't want to save a revision , either use the ctrl-enter short key or the commit without the small /\

To sum up: Versioning is Good. Very good. For my use case I do NOT need to access in the editor directly to all the previous versions. Just know they are there if I need. But also be able to delete what I don't.

Indeed the [?] tab allows you to disable tabs which you do not need for your use case and gives a short description for each of the symbols used on the tabs.  

CASE 2 - Writing Screenplays. Here my need is more limited. Two backsteps is way enough for most practical purposes. There is no need for "branching" or preservation beyond two previous drafts. I'd simply like to be able to look at what I wrote before sometimes.

These variant cases indicate that in Case 1 I'd prefer infinite versions saved. In Case 2, two would be enough.

HOW SHOULD IT LOOK? -- Well, in practice I'm only using the wjam view that shows things down to character change level. I love how its configurable in-situ. In practice I have most of the options OFF. In practice I'm likely to just use one mode.

MOANS: Not sure this is solvable but full alignment of editing text and what was in the previous version. The preview area is not exactly optimal for easy comparison. Under wjam you get this (screenshot) ...



It would be better IMO to put the notes about past versions that currently appear above the text in "preview" under the text.
 
I'm working on something like the radio buttons in the Versionstab in the sidebar



And, if possible, have an option to totally switch off the display of the menu in the preview pane so the previous version can be properly top-aligned. Adjustable widths for the editor and preview windows would enable better visual alignment too.
This would be difficult to implement. 

IMO that is the best way to compare versions--that the start of a line in the editor you can align with the corresponding point in previous version. at the moment that seems cumbersome.

For the short term, maybe you can temporarily add some empty lines at the beginning of your tiddler text in the draft part on the left, so the texts are aligned 
see attached image ;-) 
Screenshot - 2018-03-16 , 10_13_26.png

wjam

unread,
Mar 17, 2018, 10:36:52 AM3/17/18
to tiddl...@googlegroups.com
small update: added some new tiddlers
- an improved introduction
- a release tiddler, with upgrade shortcuts)
- an new tab with caption /\-all, where all diff tiddlers (even older ones) appear almost at the same height as the current. You can also select the diff mode 
   @Josiah  Maybe this is more to your liking. BTW I'm not very proud of the layout of that tiddler, still work in progress.

K.R. wjam 
Reply all
Reply to author
Forward
0 new messages