On Friday, December 4, 2020 at 5:57:58 PM UTC-8 Tiddly Novice wrote:

> The checkbox, the select, and probably other seemingly simple widgets 
> don't possess undo functionality.
>

The reason these widgets don't have undo functionality is because, while 
these are "seemingly simple" widgets, depending upon how they are being 
used they can actually be quite complex in their actions.  These actions 
can potentially modify several different fields (and possibly several 
different tiddlers) at once.... and modifying any tiddler fields will have 
the immediate effect of triggering system-wide "refresh" handling that can 
radically change the display, including the widgets that triggered the 
refresh in the first place.

Then there is the question of how many sets of actions you might need to 
undo.  Should it only be the very last set of actions triggered by the most 
recent interaction, or should you keep a "stack" of actions so you can back 
out of multiple interactions, possibly all the way back to when the 
document was loaded (or at least back to the last time it was saved during 
the current session).

In the TiddlyWiki Classic days, I implemented a general-purpose 
*experimental* UndoPlugin (http://tiddlytools.com/#UndoPlugin) that hooked 
into the TWCore code and kept a global "history stack" of changed tiddlers, 
so that at any time, you could undo one or more changes, in reverse order, 
by overwriting the current tiddler definitions with their previous 
contents.  However, this approach was both compute and storage intensive, 
and was of limited usefulness in the long run, due to the "framing" 
problem: for any given user interaction, there could be multiple tiddlers 
that are added to the "history stack"... and when you trigger the undo 
command, these changes should be reverted as a single action, even though 
they comprise multiple entries in the stack.

Perhaps it would be possible to implement something similar for modern TW5, 
but I suspect it's not really worth the trouble.  In general, for the 
"simple" undo case, it's usually just as effective to ensure that a given 
interaction has an "equal and opposite" interaction that the user can 
perform, rather than some kind of generalized "undo" command.  Thus, if you 
check a checkbox, you can manually un-check it... if you select from a 
list, you can change the selection, etc.

-e

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8d4e217b-f60c-4c27-958d-b98e263778fdn%40googlegroups.com.

Reply via email to