@mark s; great, my pleasure!

If you are going to use the command palette
<https://souk21.github.io/TW-commandpalette/>, maybe I can share a few
observations about it:
- the search steps system is a clever and flexible solution to give the
users control over the search results through the
$:/plugins/souk21/commandpalette/CommandPaletteSearchSteps tiddler. The
order of the results is specified by the order of the steps in json
configuration (I pasted a sample config in a previous reply), and the hint text
provides information about which of the steps returned a match. The caret value
is the position of the search term within the step's filter expression.
During the generation of search results, the plugin code inserts the search
term at the position specified by the caret. If you make changes to the
filter expression, you need to verify that the caret position is still
correct, else that step will be broken and not return any result. I use
notepad++ <http://notepad-plus-plus.org> to figure it out, by pasting the
filter expression into a new document, placing the cursor where the search
term should be, and subtracting one.
-  If you make changes to the search steps, you will need to refresh the
command palette to have them re-loaded with your changes. You can refresh
the command palette from the command palette itself.
- I choose to disable the history at the top of the search results. You can
do so in the $:/plugins/souk21/commandpalette/CommandPaletteSettings
tiddler (or through the command palette itself)
- as alluded to previously, I am interested in improving the plugin so that
different ways to invoke the command palette would use different steps
definitions. This would allow the user to map different key strokes to
different search modes.


In your earlier note, you suggested you wanted to see search results in
their context. I am not sure if you have been able to achieve that with the
command palette. In any case, with some work, I have managed to bring out
the Context Search tab of the advanced search system using a single
keystroke (that does not fire when you are in a text field) using mousetrap
<https://welford.github.io/#$:/plugins/welford/twmousetrap>. It was
surprisingly more challenging than expected. For one thing, it feels like
Danielo's ContextSearch plugin <https://contextplugin.tiddlyspot.com>
predates some important improvements to the advanced search system in
TiddlyWiki. For my solution to work (particularly, getting the search text
field to focus correctly upon typing the keystroke), I had to modernize it.
Secondly, it is a bit tricky to trigger TW actions from the mousetrap
javascript
context (at least it is to me): some actions work and others not so well
(e.g navigate). I ended up having to use action-listops on the $:/StoryList
to bring up the advanced search system, for example, which is probably not
recommended. I can share details here if you were interested. Please note
it is also possible, and significantly simpler, to use the native keyboard
shortcut system in TiddlyWiki with key combination (e.g. ctrl+alt+A) if
that is sufficient, instead of mousetrap.

With that, have a great weekend everyone!

On Fri, 23 Jul 2021 at 08:26, maki aea <[email protected]> wrote:

