Proof of concept: Auto-completion for filters

80 views
Skip to first unread message

bimlas

unread,
Jul 21, 2019, 6:07:02 AM7/21/19
to TiddlyWiki
Dear all,

In order not to keep the names of all filters in mind, I started to implement an auto-completion for the filters. For the time being, it is primitive because it is based on the title of the filter tiddler, so if, for example if "mycoolfilter[]" filter is defined in "$:/my/filters/myawesomefilter.js", then "myawesomefilter" will appear in completion. Clicking on completion elements will not complete the text, but at least list what to type.


What do you think about this, should I continue or is it an unnecessary function?

Watt

unread,
Jul 21, 2019, 7:39:51 AM7/21/19
to TiddlyWiki
Hi Bimlas
Anything that helps remember the many possibilities is good.

Maybe a 'show all' option would be good? If I don't know a filter exists I won't search for it.

Maybe a toggle switch between 'autocomplete' and 'link to docs'? Some users still learning (me) need to see what a filter does. Advanced users need autocomplete. Or an info pop-up?

The autocomplete would be most useful in edit mode for me I suppose but I've no idea how you'd achieve that. An expanding edit bar button? Failing that a copytoclipboard option might work. Is it possible to float the lookup in a side-editor style window?

Anyway, thumbs up for its utility. Could make a great tool.

bimlas

unread,
Jul 21, 2019, 3:00:39 PM7/21/19
to TiddlyWiki
Watt,
 

Maybe a 'show all' option would be good? If I don't know a filter exists I won't search for it.


Planned, I hope, I can do it.
 

Maybe a toggle switch between 'autocomplete' and 'link to docs'? Some users still learning (me) need to see what a filter does. Advanced users need autocomplete. Or an info pop-up?


I definitely want to implement it, I agree with the idea.
 

The autocomplete would be most useful in edit mode for me I suppose but I've no idea how you'd achieve that. An expanding edit bar button? Failing that a copytoclipboard option might work. Is it possible to float the lookup in a side-editor style window?


What do you want to add code-completion to: tiddler titles or filters in tiddler text? If for title, try drag-n-drop tiddlers into textarea.

bimlas

unread,
Jul 21, 2019, 3:01:16 PM7/21/19
to TiddlyWiki
Update: Selected completion applies to filter expression

Watt

unread,
Jul 21, 2019, 3:22:35 PM7/21/19
to TiddlyWiki
The update works here. A little twitchy, it needs the first square bracket and a bit of tapping inside and outside of the text box but it autocompletes. Nice!

For me being able to get the filter to appear at the cursor in the text edit area would be the ideal but that sounds like a tall order. Drag and drop don't work for me on a phone. 'Copy to clipboard' would do the job, maybe not too difficult to achieve?

It's looking good though Bimlas, others will come up with more feedback I'm sure.

bimlas

unread,
Jul 21, 2019, 6:02:28 PM7/21/19
to TiddlyWiki
Update: Add link to documentation of operators in the completion

It's uggly, but at least working. How do I open an external link by a button? And why doesn't the link with completion appear in the same line?

Mat

unread,
Jul 21, 2019, 6:11:20 PM7/21/19
to TiddlyWiki
@bimlas

I like auto completion very much but I doubt I would ever use it for such a limited case.

Could the same mechanism be used for this matter, i.e a general popup tool in the text editor? Also have a look at this cutie.

<:-)

Watt

unread,
Jul 22, 2019, 4:18:41 AM7/22/19
to TiddlyWiki
The update with info links is working here Bimlas. Good stuff. Maybe set the docs links to open in a new tab? Or a pop-up so we don't have to leave the page? (Maybe not so mobile friendly though).

It definitely encourages use of the docs and discovery of filter operators I might be a bit fuzzy about, so it already works just on the educational level.

Getting the chosen filter into the edit text area sounds tricky but maybe 'copy to clipboard' would be enough?

There are lots of TW users all with different levels of ability so anything that helps reveal the mysteries is valuable.

Those @Mat links are great. Have you got that balloon block editor working Mat?

Reply all
Reply to author
Forward
0 new messages