Daily Task Macro - buttons no longer change color in 5.2.0-prerelease

192 views
Skip to first unread message

cmari

unread,
Aug 13, 2021, 3:26:33 PM8/13/21
to TiddlyWiki
I have been a happy daily user of Daily Task Macro (http://togglers.tiddlyspot.com/) for years, so I am wondering whether someone can point me to any tips for how I might update the macro so that it will continue to work in the new prerelease. 
 
Specifically, the fields in toggler tiddlers do continue to update correctly when the images are clicked, but the (svg) images themselves do not update in response to the click until the tiddler is opened and closed again.

Thanks for any help!
cmari

Saq Imtiaz

unread,
Aug 13, 2021, 4:03:59 PM8/13/21
to TiddlyWiki

cmari

unread,
Aug 14, 2021, 12:42:38 PM8/14/21
to TiddlyWiki
Thanks Saq, that was certainly not the answer I was hoping for, but it's good to know which way the wind is blowing after so many years (I think the original dailytasks plugin that got me started 13 years ago came from you?).
cmari (considering changing my name to "offspec user"!)

Saq Imtiaz

unread,
Aug 14, 2021, 12:54:23 PM8/14/21
to TiddlyWiki
Just to add a bit more clarification to the issue since I have a bit more time now than I did yesterday, this functionality should have been implemented as a widget and not a macro. I quickly dropped the link in reply yesterday so you would know that there was some follow up on your post.

JavaScript macros in TiddlyWiki5 are supposed to be for simple text substitution and do not have any facilities for refreshing in response to other changes in the wiki, the input of the macro determines the output. A macro should never modify tiddlers. The macro in question both needs to refresh itself in response to tiddler changes, and also modifies tiddlers. 

Such a macro was never intended to be supported but has worked so far because we were aggressively refreshing entire tiddlers when anything in that tiddler changed. So for example a change to a tiddler "list" field would refresh the entire tiddler in the story. However this is suboptimal both from a performance point of view and in terms of user experience. Some of the annoyances commonly encountered like an edit-text widget in a tiddlers text field not being usable to modify a field in the same tiddler come from this aggressive and unnecessary refresh behaviour.

So the question that presents itself now is whether we maintain backwards compatibility for a behaviour from third party macros that was never intended to be supported and holds back improvements, or break such macros as their implementation will trip us up again in unexpected places and limit future possibilities.

Your actual need for the functionality offered by this macro could probably be solved with a wikitext implementation as well. It might be worth a search to see if someone has shared such a solution.

Regards,
Saq

Saq Imtiaz

unread,
Aug 14, 2021, 1:04:33 PM8/14/21
to TiddlyWiki
This is one of the first things that came up with a search, perhaps it may be of interest:

cmari

unread,
Aug 14, 2021, 2:03:30 PM8/14/21
to TiddlyWiki
Yes, I have seen that, thanks. Unfortunately, I lack the necessary skills/time to identify the pieces that would need to be adapted to allow for viewing (and updating) a running overview of the task status for the last 10 days.

TiddlyTweeter

unread,
Aug 15, 2021, 7:04:17 AM8/15/21
to TiddlyWiki
Ciao Saq ...

Side comment ... 

... Just to add a bit more clarification ... this functionality should have been implemented as a widget and not a macro. 
 
JavaScript macros in TiddlyWiki5 are supposed to be for simple text substitution and do not have any facilities for refreshing in response to other changes in the wiki, the input of the macro determines the output. 
 
... Such a macro was never intended to be supported but has worked so far because we were aggressively refreshing entire tiddlers when anything in that tiddler changed. 

Right! YET.

But it is slightly worrying that Simon Kilner's(?) TOGGLER macro (actually a re-write of something originally on Classic?) is kinda deprecated now. And NEVER was BEFORE.

The tool WORKED forever already.

And your formal explanation kinda misses the point that IF it was working, why is it NOT working now?

Saq, I never want to argue with you, you are so sweet! :-) 
I just think that the recent leap in TiddlyWiki is kinda a BREAK with it's previous tolerance of non-kosher JS?

IMO, one of the great achievements of TW has been the combo of VAST functional expansion combined with pretty amazing backwards compatibility. 

THIS is an interesting case where it broke down.

Just thoughts
TT


Jeremy Ruston

unread,
Aug 15, 2021, 7:20:54 AM8/15/21
to tiddl...@googlegroups.com
But it is slightly worrying that Simon Kilner's(?) TOGGLER macro (actually a re-write of something originally on Classic?) is kinda deprecated now. And NEVER was BEFORE.

