TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
7.98k stars 1.18k forks source link

Binary tiddlers created via import should have created and modified fields. #5823

Open saqimtiaz opened 3 years ago

saqimtiaz commented 3 years ago

When a tiddler is created as a result of importing a binary file, it lacks created and modified fields. This results in confusion for users as the resultant tiddler is not visible in the timeline.

Is there a particular reason for this, or is this just an oversight?

At first glance it looks like a simple fix could be providing created and modified fields in readFileContent:

https://github.com/Jermolene/TiddlyWiki5/blob/753bf8fe62189f551c4b7087c55b87a9bc3e481d/core/modules/wiki.js#L1401-L1409

Jermolene commented 3 years ago

Is there a particular reason for this, or is this just an oversight?

The original rationale was the idea that importing a tiddler should be non-destructive, in the sense that, say, importing a JSON tiddler and then exporting the same tiddler again as JSON should yield the same result.

It does seem to have caused a lot of issues for users, though. One possibility would be add a "modified" field to incoming tiddlers that don't have one. That would still lead to inconsistent behaviour: tiddlers that already have a "modified" field wouldn't rise to the top of the "Recent" list.

Another alternative might be to track imported tiddlers in a list field somewhere so that we can display a listing.

AnthonyMuscio commented 3 years ago

Perhaps a button we can choose to display at import, a bit like the timestamp is on/off button, "Retain/update timestamps."

This could handle binary files as suggested, but also Imported tiddlers with created/modified values.

A few times I have totally lost and cant find a tiddler I just imported (dragged and dropped), because it will not appear in the recent tiddlers as an example.

AnthonyMuscio commented 3 years ago

Jeremy,

I have created a button for the "post" Import view called "save import record". It simply saves the list of imported tiddler titles in a tiddler eg Import Date/time record before the $:/import tiddler is deleted, although they could be moved into a list field.

Tony