How to display an alert at a predetermined time?

172 views
Skip to first unread message

Hubert

unread,
Apr 29, 2020, 9:42:36 AM4/29/20
to TiddlyWiki
Hi,

I'm trying to display alerts at predetermined times. I know that the alert mechanism will display alerts as long as they're tagged:

$:/tags/Alert

I'm also aware that the modified field of the alert tiddler is only used to order alerts on the screen. I've tested this by manually creating a tiddler and setting its modified date a few minutes into the future (doable by using $action-createtiddler with $timestamp="no" and modified="FutureUTCTimestamp"). However, the alert mechanism still displayed this future alert in the "present" while showing its modified "future" date.

Is there any way to make the alert mechanism delay displaying an alert if its field (the modified field or any other custom field, if possible) has a UTC timestamp set to the future?

Thanks for your help.

Regards,
Hubert

Peter Buyze

unread,
Apr 29, 2020, 11:15:24 AM4/29/20
to TiddlyWiki forum
How about recurring alerts/reminders?

--
Securely sent with Tutanota. Get your own encrypted, ad-free mailbox:


29 Apr 2020, 16:42 by hube...@gmail.com:
--
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 tiddlywiki+...@googlegroups.com.

Thomas Elmiger

unread,
Apr 29, 2020, 3:25:31 PM4/29/20
to TiddlyWiki
Hi Hubert and Peter,

@Peter: I have no other solution for recurring reminders than setting the new date manually when you are done.

@Hubert

At the time when I developed ToDoNow I had to build my own alert sytem that probably comes close to what you are looking for. See https://tid.li/tw5/tdn.html and click the double down arrow on the task in the Do section.

An alert should appear to tell you that this task is late. Click the stop watch to change the deadline and see what happens. My sytem assumes that you are working on the task in the Do section, so tasks placed there will not bother you with alerts.

I think someone else built a timer later on to trigger (other) alerts every few seconds or minutes, but my solution does not have that. I did not want to waste processing time while not looking at the screen. So my alerts are triggered by activity in the wiki only. A simple click anywhere should be enough in most cases.

The second weakness of my solution ist that time differences are rather guesstimated than calculated. Rather precise for deadlines close to now but probably wrong for deadlines far away from now. And maybe a bit wrong around midnight but we shouldn’t be working then anyway.

My solution was meant to be modular and reusable, so if you can borrow something from there you are very welcome (see the plugins):

* moments.js by Kixam
* datepicker plugin by Kixam

These are used to set the deadline in a field todo-deadline.

Reminders for ToDoNow is my plugin, stuff like the name of the field to watch is configurable.
For calculations my rpn plugin is necessary – this is from a time when TW filters were not able to calculate anything.

That’s all for now, might be others have better solutions.

Cheers,
Thomas

Mat

unread,
Apr 29, 2020, 6:23:17 PM4/29/20
to TiddlyWiki
I'm too tired to think clearly so I don't quite understand your request but I come to think of the following and just maybe something is relevant:
  • Maybe you can change the "environment" for a your think by means of the TiddlerWidget, making it think it is another time.
  • I have seen some kind of alert system created in TW and it was called "tickler" or similar
  • With 5.1.22, I think comparison ops were just added that should make it possible to compare dates
  • Master tiddleur Mark made some macro that calculates the time distance between two dates/times.
If this was all totally irrelevant... then good night. Well good night anyway.

<:-)

Hubert

unread,
Apr 30, 2020, 7:48:24 AM4/30/20
to TiddlyWiki
Thomas,

Thank you for your detailed response. I've come across your plugin in the past and I'm impressed. Great work indeed!

I'm not interested in timers or anything processing-heavy. Your solution that triggers the alert when the user is interacting with TW is perfectly suitable for me (I assume that the alert is triggered when the refresh mechanism fires, which again is triggered by user interaction).

I've had a look at the tiddler $:/plugins/telmiger/reminders/messages which is where, I believe, most of the logic happens. You've built it beautifully, but unfortunately it's not immediately obvious to me what "holds off" the alert from being displayed until, say, the double down arrow on the task in the Do section is pressed.

As you've noted, an alert can be triggered just by interacting with the TW (as long as the deadline is passed), which must imply that the alert is not triggered by an action in the button but that some re-evaluation of conditions must happen on a refresh cycle.

