How can I prevent Journal data loss?

Hi,

I’ve built up this habit of keeping track on my Journal, throughout the day, what I’m working on: links to the tiddlers I’ve needed, interstitial bullets and so on. So I have, already in “muscle memory” that I’ll do Alt J to add a new note no matter where in my wiki I’m working on.

This is all nice and good — except! for the first couple of entries in the morning.
I understand – and respect – that it’s by design that a “new Journal” will, well, create a new journal with that name. The problem that I have is that if I haven’t done a “first commit” by saving the journal as soon as I create it, as soon as I Alt J to add a new entry to my still-draft-only journal, whatever I had added will be forever lost, with no possibility of undo. I’ve lost quite a lot of “thinking” to this usage difficulty.

How do people work around this? Is there an easy way to tweak Alt J to mean create a new journal //quickly save it!//, but keep it in edit mode but! don’t overwrite it if it exists?

I remember (but can’t find) discussions around this. I don’t want to be one of those that request the behavior to change, I just want to not lose any more first few entries of the day.

Thanks,
Gabriel

(Update: I found the discussion! Create New Journal Tiddler Broken )

Admittedly I rarely use the TW journal, but in my quick test here, alt-j opens a new journal in draft mode, and repeated alt-j returns to that draft without altering any content I’ve put into it, even before the first save.

ie, the behaviour I see is “open today’s journal in edit mode and switch focus to it”. if it’s already open, or already in edit mode, the end result doesn’t change. I can’t get data loss by what you describe.

(my environment: TW 5.3.8 via nodeJS, firefox 140 under Linux)

Currently I uses the browser storage plugin and set the save filter to [is[draft]] to save draft tiddlers to local storage. These draft tiddlers will kept in local browser data and are loaded when you reload tiddlywiki.

There is problem that the draft tiddlers still show up after you saves them. So l created a clear local storage button to clean them:

<!-- tag it $:/tags/PageControls -->
\whitespace trim
\procedure actions()
<$action-sendmessage $message="tm-delete-browser-storage"/>
<$action-sendmessage $message="tm-notify" $param="$:/core/ui/Buttons/clear-cookie/message"/>
\end

<$button class=<<tv-config-toolbar-class>> actions=<<actions>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/plugins/tiddlywiki/browser-storage/icon}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
Clear Cookie
</span>
</$list>
</$button>
<!-- $:/core/ui/Buttons/clear-cookie/message -->
Cookie cleared
1 Like

In theory, reloading the TW file should remove tiddlers from browser storage if they have been saved to disk.

Hi, to reproduce (at least in my nodejs setup):

  1. Don’t have have a journal for today, and have the journal name template not have time, just date.
  2. Alt J - a new Journal is opened.
  3. Write something in the Journal draft. Don’t save it.
  4. Open a different tiddler for editing.
  5. Alt J - from that second tiddler’s edit area.

Expected result: I’m scrolled back to where my Journal draft was open, and the text that I had entered is still there.

Actual result: A new draft for the day is opened, replacing the original one. The original unsaved draft is overwritten, and whatever notes were there are unrecoverable.

Thanks!

Do you get the same result on tiddlywiki.com?
Also, what TW version are you using? On Which OS and with which browser?

Fred

Thanks @tw-FRed

I see what’s happening:

I can reproduce the problem in tiddlywiki.com if I have anything on:

https://tiddlywiki.com/#%24%3A%2Fconfig%2FNewJournal%2FText

The journal template overwrites what I already had.

(I’m on node tiddlywiki 5.3.6, Linux, Chrome, btw – but it happens also online)


there must be an “if there’s new journal text, set the the text to it if not, text is not set”.

Same thing here, but it’s not linked to the “New Journal” Alt-J keyboard shortcut. Using the new journal button in the sidebar or in the More sidebar tab produces the same effect.

To me, this looks like a bug because new journal tiddler content gets erased only if TW is configured with an user-defined default content for new journals.

Fred

I agree. I’ll log it as such on the GH! thanks : )


Edit:

There’s a related issue New Journal overwrites draft tiddler · Issue #2931 · TiddlyWiki/TiddlyWiki5 · GitHub (or maybe the same, reframed)

Summary of that one seems to be: “new journal means new journal, not open today’s journal (even if it doesn’t yet exists)” I’ll add a note there, but seems to be a more philosophical than I’d expected.

I’ll add a note there about the inconsistency, though.

1 Like