Tiddlywiki5: Deleting a tid should also delete its draft

Created on 11 Nov 2017  Â·  10Comments  Â·  Source: Jermolene/TiddlyWiki5

As you know, deleting a draft also deletes the original tiddler. For symmetry, and other reasons I'll explain, deleting a tiddler should also remove any draft of it or at least prompt an option to do so.

To reproduce current behaviour:

Create a tiddler A with text [[B]] and save tiddler. Leave it open.
Click the link, create/edit the missing B and save it. Click edit again and leave it open as draft.
In A, click the link again.
Status check, you now have A, B and Draft of B.
In B toolbar, click delete button.

This deletes the tiddler B but leaves the draft of B. IMO, the reasonable/desired behaviour is that both B and 'Draft of B' are deleted, ideally preceded by a popup alert for each respectively, asking for confirmation.

Practical problem
If the wiki has been saved with tiddler B in draft mode, then you have two permanently saved tiddlers (i.e B and 'Draft of B') that may have different contents. Which is the correct content?

Conceptual problem
IMO the term "draft" as we use it in TW is conceptually confusing or misleading. In TW, a "draft" means a separate tiddler, linked to the original in a special "potentially replacing" way. But in other software, the standard UI is that you either edit the original - or, if you really deal with drafts, then these are fully separated from the original and you can have several of them.

IMO, the natural interpretation - i.e "how newbies expect things" - of tiddler edit mode is that one is dealing with the original tiddler and not a separate tiddler. If one want actual drafts of a tiddler, it is very easy to make "tiddler 1, tiddler 2, ...", i.e editable clones. For this reason, the point about symmetry makes sense, i.e deleting either of the original or the edit-mode version of it, should delete both.

All 10 comments

I have run into this while developing a Table Renderer plugin on node.js. I
would often have to reload my wiki to refresh some changed javascript and
forgot I had another tiddler open in draft mode.

I have also been trying to think about how I want the Table Renderer to
work when the table is displayed in a "draft mode" tiddler...... and didn't
have a good idea yet. Very clear explanation of the issue.

On Fri, Nov 10, 2017 at 3:33 PM, twMat notifications@github.com wrote:

As you know, deleting a draft also deletes the original tiddler. For
symmetry, and other reasons I'll explain, deleting a tiddler should also
remove any draft of it or at least prompt an option to do so.

To reproduce current behaviour:

Create a tiddler A with text [[B]] and save tiddler. Leave it open.
Click the link, create/edit the missing B and save it. Click edit again
and leave it open as draft.
In A, click the link again.
Status check, you now have A, B and Draft of B.
In B toolbar, click delete button.

This deletes the tiddler B but leaves the draft of B. IMO, the
reasonable/desired behaviour is that both B and 'Draft of B' are deleted,
ideally preceded by a popup alert for each respectively, asking for
confirmation.

Practical problem
If the wiki has been saved with tiddler B in draft mode, then you have two
permanently saved tiddlers (i.e B and 'Draft of B') that may have different
contents. Which is the correct content?

Conceptual problem
IMO the term "draft" as we use it in TW is conceptually confusing or
misleading. In TW, a "draft" means a separate tiddler, linked to the
original in a special "potentially replacing" way. But in other software,
the standard UI is that you either edit the original - or, if you really
deal with drafts, then these are fully separated from the original and
you can have several of them.

IMO, the natural interpretation - i.e "how newbies expect things" - of
tiddler edit mode is that one is dealing with the original tiddler and
not a separate tiddler. If one want actual drafts of a tiddler, it is
very easy to make "tiddler 1, tiddler 2, ...", i.e editable clones. For
this reason, the point about symmetry makes sense, i.e deleting either of
the original or the edit-mode version of it, should delete both.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/Jermolene/TiddlyWiki5/issues/3008, or mute the thread
https://github.com/notifications/unsubscribe-auth/AIrmB3EpfsIS0_dMnTM-idQ7M5K9sqIrks5s1N1hgaJpZM4QaPZB
.

I suspect that this is something overlooked in how tiddlywiki handles deleting files, I have been looking closely at that for the multiuser plugin and it is complex and full of special cases because there are different ways to edit tiddlers. If I can find where this would be handled I will try to make a pull request.

But first we need to describe the desired behaviour.