So far I see that it's impossible to both have a tiddler tagged $:/tags/Alert and not see it displayed as an alert immediately upon creation, because once so tagged, such a tiddler becomes an alert and so it must fire.

I have automated alerts that show on startup (if conditions are met) but this uses actions such as <$action-createtiddler/> (creating alerts on the fly) embedded in $reveal widgets that narrow down the conditions for displaying such alerts. But I can't fire such actions by merely interacting with the TW itself, so I can't create alerts on demand in this way without running <$action-createtiddler/> somewhere.

Apologies if this is too long winded & thanks for your time!

Regards,
Hubert

Hubert

unread,
Apr 30, 2020, 7:50:53 AM4/30/20
to TiddlyWiki
Mat,

Thank you for your suggestions. If I remember correctly, "tickler" was part of the PM solution named "Cardo". Unfortunately, "Cardo" appears to be offline at the moment, so I can't see how it was done.

Thank you,
Huberrt

Thomas Elmiger

unread,
May 3, 2020, 5:32:45 AM5/3/20
to TiddlyWiki
Hi Hubert,

Thanks for your kind words and sorry for the delayed response.

I'm not interested in timers or anything processing-heavy. Your solution that triggers the alert when the user is interacting with TW is perfectly suitable for me (I assume that the alert is triggered when the refresh mechanism fires, which again is triggered by user interaction).
Good to see you have the same preferences as me.

I've had a look at the tiddler $:/plugins/telmiger/reminders/messages which is where, I believe, most of the logic happens. You've built it beautifully, but unfortunately it's not immediately obvious to me what "holds off" the alert from being displayed until, say, the double down arrow on the task in the Do section is pressed.
I had to take a look again myself ... this is where the messages are generated according to user settings: either a reminder (don’ forget to ...) or an alert (did you really forget to ...?!) with slightly different styling to convey more or less urgency.
 
As you've noted, an alert can be triggered just by interacting with the TW (as long as the deadline is passed), which must imply that the alert is not triggered by an action in the button but that some re-evaluation of conditions must happen on a refresh cycle.
This is my magic trick: $:/plugins/telmiger/reminders/display is tagged $:/tags/TopRightBar and thus injected and always present in the top right bar. You are not able to see it, as it is hidden via CSS, but it is re-evaluated as you say with every refresh cycle. No need to set a tag here :)

After evaluating if alerting is active and setting the necessary variables, it creates a list for all tiddlers that have a deadline-field. The list item <li> will be empty as long as no message should be shown. When a deadline is near or a task is overdue, the result of the reminderCheck macro will be a reminder or an alert. The message will be visible until either the duedate is changed OR the task gets the tag ToDoNow:

<section class="te-reminders">
<ul class="te-list">
<$list filter="""[has
<field>tag<tag>!tag[ToDoNow]!sort<field>]""" variable="tiddler">
<li class="todo-item te-flex-item"><$macrocall $name="reminderCheck" reminder-field=<<field>> tiddler=<<tiddler>> reminderspan=<<span>>/></li>
</$list>
</ul>

The sorting should make sure the list is sorted according to urgency so a user can push the first task into the ToDoNow section and postpone the rest.

So far I see that it's impossible to both have a tiddler tagged $:/tags/Alert and not see it displayed as an alert immediately upon creation, because once so tagged, such a tiddler becomes an alert and so it must fire.
Tagging requires pushing a button as far as I am aware, so i did not use that.

I have automated alerts that show on startup (if conditions are met) but this uses actions such as <$action-createtiddler/> (creating alerts on the fly) embedded in $reveal widgets that narrow down the conditions for displaying such alerts. But I can't fire such actions by merely interacting with the TW itself, so I can't create alerts on demand in this way without running <$action-createtiddler/> somewhere.
Ïf this was a question, I hope it is answered now ;–)

All the best,
Thomas

Birthe C

unread,
May 3, 2020, 7:24:21 AM5/3/20
to TiddlyWiki
Thank you Thomas,

That was a very good and detailed explanation.

Birthe

Hubert

unread,
May 5, 2020, 6:46:28 AM5/5/20
to TiddlyWiki
Hi again Thomas,

Thank you very much for taking the time to share your mechanism in such detail!

I was able to reproduce your approach, which opens so many new possibilities :)

Thank you again, I really appreciate your help with this.

Best regards,
Hubert
Reply all
Reply to author
Forward
0 new messages