Create view from "timeline"

143 views
Skip to first unread message

Tristan

unread,
Aug 6, 2020, 8:09:04 AM8/6/20
to TiddlyWiki

Hey guys,

I was wondering if it would be possible to have a list of tiddlers representing changes to an initial state applied in order so one could create a view of those changes and ultimately "go back in time" by applying only a subset of those changes.

From a technical point it is pretty much event sourcing but I do have a usecase in one of my wikis where tracking changes would make things way easier rather than creating new tiddlers every time copying all values from x to y.

Hope some TW guru can work some magic and help me out :)

TW Tones

unread,
Aug 6, 2020, 6:16:57 PM8/6/20
to TiddlyWiki
Tristian,

I believe I have being thinking along similar lines recently. Perhaps there are other ways to describe it like versioning, change logs, tracing, transaction log, event log, trail...

Could I ask you expand this?
I was wondering if it would be possible to have a list of tiddlers representing changes to an initial state applied in order so one could create a view of those changes and ultimately "go back in time" by applying only a subset of those changes.
 
Respectfully its a single sentence, with no punctuation, describing something a little more complex than average.

Please try and describe the outcome you are seeking rather than necessarily the way to get there. 

Recently I build a tool that exposes the history list so one can quickly open or edit tiddlers already opened or edited in the current browser session whether they are in the story list or not. I wonder if that would help you?

Regards
TW Tones

Eric Shulman

unread,
Aug 6, 2020, 8:46:14 PM8/6/20
to tiddl...@googlegroups.com
On Thursday, August 6, 2020 at 3:16:57 PM UTC-7, TW Tones wrote:
Recently I build a tool that exposes the history list so one can quickly open or edit tiddlers already opened or edited in the current browser session whether they are in the story list or not. I wonder if that would help you?

Quite some time ago, I created such a toolbar item for InsideTW:

Just copy that tiddler into your document and it will appear on the tiddler view toolbar (it's already tagged with $:/tags/ViewToolbar)

When you click the toolbar button, it presents a drop down list of all tiddlers that are in the $:/HistoryList, $:/StoryList, $:/DefaultTiddlers, and any tiddlers opened by using a permalink/permaview in the URL.  This ensures that *all* tiddlers that have been viewed during the current session are listed.  It also has a "delete history" button to clear the current $:/HistoryList (except for the currently viewed tiddler plus any $:/DefaultTiddlers and permalinked/permaviewed tiddlers).

There's also a "show details" button (chevron down) that presents the contents of the $:/HistoryList and $:/StoryList!!list as well as the "computed history" that is used in the main list.  This was primarily used for debugging during development, but provides some interesting "inner workings" info for the technically-minded.

There are also separate previous/next toolbar buttons that work with the same history logic for fast navigation backward/fowards through the history list:

Lastly, there is an optional custom icon for the History list toolbar item:

note: I've enabled "view titles as links", so when you view any of the above tiddlers, you can import them just by dragging their titles to your own TW document.

enjoy,
-e


Tristan

unread,
Aug 7, 2020, 4:04:42 AM8/7/20
to TiddlyWiki
Respectfully its a single sentence, with no punctuation, describing something a little more complex than average.

I am sorry if my question was a little much to digest at once. My english is not the best, I am afraid it might not transfer my intention correctly so I will use my bee wiki as an example

For every colony there is there is a tiddler repesenting the last state of that colony with various properties at this very moment:
  • Colony is alive/dead/merged...
  • When did this colony come "alive" (i.e. was created from a swarm etc.)
  • Which location this colony currently lives at
  • ...
Then there are records we enter and they get ordered chronologically into fields of the same name:
  • inspections to this colony over its lifetime tracking various things every time we open the hive
    • What was the weather like (bees get aggressive if a thunderstorm is incomming)
    • General observations
    • ...
  • combs
  • feedings
  • ...
This is fine and dandy and to see what a field (i.e. combCount) was last time we checked I achieved sort all corresponding records in descending order and pull out the value of the last record.
  • 2020-05-01: (creating colony): location (myparents)
  • 2020-05-01: combs (add 5 combs): combCount (5)
  • 2020-05-06: inspection (they are calm): behaviour(ok)
  • 2020-05-06: feeding: food (5kg)
  • 2020-05-08: inspection (brood looks ok): brood (ok)
  • 2020-05-10: move (move to apiary): location (apiary)
  • 2020-05-18: inspection (brood looks ok): brood (ok)
  • 2020-05-18: combs (add 2 combs): combCount(7)
  • ...
Now, if I want to track brood conditions I would need to create a new brood record and append this to a list in the colony i.e. brood and so on for every property I track. This gets quite cumbersome very quick. I would rather have one list field per colony and just keep appending change records to this one field and having an initial empty state for this colony where all changes get applied to in chronological order until a set mark in time to reconstruct the colony's state at that point (same setup as above):
  • 2020-05-01: create colony
  • 2020-05-01: change: location (myparents), changeComb (+5)
  • 2020-05-06: change: food (+5), behaviour(ok)
  • 2020-05-08: change: brood (ok)
  • 2020-05-10: change: location (apiary)
  • 2020-05-18: change: changeComb (+2), behaviour (ok)
  • ...
Now this way I could just "playback" all changes from start to see how the colony was doing on i.e. 2020-05-12:
  • Colony was at the apiary
  • There were 5 combs in the colony
  • They did behave ok last time
  • We fed them 5kg on 2020-05-06

Tristan

unread,
Aug 7, 2020, 4:16:13 AM8/7/20
to TiddlyWiki
Thank you Eric, this looks very promising and I might have a usecase in one of my wikis for this. Unfortunately though I am not looking for a history view but some "apply all changes from start to this point in time to initial state x".

TW Tones

unread,
Aug 7, 2020, 8:48:48 AM8/7/20
to TiddlyWiki
Tristian

That is now much more meaning full.

I what you want is a common type of application in computer systems. We could think of it as a transaction log. Where you can create a view of the thing you are logging at a particular point in time.

I will give it some more thought and come back to you.

The main determinant used to be how to do this as economically as possible but unless you have thousands of hives there is more than enough capacity in tiddlywiki to keep a full record of the state of a hive every time you make a change. So there is no need to recalculate it from the transactions.


a full snapshot of the hive every time would allow you archive and export records and they remain valid. Not dependant on the whole history.

It would be easier to graph and report on hive history.

Back tomorrow
Tones

Tristan

unread,
Aug 8, 2020, 10:58:42 AM8/8/20
to TiddlyWiki
Thank you Tones, appreciate that.

I was thinking about how to do this and this is why I stumbeled upon event sourcing which looked exactly like what I wanted. I have another wiki with ~25k Tiddlers right now so performance is indeed no issue for the foreseeable future. However creating a special record for every property I want to track is a hugh hassle during development (both entry masks and views).

Reply all
Reply to author
Forward
0 new messages