The tool WORKED forever already.

And your formal explanation kinda misses the point that IF it was working, why is it NOT working now?

It's the price for fixing the ability to edit a field within the same tiddler, which has been a perennial problem/bug that affects many users.

There's definitely a tension with breaking these macros, but there's a couple of points:

* More users encounter the edit-field-of-same-tiddler problem than would be running some old broken macro
* These macros were broken to begin with, and in many/most cases the authors chose to ignore warnings
* It should usually be easy to fix: wrap the macro invocation in a <$tiddler> widget referencing the tiddler in question

With reference to the second point, we've always tried to educate developers on the proper way to write macros. Literally every time a developer posts about a JS macro that they're writing, my first angle is to look to see if it follows the rules, and to provide feedback if not.

In many cases, of course, developers aren't very interested, and work on the basis of "it works for me so why should I change it", which of course in the end can be very damaging to the community unless the limitations are very carefully documented.

I do plan to update the release note with a more prominent warning of the impact of this change.

Best wishes

Jeremy



Saq Imtiaz

unread,
Aug 15, 2021, 7:34:43 AM8/15/21
to TiddlyWiki
@cmari perhaps this is closer to what you need?

Note that you can use the "arrow" buttons to move forwards and backwards in time.

I've bookmarked these two habit tracking solutions so they show up at TiddlyWikiLinks:

TiddlyTweeter

unread,
Aug 15, 2021, 8:51:04 AM8/15/21
to TiddlyWiki
Ciao Jeremy

A compounding factor is that devs of older stuff are often NOT around to fix for compliance with new.
The issue is the users who relied on what they thought were kosher tools that STOP working that the author won't fix.

 Jeremy: |  do plan to update the release note with a more prominent warning of the impact of this change.

Good! IMHO, it might also be worth mentioning that their tool of concern would continue to run fine under previous versions of TW
For working apps mostly it is NOT needed you upgrade! 
(("Upgradeitis" is a serious modern disease. :-))

Best wishes
TT


PMario

unread,
Aug 15, 2021, 12:41:56 PM8/15/21
to TiddlyWiki
On Sunday, August 15, 2021 at 1:20:54 PM UTC+2 Jeremy Ruston wrote:

* It should usually be easy to fix: wrap the macro invocation in a <$tiddler> widget referencing the tiddler in question

I did test that, but it seems the tiddler-widget only views the tiddler-attribute for a change and a simple state, that only calculates the classes. ...
So if any tiddler-field changes, it doesn't do a refreshSelf() and may be it shouldn't. It needs to refreshSelf() if the parameter itself is changed, and not if the tiddler, where the parameter points to is changed. ...

But this seems to work:

<$set name=x value={{!!toggled}}>
<<dailytasks>>
</$set>

and

<$set name=x value={{!!toggled}}>
<<togglers>>
</$set>



-mario

PMario

unread,
Aug 15, 2021, 12:55:55 PM8/15/21
to TiddlyWiki
Did more tests ... It seems to be

<$vars x={{!!toggled}} y={{!!barray}}>
<<macro>>
</$vars>


-m

Jeremy Ruston

unread,
Aug 15, 2021, 1:19:07 PM8/15/21
to TiddlyWiki Group
Hi Josiah

A compounding factor is that devs of older stuff are often NOT around to fix for compliance with new.
The issue is the users who relied on what they thought were kosher tools that STOP working that the author won't fix.

Indeed.

 Jeremy: |  do plan to update the release note with a more prominent warning of the impact of this change.

Good! IMHO, it might also be worth mentioning that their tool of concern would continue to run fine under previous versions of TW
For working apps mostly it is NOT needed you upgrade! 
(("Upgradeitis" is a serious modern disease. :-))

From the core perspective we really want people to upgrade actively used wikis to each new version because it’s expensive and complex to offer support for old versions. For example, if we had a user on v5.1.23 who was holding back updating to v5.2.0 then that user wouldn’t be able to benefit from bug fixes in subsequent releases. If they reported a bug that was then fixed by the core team they wouldn’t be able to get the fix without updating.

Best wishes

Jeremy

cmari

unread,
Aug 15, 2021, 4:13:33 PM8/15/21
to TiddlyWiki
Hello all,  
Thanks!! Thanks to Mario for a way to wrap the macro that works perfectly. Thanks to Jeremy and Saq for all of the explanations - for me those always make it easier to adapt to change. Thanks to Saq for persisting with a search for alternatives in the face of my insistence on wanting what I want. And thanks to Josiah for highlighting the amazing longevity of TW tools.  

