-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce global "Filtered Actions" that are invoked when a filter evaluates to a non-empty result #7999
base: master
Are you sure you want to change the base?
Conversation
… it is in the story river
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -0,0 +1,7 @@ | |||
title: $:/plugins/tiddlywiki/tour/filtered-action | |||
tags: $:/tags/FilteredActions | |||
filter: [{$:/config/ShowTour}!is[blank]else[show]match[show]then[$:/state/tour/step]get[text]get[step-success-filter]] :map[subfilter<currentTiddler>] :filter[<currentTiddler>!match[]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm. I'm not sure what this filter does, so I doubt users will be able to create something like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would agree that complex filters are complex, but I don't know how that relates to this PR.
While working with For example, a tiddler is meant to show data retrieved via a HTTP request. At present the best I can do is either ensure that the user navigates to this tiddler only via a button that triggers the request and the navigation simultaneously, or by adding a button along the lines of "click here to load the data" on the display tiddler, neither of which is palatable. So I am having to resort to using a modal so that I can control how the display of this part of this interface is initiated and also trigger the HTTP request. It would be much more preferable to have the presence of the tiddler in the story river be the trigger for the HTTP request. |
Would it be possible to trigger actions at a certain time (like what |
This PR introduces a potentially highly dangerous new feature: the ability to execute action strings whenever a filter expression evaluates to a non-empty result.
A filtered action is a tiddler with the tag
$:/tags/FilteredActions
, and afilter
field containing a filter expression. The actions are taken from thetext
field.It is useful for automating actions. As an example, this PR amends the Tour plugin so that the user no longer needs to click the "next" button to advance to the next step.
To try a demo:
However, the danger is that it is very easy to set up a filtered action that is invoked continuously.
The system currently throttles filtered actions so that they occur no more often than every 500ms, which avoids the thrashing that would occur if the actions were allowed to occur as rapidly as possible.
I think the design may need to refined. For example, I wonder if the throttling should apply to individual filtered actions, rather than the whole set. It is also possible that we might avoid accidental thrashing if we only triggered a filter action the first time it returns a result, and ignore repeated results after the first one.
Progress
step-success-filter-var
feature of the Tour plugin)