I think that we would need to do two things.

  • navigating to B when the draft of B exists bring you to the draft tiddler instead of B
  • deleting a tiddler also deletes its draft

would that be a good way to resolve the problem?

I recognise the problem but perhaps a different solution.

Create a tiddler A with text [[B]] and save tiddler. Leave it open.
Click the link, create/edit the missing B and save it. Click edit again and leave it open as draft.
In A, click the link again.
Status check, you now have A, B and Draft of B.
In B toolbar, click delete button.

It strikes me that it's actually the third step where things go awry, because it's at that point that the story river enters an inconsistent state. Suggesting an alternative solution of making the navigation processing check for a draft of the target tiddler, and navigate to the draft if so.

If the wiki has been saved with tiddler B in draft mode, then you have two permanently saved tiddlers (i.e B and 'Draft of B') that may have different contents. Which is the correct content?

That is the intended behaviour: anytime a draft exists, we need to retain any original content somewhere so that we can "restore" it if the user cancels the edit. Also note that it is perfectly possible to have multiple drafts of the same tiddler; I'm not sure that it's generally useful, but it is possible.

If the wiki has been saved with tiddler B in draft mode, then you have two permanently saved tiddlers (i.e B and 'Draft of B') that may have different contents. Which is the correct content?

That is the intended behaviour: anytime a draft exists, we need to retain any original content somewhere so that we can "restore" it if the user cancels the edit. Also note that it is perfectly possible to have multiple drafts of the same tiddler; I'm not sure that it's generally useful, but it is possible.

FYI, _having access to multiple drafts is very useful for some kinds of writers_. At the moment in TW I make several individual normal Tiddlers for versions of a text as it evolves. If they could be saved as a series of drafts in a way you could easily track them it would be a plus for me.

I definitely noticed spurious drafts piling up in my wiki, which I recently cleaned up, in a rather slow process... and this is surely the reason why.

I definitely noticed spurious drafts piling up in my wiki, which I recently cleaned up, in a rather slow process... and this is surely the reason why.

"Right Sidebar: More: Drafts" ... list all draft tiddlers. So it could be relatively fast to remove them.

Create a tiddler A with text [[B]] and save tiddler. Leave it open.
Click the link, create/edit the missing B and save it. Click edit again and leave it open as draft.
In A, click the link again.
Status check, you now have A, B and Draft of B.
In B toolbar, click delete button.

I think, if you open tiddler B and a draft exists, it should open the draft and not the tiddler. Which would resolve the issue.

I think, if you open tiddler B and a draft exists, it should open the draft and not the tiddler. Which would resolve the issue.

I would think of it differently: I would like the ability to maintain tiddlers and their draft(s) both in the story. However, I think when both are open simultaneously, the draft should display a prominent link (box) to the tiddler and the tiddler should show one or more links to any open draft(s).

@Jermolene

Referring to Mario suggestion:

I think, if you open tiddler B and a draft exists, it should open the draft and not the tiddler. Which would resolve the issue.

I think when a tiddler is opened in the story river in edit mode, TW should NOT open/display the main tiddler when its title clicked from some links like Recent or More/All tab. I noticed one accidentally opens the main tiddler while draft is open and deleting the main tiddler and confuse why the draft is still open!

Is there any plan to resolve this or not?

There's an underlying problem here that I tackle in #1202 , i.e that it is conceptually problematic that a tiddler and its draft are two individual entities (compare with editing a text file: it is just one thing, just like editing a physical paper). That issue thread proposes an alternative tiddler UI that presents the tiddler and its draft as one unit (accessed by the tiddlers "toolbar tabs"). Such a design would make it easy to understand what's happening even if there is only a draft and no tiddler, i.e one would then only see the tab-button for the draft but e.g a grayed out tab for the 'view'. BTW, to get information that there's no original or no draft is directly useful information per se!

I.e if the tiddler had a UI presenting the tiddler+draft as one unit, the issue raised in this OP here would automatically be resolved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Jermolene picture Jermolene  Â·  6Comments

rmunn picture rmunn  Â·  4Comments

saqimtiaz picture saqimtiaz  Â·  5Comments

KendrickLamarck picture KendrickLamarck  Â·  4Comments

diego898 picture diego898  Â·  5Comments