One further question that would help my understanding of things: is the wrapping enough to restore this macro to acceptability? Or is there really some deeper fundamental problem being described by "broken", "off-spec", and "improper" that means I should think of the wrapping as only a temporary bandage? 
cmari

PMario

unread,
Aug 15, 2021, 4:31:22 PM8/15/21
to TiddlyWiki
On Sunday, August 15, 2021 at 10:13:33 PM UTC+2 cmari wrote:
Hello all,  
Thanks!! Thanks to Mario for a way to wrap the macro that works perfectly.

It was Jeremy's comment, that made me play with the possibilities. ...

One further question that would help my understanding of things: is the wrapping enough to restore this macro to acceptability?

IMO it should do the trick. .. It basically adds the refresh mechanism that should "inside" the macro code, onto the outside. ... The $vars widget (as every other widget) implements a "watchdog" that "listens" to changes that happen to parameters that are passed to the widget.

In case of the workaround <$vars x={{!!toggled}} y={{!!barray}}> it's the {{!!field-names}} that are important. The variable names don't matter, since we don't really need them. Whenever the fields change, the vars widget will redraw itself and it's childs. Since the <<dailytasks>> and <<togglers>> macro are part of the widget body they get refreshed, in the exact same way as the <$transclude macro did it in the past.
 
Or is there really some deeper fundamental problem being described by "broken", "off-spec", and "improper" that means I should think of the wrapping as only a temporary bandage? 
cmari

I think this workaround is perfectly valid. ... It still should be fixed on the js-code level. ... BUT upgrading to v5.2.0 isn't "killing" the old functionality anymore. So we have more time to really fix the problem, where it should be fixed.

-mario

TiddlyTweeter

unread,
Aug 16, 2021, 4:37:44 AM8/16/21
to TiddlyWiki
Ciao Jeremy ...
 Jeremy: |  do plan to update the release note with a more prominent warning of the impact of this change.

TT: Good! IMHO, it might also be worth mentioning that their tool of concern would continue to run fine under previous versions of TWFor working apps mostly it is NOT needed you upgrade!
 
From the core perspective we really want people to upgrade actively used wikis to each new version because it’s expensive and complex to offer support for old versions. For example, if we had a user on v5.1.23 who was holding back updating to v5.2.0 then that user wouldn’t be able to benefit from bug fixes in subsequent releases. If they reported a bug that was then fixed by the core team they wouldn’t be able to get the fix without updating.

Right. I do broadly understand that. BUT in practice it is a bit of a puzzle too. Older, non-complaint plugins, by authors no longer active, could end up ESTRANGED.  

(FYI, in THIS thread, I do see PMario work hard for a compatible solution for the OP's user problematic. Maybe that is enough for these edge cases? I.E: a dedicated dev solves the issue functionally. What he is doing is solving a problem for the "absent landlord". One "good enough" to work for the moment.)

IMHO, I agree you should not go backwards. It would make no sense and would be ineffectual and serendipitous if and when it worked. 

However the latest version is, crudely speaking, an "interruptus". That may throw some plugins (BUT I have no idea how many; it may just be a manageable handful?). But IS the "break with past" minor or serious?

SO, to be practical. I'd say it is still a bit unclear how much of an ISSUE all this is.

Just thoughts from a non-programmer.

Best wishes
Josiah

arun babu

unread,
Jul 21, 2022, 6:54:58 PMJul 21
to TiddlyWiki
Is this macro usable with latest versions of TW. If it's usable, where should the code  suggested by pmario in the posts above be added ?

PMario

unread,
Jul 22, 2022, 8:10:25 AMJul 22
to TiddlyWiki
As far as I can remember it's needed, when you use the macro. You should be good, if you use the following wrapper code for both macros
`<<dailytask>>` and `<<togglers>>`

In the mean time you should use the $let-widget instead of the $vars-widget.

```
<$let x={{!!toggled}} y={{!!barray}}>
<!-- your macro call comes here -->
</$let>
```

Info: The backticks for the code here are only needed to be imported in the right way at talk.tiddlywiki.org
So you don't need them for your code.

arun babu

unread,
Jul 22, 2022, 3:20:13 PMJul 22
to tiddl...@googlegroups.com
Thanks PMario. It works now in the latest TW.

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/5q6J2tt7Yiw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/310d893b-9c72-43b1-a69d-b817f7e51eedn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages