In addition to manually select single queries for triggers, it would be nice to be able to select a folder containing multiple queries, i.e. to trigger them collectively. I have had occasions where it was quite cumbersome to repeat/duplicate the same trigger over and over again.
Maybe this is an edge case, or maybe it's simply not worth looking into, but I think it could prove to be a useful feature for other scenarios as well.
From a technical perspective, this would essentially include the folders inside of the list of queries when a trigger is selected. When the trigger runs, the folder containing all of the queries are collected and executed.
Also, some other (small) UI feedback: I think the menu for the trigger could be simplified by renaming "Only run when" to "Condition" and then add "Only run when" as a placeholder. By doing so, you'd create more space for the individual fields (which are quite small and often truncate the query name).
Finally, and this is my last point, I promise, when it comes to managing the event handlers... aside from using the three dots to toggle the context menu, I would argue a right-click would initiate the same context menu, regardless of where your cursor is positioned.
Thanks for taking this feedback into consideration.
Hi @emozio! I'll break my response in three to touch on each request. Although I'll provide a workaround for the first one, I don’t mean to dismiss this requests by any means. This is great feedback! I’d like to see if the workaround is sufficient and evaluate the tradeoffs between the requested features and the workarounds.
Trigger Folder Queries
In order to trigger multiple queries by folder we can use JS. For example, let's imagine we have a products folder, where we keep all queries we need to run after some event. We can create a JS query "runProducts," where we trigger all queries in that folder.
We can then just trigger runProducts on any event handler, which would prevent having to set up N * M event handlers where N are the number of queries inside the folder and M the number of components where we need all these queries.
The biggest benefit of this workaround is that it gives us much more control in case we need to run that folder's queries synchronously, and/or control components after or before specific queries are triggered. The biggest tradeoff is that we do need to manually write the script out for each folder.
Truncated Query Names
Could you share a screenshot of how the query names are truncated? The dropdown should increase its size to fit longer query names:
The input field for the condition pops out if needed:
I guess you're right, running multiple queries would in fact be possible that way. I didn't consider that approach when I came across this issue. Thanks for the thoughtful response and clear examples.
Still, I think allowing folders to be selected could potentially be a nice feature, but I understand if that is not something critical, but rather a nice to have (perhaps for those people who are not that familiar with scripts - then again, is that even a target group? ;-)).
As far as truncating the table names goes... that was primarely related to the name whenever the select box is closed. I figured is was due to the relatively large label width of each option. Therefore I suggested to shorten the "Only run when" to "Condition" to accomodate for that.
The last point related to right-clicking to toggle the menu is right. There are cases across the UI, including that one, that don't seem to open using right-click. I think that could be more consistent, IMO.
You're welcome, and thank you for elaborating on your request! We've created an internal FR and will update you here with any news. In the meantime, we'll also be actively gathering +1s.