>
> thanks @fred that really helped me, using it right now, it's great!
> On Friday, July 23, 2021 at 1:03:30 PM UTC+1 [email protected] wrote:
>
>> @mark S
>> the screen caps shown in my previous reply do not use the Command Palette
>> <https://souk21.github.io/TW-commandpalette/>. I think the Command
>> Palette user interface is not well suited for your need to show the search
>> results in context. It is probably best in your case to setup a keyboard
>> shortcut to bring out the context search
>> <https://contextplugin.tiddlyspot.com> directly. I don't yet know how to
>> do that, but will explore.
>>
>>
>> To answer your question however, I have this mousetrap config to bring
>> out the Command Palette in the
>> $:/plugins/fastfreddy/twmousetrap/example.js tiddler (I repackaged
>> mousetrap slightly).
>>
>>  $tw.Mousetrap.bind("/",
>> function() {
>>             $tw.rootWidget.invokeActionString('<$action-sendmessage
>> $message="open-command-palette"/>',$tw.rootWidget);
>> },
>> "keyup"
>> );
>>
>>
>> On Fri, 23 Jul 2021 at 07:40, maki aea <[email protected]> wrote:
>>
>>> @fred nice! would love to know how you fire command palette with /, do
>>> you simulate ctrl+p or do you call it directly? i'm able to bind another
>>> key using mousetrap (remembering to save and reload tiddlywiki for the
>>> changed javascript to kick in) but am having trouble calling command
>>> palette using KeyboardEvent to simulate ctrl+p. would really appreciate any
>>> pointers on how you do it!
>>>
>>> warmest wishes, maki
>>> On Friday, July 23, 2021 at 12:15:59 PM UTC+1 [email protected] wrote:
>>>
>>>> @ walt; github and gitlab are near equivalent and I use both. Each have
>>>> slightly different offerings when it comes to their Pages options (that is
>>>> serving content for web hosting based on a git repo check in) and some of
>>>> that varies with paid subscriptions.
>>>>
>>>> I have chosen gitlab for my personal TW notebook (my regular workflow
>>>> works exclusively with the gitlab saver, as I can't install a desktop
>>>> client or a server at work. I can however use gitlab saver from both home
>>>> and work, so that works best).
>>>>
>>>> Gitlab is the only one of the two that allows me to lock down (to me)
>>>> the notebook that is offered as a webpage, as hosted content. In Github,
>>>> hosted content (Github Pages) can only be wide-open, public, unless you are
>>>> a paid subscriber.
>>>>
>>>> Gitlab however has a continuous integration (CI) pipelines that need to
>>>> run and "generate" the page, which takes a few minutes, before the URL of
>>>> my notebook reflects the updated content. I use quotes around "generate",
>>>> because in the case of a TW notebook, there is really nothing to do, just
>>>> serve the HTML I checked in. Gitlab's approach however allows devs to have
>>>> complex pipelines that actually transform templates into the HTML page they
>>>> wish to serve out. This drawback is an issue for me only if I need to
>>>> reload the notebook; I have to make sure I wait until the pipeline has done
>>>> its job otherwise I would overwrite my changes. Github on the other hand
>>>> serves the checked-in HTML immediately. The moment you upload (git push) a
>>>> new notebook, it is that content which is served as a web page. It would be
>>>> better, if I could lock it down, for my personal notebook. It is more
>>>> immediate, but less powerful than Gitlab's approach in that sense, though
>>>> there may also be an option for devs to pass checked in code through a CI
>>>> pipeline first, I have not looked into it.
>>>>
>>>> All that to say, because I use gitlab for my personal notebook, it was
>>>> a natural choice for me to stand up a new project alongside of it for my
>>>> first plugin (with permissions open). The CI pipeline however means that I
>>>> have to wait a few minutes, after I check in my new code, before I notify
>>>> everyone of the new content, otherwise folks would see old content.... In
>>>> terms of publishing a plugin, Github would have been better because the
>>>> Github Pages hosting is instantaneous and I don't need the ability to lock
>>>> it down.
>>>>
>>>> On Fri, 23 Jul 2021 at 07:15, Frédéric Demers <[email protected]>
>>>> wrote:
>>>>
>>>>> @ mark thanks for the clarification; that is helpful. I think in
>>>>> general, the search filters are quite powerful and there are a few options
>>>>> already that will show the search results in context (not necessarily the
>>>>> first 100 characters of a match, but the text around the match as well,
>>>>> with highlights. Here's one example (Danielo's context search
>>>>> <https://contextplugin.tiddlyspot.com>), but I believe there are
>>>>> others.
>>>>>
>>>>>
>>>>> [image: image.png]
>>>>>
>>>>> This is not incompatible with Streams as it is (you can see the
>>>>> results above show node tiddlers), but I suppose you would be interested 
>>>>> in
>>>>> having a link to the root tiddler directly? That is easily doable with a
>>>>> very small change in the plugin's "Context Search" tiddler, leveraging the
>>>>> powerful filtered transclusions and Saq' get-stream-root[] fitler
>>>>> operator.
>>>>> from
>>>>> ...
>>>>> <$list
>>>>> filter="[!is[system]search{$:/temp/advancedsearch}sort[title]limit[250]]">
>>>>> {{!!title||$:/core/ui/ListItemTemplate}}
>>>>> <$context term={{$:/temp/advancedsearch}}/>
>>>>> </$list>
>>>>> ...
>>>>> to
>>>>> ...
>>>>> <$list
>>>>> filter="[!is[system]search{$:/temp/advancedsearch}sort[title]limit[250]]">
>>>>> {{{ [<currentTiddler>get-stream-root[]] ||$:/core/ui/ListItemTemplate
>>>>> }}}
>>>>> <$context term={{$:/temp/advancedsearch}}/>
>>>>> </$list>
>>>>> ...
>>>>>
>>>>> after the change, you will note:
>>>>>
>>>>> [image: image.png]
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Fri, 23 Jul 2021 at 05:22, ludwa6 <[email protected]> wrote:
>>>>>
>>>>>> Nice work, @Fred (and quick! now i know where the "FastFreddy"
>>>>>> moniker [1] comes from :-).
>>>>>> Streams-fusion plugin now ticks all the boxes, with no bugs, AFAICT;
>>>>>> will be testing this heavily through actual use over weekend.
>>>>>>
>>>>>> [1] Re your choice of hosting this project at fastfreddy.gitlab.io :
>>>>>> i wonder why you've chosen this option over ...github.io?
>>>>>> I ask because my workflow for collaborative development ATM is based
>>>>>> at github.io, but -as it is still early in the game for me- i wonder
>>>>>> if maybe i shouldn't consider this gitlab alternative... ?
>>>>>>
>>>>>> /walt
>>>>>>
>>>>>>
>>>>>> On Friday, July 23, 2021 at 3:29:25 AM UTC+1 [email protected]
>>>>>> wrote:
>>>>>>
>>>>>>> @walt released 0.0.3-beta
>>>>>>> https://fastfreddy.gitlab.io/streams-fusion/   not thoroughly
>>>>>>> tested, be very careful and clone/backup extensively....
>>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to a topic in
>>>>>> the Google Groups "TiddlyWiki" group.
>>>>>> To unsubscribe from this topic, visit
>>>>>> https://groups.google.com/d/topic/tiddlywiki/-xTFWPwzq6g/unsubscribe.
>>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>>> [email protected].
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/tiddlywiki/cdf65dc7-e0f4-4083-ae28-ccb9fbea2330n%40googlegroups.com
>>>>>> <https://groups.google.com/d/msgid/tiddlywiki/cdf65dc7-e0f4-4083-ae28-ccb9fbea2330n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "TiddlyWiki" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/tiddlywiki/-xTFWPwzq6g/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> [email protected].
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/tiddlywiki/73dda5cc-a04d-4f13-b2fd-58939509ca20n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/tiddlywiki/73dda5cc-a04d-4f13-b2fd-58939509ca20n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "TiddlyWiki" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/tiddlywiki/-xTFWPwzq6g/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/614fbc83-f1a2-4719-aa94-c1310e5ab092n%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywiki/614fbc83-f1a2-4719-aa94-c1310e5ab092n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CAAY2DnPPPLasGA4wjPpv6NoGUGt2XzOTAs2diceJrYWTimYLLw%40mail.gmail.com.

Reply via email to