Auto Complete plugin 1.0.15 - Complete tiddlers, fields and your dreams

For me it worked

Suggestion Filter: [all[tiddlers]!sort[modified]limit[1]get[modified]format:date[0DD-0MM-YY 0hh:0mm]]

Display Filter:
[<currentTiddler>]

Template:
" d:$option$ "

3 Likes

A slight modification to @vyug18’s idea:

Suggestion filter: [<editedTiddler>get[modified]format:date[YYYY0MM0DD]] – should be slightly more performant, if you only need date, not time. I takes the modified date time of the current draft, so unless you start editing before midnight and insert timestamp after, it will be correct I guess.

Here is a complete trigger tiddler, ready to use, with trigger ddd:
$__EvidentlyCube_Trigger_CurrentDate.json (397 Bytes)

Edit: the modified field of the <editedTiddler> seems to be updated all the time on every edit to the draft, not just upon creating the draft. So this solution works also if one needs time in their timestamp.

1 Like

For this, I would absolutely go with Dynamic Rubber Stam by @Mark_S. I believe for this use case rubber stamp is more suitable and AutoComplete use case is different.

1 Like

thank you all very much @vyug18 @vilc @Mohammad ! i went with @vyug18 's solution as it was most appropriate for my needs on mobile; i tried to make it a wiki article but could not find a way to move it to a more appropriate place (tips & tricks?) thanks again, it’s really helped my workflow!

2 Likes

Life has its way of being annoying and taking you away from the important things.

Version 1.0.18 is out:

  • Fixed RSOD in TW 5.3.0+ caused by new API not being supported
  • Fixed RSOD when earlier keyup causes the focus to be changed – can be triggered by setting sidebar-search shortcut to the same key as manually triggering auto complete.

@Scribs The first part fixes the issue you reported here – this was caused by internal API changes introduced in TW 5.3.0

@vilc The second part fixes the issue you reported here – this was caused by the Sidebar Search shortcut having higher priority, which would cause focus to be lost, which would reset some variables (but not all) which was the source of the issue. It just gracefully cleans itself, I don’t believe there is a way for me to prevent the Sidebar shortcut (nor I am confident I’d like to do it anyway). Don’t share your shortcuts! :smiley:

4 Likes

@Maurycy I have found an inconsistency. I’m not sure it’s a bug, since I don’t know if this feature is supposed to be supported. And there’s an easy alternative in my use case anyway.

I need to use the regexp operator with a regular expression containing the character class/ range [a-z] in its parameter. In this case the the parameter cannot be literal regexp[[a-z]].
I tried the solution indicated in TW docs, that is to use a variable. I defined a global macro (tagged with both $:/tags/Macro and $:/tags/Global just in case) with the regex.
Using regexp<myMacro> (just a part of the filter ofc) yields this strange result:

  • “Test the filter” table in the trigger config shows proper results (in my case all titles starting with lowercase, by using regex ^[a-z])
  • Using the filter “in the wild”, it looks like the macro simply doesn’t work/ evaulates to nothing, or as if regexp[] was used.

I ended up using a data tiddler regexp{dataTiddler##property} and it works well everywhere. Same with field transclusion regexp{tiddlerWithFields!!field}.

Just wanted to let know. It’s not actually a problem for me, since I found the alternatives.

Edit: I’m using TW v5.3.1 and AC v1.0.18

1 Like

Whoops. That’s both a bug and expected behavior. The completion API runs with a faux base widget so it has no access to globally defined macros and variables, done mostly for simplicity of the codebase than for any other particular reason.

This should be fixed at some point for sure and I’ll take a note of this problem but no promises when this gets fixed. Glad you’ve got a good workaround!

I don’t know how I went this long without knowing this plugin existed. I needed this so bad I was considering making something like this myself.

As a community, TiddlyWiki really needs to work harder at improving plugin visibility.

4 Likes

Version 1.0.19 is out:

  • Registered triggers in the settings now display without any accidental parsing (this was reported in private)
  • Fix extraneous offset when using a theme that has left-top offsets/margins

@HistoryBuff This fixes the issue you’ve reported in this thread.

I’ll look into this issue in the following days!

Thanks for waiting for the update!

3 Likes

Thanks very much! Much appreciated!

I really like Autocomplete thank you.

For your info:
I plan to turn the instalation of autocomplete into a Bookmarklet I can install on any wiki with a click, using my tools here

  • This means I can also include my customisations which I spent sometime developing and seemed quite intuitive to me, which I can share.

An aside/question.

With your set of susearch utilities I searched your site Evidently Cube TiddlyWiki5 Plugin Showcase — All the TW5 plugins developed by me! but could not answer the following Question?

What is the prefix of SU stand for if it were expanded, “search utility”?

2 Likes

I believe I intended them to stand for super but at this point I am not 100% sure :).

Version 1.0.20 is out:

  • It fixes a bug introduced in the previous version where scroll was applied twice which caused the completion window to go wild if page was scrolled at all (Thanks vilc)

Also I enabled on the repo automatic tests on commit which were once 98% done so should a similar silly issue happen again I’ll at least be quickly notified by it. Hopefully.

4 Likes

I have a trigger to display Bootstrap Font icons like bi-globe. When selecting bi-camera, the inserted text will be:

<i class="bi bi-globe"></i>

Everything functions as expected, BUT

In the dropdown list, I would like it to show:

:globe_with_meridians:: bi-globe

My question is: Does the display filter present rendered text or plain text?
In my case I need rendered output. As the globe icon will be displayed by <i class="bi bi-globe"></i>


Additional data:

Suggestion filter:

[[$:/EvidentlyCube/DataTiddler/FontIcons]get[text]split[,]trim[]] +[search:title<query>] 

Display filter:

'<i class="bi $(currentTiddler)$"></i>' +[substitute[]]

Template:

<<fb $option$>>

For testing:

tiddlers.json (36.2 KB)

1 Like

To copy over the conversation from github issues - the problem with this is it’ll now parse anything that looks like HTML or wikitext. Unlikely to be a big issue when used for only displaying tiddler titles (since I doubt many people use HTML or special characters in a way that could be parsed as wikitext in titles) but for anything else it could lead to issues; eg code snippets.

I think a decent solution would be to have it as a per-trigger option whether to display as raw text or to parse wikitext but that’s a bit more work than I currently have time for.

1 Like

please ignore the following message for now. I will write something more relevant in a new topic whenever I have time

tl;dr There seems to be some incompatibility between Autocomplete and TiddlyFlex.

Dear @Maurycy, I tried to install your Autocomplete plugin on my wiki (v. 5.3.8) today but I have trouble getting it to work. I followed the following steps:

  1. Install by drag and drop like any other plugin, from your demo website
  2. Save, reload and check that the plugin is enabled
  3. Go to the Evidently Cube tab in the Control panel
  4. Create the new default trigger ([[). When I click the Create a new trigger button, the tiddler $:/EvidentlyCube/Trigger/1is indeed created but I don’t get the graphical panel you show on your first post under the title “Customizing a trigger”. I just get a tiddler with a blank text field, so I see nothing in view mode.
  5. After defining the new trigger, saving and reloading, I test the autocompletion in a new tiddler and it doesn’t work: entering [[ does nothing, even after pressing Ctrl+Space

Note that I tried the same procedure on the TiddlyWiki.com wiki and it indeed works.

Actually, I found out that the culprit is the TiddlyFlex plugin/layout. Autocomplete works as expected when I disable TiddlyFlex.

I hope I am clear about what I have done and I would be grateful if your could help me.

Too late. Already investigating it :D.

The autocomplete window tiddler is injected by using $:/tags/PageTemplate tag and it seems TiddlyFlex never imports tiddlers tagged with that anywhere - I modified window.tid in the plugin with some random text that’s always visible and it shows up in the default layout but not in TiddlyFlex. Which means it’s never transcluded.

You can see it here, I opened TiddlyFlex’s homepage and added a new tiddler with the appropriate tag (see at the bottom, there is only one match on the page):

And as soon as I change the layout to the default one there are two matches:

So it’s definitely the fault of TiddlyFlex in this case :).

Edit: although it’s possible that it’s a case of bad documentation and $:/tags/PageTemplate tag is only meant to be part of the default layout, allowing other layouts to do whatever they want. I am trying to find if TiddlyFlex has any similar tags that I could just slap on the auto complete window tiddler to make it work.

1 Like

Auto Complete 1.0.23:

@alanc Once the page rebuilds you should be able to update Auto Complete and it should work with TiddlyFlex!

1 Like

Dear Maurycy,

Thank your for your reactivity. Now, Autocomplete works, but it seems that I still can’t get the graphical panels for defining new triggers more easily (see below).

P.S. I can confirm that it works as expected when I disable TiddlyFlex. A workaround would be to disable TiddlyFlex when setting up Autocomplete and re-enabling it afterwards.

Once again, thank your for your amazing work

I’ll take a look at it tomorrow :).