Plugin prototype: Command Palette

1,101 views
Skip to first unread message

Souk21

unread,
Jun 10, 2020, 1:31:24 PM6/10/20
to TiddlyWiki

Hello everyone!


I discovered TiddlyWiki a couple weeks ago, and I set myself to use it for note taking.
I really enjoy the trip so far, it really is a interesting piece of software.
The only thing missing for me is a proper way to search with the keyboard only.

There’s a shortcut to focus the search field, but unfortunately, you can’t navigate the results with the arrows, and you can’t close the dropdown with escape.


I looked around for a plugin, but I wasn’t able to find any that worked for me.
So, in a tiddlywiki mindset, I decided to try and make my own.
I took a lot of inspiration from VSCode command palette.
By default you open it with Ctrl+P, but you can change the shortcut from the tw settings
You can search tiddlers by text or with a filter expression, search tags, list all tiddlers with a tag,...
If you type ‘>’ you enter the ‘command’ mode and you can select (or search) from a list of commands.
You can access help if you type '?'


I tried to make it the more customizable I could, there’s still work but it’s already quite customizable. Most of the commands are only tiddlers!
It’s a prototype, and my first tw plugin as well, so obviously the code is a mess! It could have unexpected behavior (most probably does) and you shouldn’t use it in your own wikis yet!


I tried my best, but for now, the plugin is not really working as tw expects plugins to.
The plugin always returns ‘refresh=false’ and manages his own DOM itself, storing state inside of it in the way.
I was not sure where to ‘instantiate’ the view, so for now I’m using $:/View/AboveStory which I believe is not ideal.
So yeah, really not the tw way.


There are still some other problems, I’m not sure how to escape a filter operation parameter for example so the search sometimes returns errors

Obviously it’s not really optimized yet either.

I do plan to fix it and include more features (I still have a tiddler full of ideas)


I’m posting here to see what people think of this prototype and if there’s any interest in such a plugin.

If so, I’m probably gonna need some guidance into how things are supposed to work so I can make it work more nicely with tw.

Considering the state of the project, I didn’t take the time to write any doc yet.



Let me know :)

Saq Imtiaz

unread,
Jun 10, 2020, 1:44:34 PM6/10/20
to tiddl...@googlegroups.com
@Souk21 welcome to the group and thank you for sharing!

I will take a detailed look later and will provide feedback, I too prefer keyboard based solutions later. At first glance it looks good!

On the technical side if you have specific questions, feel free to post a list. 
State in TW plugins is managed via tiddlers, usually $:/state/* tiddlers

Note that there is a pull request that will hopefully be merged for the next version of TW, that adds keyboard support to the search field and the tag picker. Might be some useful code and patterns to look at and learn from there.



Regards,
Saq

Saq Imtiaz

unread,
Jun 10, 2020, 1:52:49 PM6/10/20
to TiddlyWiki
OK played with it for a few minutes and so far I love it. 

It is a souped up version of a search solution I use in one of my wikis.

Would love to be able to:
- add custom commands
- choose which commands to show and which to hide


On Wednesday, June 10, 2020 at 7:31:24 PM UTC+2, Souk21 wrote:

Souk21

unread,
Jun 10, 2020, 2:24:56 PM6/10/20
to tiddl...@googlegroups.com
Thank you!
For custom commands you can have a look at tiddlers tagged $:/tags/CommandPaletteCommand (you can type '@$:/tags/CommandPaletteCommand' in the command palette to list them)
There's five types:
- prompt: use tiddler's text as a command in the command palette
- prompt-basic: same but doesn't show the text of the command
- actionString: execute the text of the tiddler as tiddlywiki/text
- message: used for 'tm-' messages
- history: chose a tiddler and use it as a parameter for a 'tm-' message

I'd really like to extend that to allow more flexibility in customization.
What kind of commands would you like to add?

BTW, if you create one, you can refresh the palette with '>Refresh command palette'

About showing and hiding commands, it's a nice idea, I'm gonna add it to the list :)

Thanks again

edit: Thank you for the link to the tag-picker/search! Looks nice. It asks if I want to cancel a tiddler when I'm trying to close the tag dropdown with escape though. But it's definitely gonna be a good addition to the core

Mohammad Rahmani

unread,
Jun 10, 2020, 3:08:57 PM6/10/20
to tiddl...@googlegroups.com
Hi souk21,
This is really interesting! Thank you for sharing!
I just tried and found it very powerful!


Best wishes
Mohammad


--
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 tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/558ff87a-a6f6-47a9-b0e5-4d0b2714569bo%40googlegroups.com.

Mohammad Rahmani

unread,
Jun 10, 2020, 3:41:19 PM6/10/20
to tiddl...@googlegroups.com
A small Bug

1. ctrl+p
2. type Nella  (or anything you are sure does not exist in the wiki)
3. press enter

The red error window appears



Best wishes
Mohammad


On Wed, Jun 10, 2020 at 10:01 PM Souk21 <soufy...@gmail.com> wrote:
--

TiddlyTweeter

unread,
Jun 10, 2020, 3:53:43 PM6/10/20
to TiddlyWiki
Looks very interesting!

TBH, I don't think the name is right as "Palette" in TW has been used so far for COLOR. 
TW has a sophisticated system for color palette manipulation.

TBH, on First look I thought that was what it was about! :-) and got confused.

Now I better see what it is! Very interesting indeed.

Could you name it a different way?

TT

Mohammad Rahmani

unread,
Jun 10, 2020, 4:23:19 PM6/10/20
to tiddl...@googlegroups.com


Best wishes
Mohammad


--
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 tiddlywiki+...@googlegroups.com.

Mohammad Rahmani

unread,
Jun 10, 2020, 4:24:05 PM6/10/20
to tiddl...@googlegroups.com
One more comment
The history only shows tiddlers not searched filter like [tag[HelloThere]]


Best wishes
Mohammad


On Wed, Jun 10, 2020 at 10:01 PM Souk21 <soufy...@gmail.com> wrote:
--
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 tiddlywiki+...@googlegroups.com.

Souk21

unread,
Jun 10, 2020, 4:34:18 PM6/10/20
to TiddlyWiki
@Mohammad Woops! Thank you for the bug report, it's fixed now! You can try it on the demo page :)


Le mercredi 10 juin 2020 21:41:19 UTC+2, Mohammad a écrit :
A small Bug

1. ctrl+p
2. type Nella  (or anything you are sure does not exist in the wiki)
3. press enter

The red error window appears



Best wishes
Mohammad


To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

TiddlyTweeter

unread,
Jun 10, 2020, 4:36:16 PM6/10/20
to TiddlyWiki
I agree, its actually a neat term in context of Visual Studio.

But it will cause confusion in TW because of our use of color palettes. 
It sounds like its a Commander FOR color palettes; rather than a palette OF Commands.

Best wishes
TT
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

Souk21

unread,
Jun 10, 2020, 4:41:57 PM6/10/20
to TiddlyWiki
@Mohammad Didn't think about filter history, thanks! Added to the list :)

@TiddlyTweeter I'm not too attached to this name. If it's confusing and there's better ideas I'm definitely up to change it.

Mohammad Rahmani

unread,
Jun 10, 2020, 4:55:32 PM6/10/20
to tiddl...@googlegroups.com
Thanks Souk21!

I confirm the issue has been resolved now!

I am sure this plugin will get alot of attention! So hackability, customization are recommended!
Keep it simple for use! I love it!


Cheers
Mohammad


To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/98ff8a7e-1602-486a-b1ba-038df8521f05o%40googlegroups.com.

TiddlyTweeter

unread,
Jun 10, 2020, 5:04:27 PM6/10/20
to tiddl...@googlegroups.com
'@TiddlyTweeter I'm not too attached to this name. If it's confusing and there's better ideas I'm definitely up to change it.

Command Picker? That seems to fit okay? Stress on activity of picking a command to do something. 

Its a neat tool, bringing together common actions in a simple interface with user ability to add new actions.

Best wishes
TT

 

David Gifford

unread,
Jun 10, 2020, 7:57:05 PM6/10/20
to TiddlyWiki
Yeah I got all excited about it being something for color palettes. I agree the name needs changing.

TonyM

unread,
Jun 10, 2020, 9:05:24 PM6/10/20
to TiddlyWiki
Souk21,

Thanks so much for sharing this. I think it is superb, the more hack-able you can keep it the better as I can see many potential applications, why build them all yourself when others will do it for you?

The idea is to permit extensibility while keeping it as close to standard tiddlywiki features as possible, the tool could then make substantial contributions to many existing and future solutions.

A Wonderful discovery I just made, is any drag-able link can be dropped into your, and the standard search field, saving typing when the content is available. Copy paste is the same (of course) emphasising the value of being able to copy results to the clipboard.

Some ideas, please don't be overwhelmed, just inspired,
  • Done the right way the community can build a library of "commands" that are practical for any user, and or designer and we can share them saving development time. Can we make it respond to existing methods?
  • I see value in more than one operating mode, a limited set of commands for one user/wiki mode, more for another, just to keep it simple and controlled, and not too big a list when not needed.
  • It would be nice to find alternatives for most node js tiddlywiki commands (where relevant)
  • It would be nice, on generating a list from a search, or filter, to be able to copy the title, the list of tiddlers or the content of a tiddler to the clipboard so we can rapidly acquire content from elsewhere in the wiki. Helping users, authors, coders, designers.
  • Being able to write commands that interact with the server such as bob would be nice. Using a server message.
  • How can we deal with passing other parameters?
  • Could we get this to past the resulting "command" into edited text fields for quick coding from stored patterns. Perhaps even a separate but similar tool
  • On TiddlyDesktop the actions and links can actually open file explorers, apps and run batches, interacting with the local OS, so there is great potential for desktop management tools or text based search and execute. Work flow tools that help actually do the work.
  • The problem with actions in tiddlywiki is they always need a trigger, if the act of searching for that action in the first place, also provides the trigger to its execution you have really improved the interface, big time.
  • Perhaps it is already possible but I would love to be able to type say showcode and clicking the result would set a tag, field or config tiddler to yes for a given tiddler (currentTiddler) we have methods to identify the current tiddler navigated from. 

In a related project of mine, I have created a tool called "search indicators", which monitors the standard temp search field and presents a set of icons depending on the content, specifically the prefix, a little like your tool, I mention this because they could exchange features. I am yet to fully understand your features, but here is a list of the current methods under development. You can see how it is quite similar. Think the idea of the appearance of buttons and or keystrokes according to conditions may help keep your solution from looking too complex. I think you have some of these covered.
  • Detect filters with a leading [
  • Detect system tiddlers with a leading $
  • Detect macros or variables with a leading << optionally show its value.
  • Detect html with a leading < only
  • Detect and search for hash tags in text with a leading #
  • Detect if the string is the prefix for other tiddlers
  • Detect if the string is the suffix for other tiddlers
  • Detect if the string is the title of an existing tiddler, eg system tiddler even if the standard results exclude system tiddlers
  • If the tiddler title exists, offer open, edit, open in new window buttons
  • Detect if the string is found in a keywords field
  • Search a specific field in system tiddlers eg system-caption so system tiddlers otherwise not included in non system tiddlers can be found eg tag manager mat link to 
In each of these cases action buttons appear, for example if the string provided is a prefix for more than one tiddler then a button allowing you to search again with the string as the prefix is made available.

I really appreciate you sharing this with us all.

Great work.
TonyM

Guido B

unread,
Jun 11, 2020, 1:57:50 AM6/11/20
to TiddlyWiki
Souk21,

Great plugin and it would fit perfectly into my workflow. Using it on my Mac with Safari or Firefox works fine. However, using it on a Windows10 machine running the Edge browser, I get the following error message: "Undefined widget 'commandpalettewidget'". Being not a JS-person, I have no idea where this error comes from. 

Another remark: I had to increase the z-index in the css-File to not having the palette appear behind the open tiddlers. Maybe you could do this by default. 

Guido

Mohammad Rahmani

unread,
Jun 11, 2020, 3:35:13 AM6/11/20
to tiddl...@googlegroups.com
Hi Guido,

I am using Microsoft Edge (Chromium) and it works like a charm! Microsoft itself does recommend the new Edge!


Best wishes
Mohammad


--
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 tiddlywiki+...@googlegroups.com.

Mohammad Rahmani

unread,
Jun 11, 2020, 3:37:08 AM6/11/20
to tiddl...@googlegroups.com
David,
 Many popular editors including VS Code, Sublime, Atom use Command Palette!
 This inline with them and you will get used to!

Best wishes
Mohammad


--
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 tiddlywiki+...@googlegroups.com.

Guido B

unread,
Jun 11, 2020, 4:22:11 AM6/11/20
to TiddlyWiki
This is on the PC provided by my employer, so I still have to use the old Edge browser
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

bimlas

unread,
Jun 11, 2020, 4:43:46 AM6/11/20
to TiddlyWiki
Wow wow WOW! O_O 

My full appreciation in all respects:
  • You've created a very universal plugin that makes it easy to manage the wiki, even for beginners
  • In a few weeks, you got to know Tiddly so much that you could write such a modular solution
  • Your very first Tiddly plugin is miles ahead of most "veteran" solutions

Reet Pandher

unread,
Jun 11, 2020, 4:51:16 AM6/11/20
to TiddlyWiki
This is amazing!! It feels so mature for such a new plugin
Please keep developing this..!! 

Reet Pandher

unread,
Jun 11, 2020, 5:05:12 AM6/11/20
to TiddlyWiki
Hi Souk,

A bug(?): The command save wiki does not seem to work. I get the message saved wiki but the save button is still red and i have to manually save it. I am using tiddlydesktop

Also one request: Please add a command to access control panel directly.

Thanks!!

Souk21

unread,
Jun 11, 2020, 8:15:25 AM6/11/20
to TiddlyWiki
Thanks everyone for the kind words and the encouragements :)

@TiddlyTweeter @David Gifford @Mohammad Thanks for your feedback! As I said, I'm definitely not against changing the name.
I do think that 'command palette' should be indicated somewhere, as that was what my first google search was when I tried to find such a plugin.
Command picker could work, but at that point maybe we should drop the 'command' altogether and call it something else? Maybe with 'search' ?
Really not sure, just thinking 'at loud'.

@TW Tones The goal is indeed to make it the more hackable/customizable I can.
Thank you for the tip, I didn't know about this drag n' drop feature :)


Done the right way the community can build a library of "commands" that are practical for any user, and or designer and we can share them saving development time. Can we make it respond to existing methods?

Yes! It's exactly what I had in mind.
What do you think could be a good way to allow this ?
Should we centralize all the commands in a repo ?
What do you mean by 'respond to existing methods' ?



I see value in more than one operating mode, a limited set of commands for one user/wiki mode, more for another, just to keep it simple and controlled, and not too big a list when not needed.

I really like the idea of switching between different profiles with a special command / a keyboard shortcut
And that's in line with @Saq Imtiaz suggestion to be able to hide/show specific commands



It would be nice to find alternatives for most node js tiddlywiki commands (where relevant)

I'm not too familiar with node.js commands yet (I've only used --listen so far), could you point me towards the relevant ones?



Being able to write commands that interact with the server such as bob would be nice. Using a server message.

That is definitely in my todo list. The problem is I'm really new to server things.
Making my firefox extension talk with tiddlywiki's node server was a big accomplishment for me haha
My idea for the palette messaging the server was to be able to send a message to the server so it commits my notes repo and pushes it.
I think for that kind of basic usage I could work it out.
Is there any more 'advanced' usages that you can think of?
And yes, the big questions are how should we deal with passing arguments to the server, and how should we deal with responses from the server.



Could we get this to past the resulting "command" into edited text fields for quick coding from stored patterns. Perhaps even a separate but similar tool

I'm not sure I understand. Are you talking about 'saving' a search/filter operation as a command easily?



On TiddlyDesktop the actions and links can actually open file explorers, apps and run batches, interacting with the local OS, so there is great potential for desktop management tools or text based search and execute. Work flow tools that help actually do the work.

Interesting! I didn't try TiddlyDesktop yet, but that's good to keep in mind



Perhaps it is already possible but I would love to be able to type say showcode and clicking the result would set a tag, field or config tiddler to yes for a given tiddler (currentTiddler) we have methods to identify the current tiddler navigated from.

I'm sorry I'm not sure I got this one.

About your list of 'conditions', I added the one missing to the todo-list (btw I should publish it)

Thanks a lot for you amazing and really detailed feedback ! I really appreciate it :)


@Guido B Thank you for reporting! I'm gonna see if I can do something about that Edge bug.
About the z-index, I think it depends on what theme you use. Do you think I should set it to something ridiculously high to make sure that it stays above any theme haha?


@bimlas Thank you, that means a lot :)


@Reet Pandher Woops I'm gonna give the save command a look asap. And I'll add the control panel ! Thanks a lot :)

TiddlyTweeter

unread,
Jun 11, 2020, 8:36:28 AM6/11/20
to tiddl...@googlegroups.com
Souk21 wrote:
@TiddlyTweeter @David Gifford @Mohammad Thanks for your feedback! As I said, I'm definitely not against changing the name.
 
I do think that 'command palette' should be indicated somewhere...

Right. That's no issue. Its simply that "palette" is confusing in the presented main name I think.
 
Command picker could work, but at that point maybe we should drop the 'command' altogether and call it something else? Maybe with 'search' ?

I been looking at it thinking "How do you describe this?" Re "search", well it gives access to Search but it also has dropdown selections for "actions". Search in TW is usually focused on "listings", but your tool is far more that that. So, overall, its outstanding character is it "initiates actions"??? ... 

So "Action Menu". Just a thought!
 
Really not sure, just thinking 'at loud'.

Best wishes
TT 

TW Tones

unread,
Jun 11, 2020, 9:00:15 AM6/11/20
to TiddlyWiki

Souk21



@TW Tones The goal is indeed to make it the more hackable/customizable I can.
Thank you for the tip, I didn't know about this drag n' drop feature :)

Done the right way the community can build a library of "commands" that are practical for any user, and or designer and we can share them saving development time. Can we make it respond to existing methods?

Yes! It's exactly what I had in mind.
What do you think could be a good way to allow this ?
Once I understand how to make my own and "package" a command using your tool, I will have a better idea, I am glad you support this approach.
 
Should we centralize all the commands in a repo ?
That would be the ideal, but still not essential. Not every one (like me) are so used to submitting items to a repo, or using GitHub.

 
What do you mean by 'respond to existing methods' ?
There are a range of methods to achieve things in tiddlywiki, I am talking about gradually supporting them using your tool. An example may be someone wanting add a new custom field to tiddlers with a given tag etc..
 
It would be nice to find alternatives for most node js tiddlywiki commands (where relevant)

I'm not too familiar with node.js commands yet (I've only used --listen so far), could you point me towards the relevant ones?

I do not use node from the command line myself, however there are opportunities to use "node" commands to achieve various results, my though is can we provide those same similar operations in tiddly-wiki such as exporting static html files and more via "Command Palette".


Being able to write commands that interact with the server such as bob would be nice. Using a server message.

That is definitely in my todo list. The problem is I'm really new to server things.
Making my firefox extension talk with tiddlywiki's node server was a big accomplishment for me haha
My idea for the palette messaging the server was to be able to send a message to the server so it commits my notes repo and pushes it.
I think for that kind of basic usage I could work it out.
Is there any more 'advanced' usages that you can think of?
And yes, the big questions are how should we deal with passing arguments to the server, and how should we deal with responses from the server.

Great to know you already have some ideas here. This can be developed in time. 


Could we get this to past the resulting "command" into edited text fields for quick coding from stored patterns. Perhaps even a separate but similar tool

I'm not sure I understand. Are you talking about 'saving' a search/filter operation as a command easily?

Sorry, what I mean is ctrl-p operates at the whole of wiki level. eg ctrl-P "wel" opens the welcome tiddler. I am wondering if we could do the same when in a text field editing content so ctrl-p in a text field would insert [[Welcome]] into the tiddler, not unlike the current editor toolbar button (link Icon) to insert a wikitext link
but making use of Command Palette features.


On TiddlyDesktop the actions and links can actually open file explorers, apps and run batches, interacting with the local OS, so there is great potential for desktop management tools or text based search and execute. Work flow tools that help actually do the work.

Interesting! I didn't try TiddlyDesktop yet, but that's good to keep in mind


Perhaps it is already possible but I would love to be able to type say showcode and clicking the result would set a tag, field or config tiddler to yes for a given tiddler (currentTiddler) we have methods to identify the current tiddler navigated from.

I'm sorry I'm not sure I got this one.
Basically adding a way to add tags to the current tiddler by typing into command pallet.

Thanks again, Like all good innovations in tiddlywiki, they open numerous new possibilities as does your solution.

Regards
Tony
 

Saq Imtiaz

unread,
Jun 11, 2020, 9:33:22 AM6/11/20
to TiddlyWiki
@Souk21 you have a great set of features already and a nice long list of ideas to implement. I would however recommend taking a modular approach and not adding too many niche features to the default installation of the plugin.

For instance, the plugin could by default come with a standard set of commands that would be useful to most users.
Extra commands, such as those related to server usage, or exports, could be made available as sub-plugins (or just tiddlers).

The goal being to keep the plugin lightweight and without bloat, and letting users opt in for extra features.

Regarding development, managing state and refresh etc, feel free to post specific questions in the Dev group and we will endeavor to help. You can also request a review of a specific part of the plugin code that you are unsure about, to get things rolling.


Cheers,
Saq

Mohammad Rahmani

unread,
Jun 11, 2020, 9:50:01 AM6/11/20
to tiddl...@googlegroups.com
@Souk21
As Saq siad! I highly recommend keeping it simple and lightweight!

Best wishes
Mohammad


--
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 tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/62f9c783-4fd8-41fc-8a09-9b737864cdfdo%40googlegroups.com.

Souk21

unread,
Jun 11, 2020, 10:15:27 AM6/11/20
to tiddl...@googlegroups.com
@TiddlyTweeter Yup I agree it can be confusing. I like 'Action Menu', thanks for your ideas :)
Before changing the name I'm gonna wait for the prototype to be closer to 'finished', so in the meantime if anyone has a thought about it, feel free to weight in !

@TW Tones Indeed I need to write a little bit of doc about creating commands.
About centralizing in a repo, I was more thinking about security for the users, as a command could potentially execute code on your computer, and definitely execute commands in your wiki.
So it would be a way to 'vet' commands.
Anyway, I would say that's an idea for later, let's work on the customization part first and see :)

someone wanting add a new custom field to tiddlers with a given tag

Ohhh I really like this one!


I am wondering if we could do the same when in a text field editing content so ctrl-p in a text field would insert [[Welcome]] into the tiddler

Didn't think about that! That's really interesting as well


Basically adding a way to add tags to the current tiddler by typing into command pallet.

This one is already possible! Try >Add tag or >Remove tag :)
I still need to do the same for fields.


@Saq @Mohammad So there would be a 'core' plugin and then 'packages' plugins (e.g server commands) having the core plugin as a dependency ?
Thanks a lot for the invite! I'll definitely come over and ask a couple questions in the Dev group :)

TiddlyTweeter

unread,
Jun 11, 2020, 11:21:10 AM6/11/20
to TiddlyWiki
Souk21 wrote:
... a command could potentially execute code on your computer, and definitely execute commands in your wiki.

I very much doubt it could execute into the OS via single Wiki maliciously, though it could trash your wiki.

But that is NOT something to worry about overmuch. It is no more powerful than normal tools in TW. Just more "compactly helpful".

Its more, I think, about warning users to back-up---especially if they into experimenting with defining new "actions"---because the tool is powerful, much to its merit.

Just a comment.
TT

Diego Mesa

unread,
Jun 11, 2020, 4:16:20 PM6/11/20
to TiddlyWiki
YESSSS!!!

FINALLY!!!

I posted about this (in a dead thread) in january of 2018!!!


Thank you so much for this!

Eskha

unread,
Jun 12, 2020, 5:24:29 PM6/12/20
to TiddlyWiki
Thank you Souk21,

One of the most usefull plugin I have seen for TiddlyWiki.

Best regards,

Eskha

Souk21

unread,
Jun 13, 2020, 9:49:33 AM6/13/20
to TiddlyWiki
New version 0.0.2 is up!

Changelog:
Added “Show Control Panel” command
Fixed bug with shadow tiddlers search / results / history
Fixed z-index bug

I did some research about 'insert mode' that @TW Tones was mentioning. I got it to work on the title input field, but not on the text input field. I think this is due to the way TiddlyWiki handles refreshing the DOM. We would need to edit the underlying tiddler to reflect the change in the text fields, so it's not gonna be an easy one.
An way easier alternative I could propose would be a 'copy result to clipboard' keyboard shortcut.

@Reet Pandher I tried resolving the save wiki bug, but I'm out of luck. I'm gonna ask over TiddlyWikiDev.

About the z-index, I set it to something like 99999 I don't think this is good practice. If anyone has a better idea :)

@Diego Mesa @Eskha I'm really glad you like it :)

Roadmap

  • Modularize (Core plugin contains only basic commands (or none?) sub-plugins add different types of commands)
  • Create commands for all features from 'Tools' tab (import,...)
  • Profiles (Different search order, hide/show commands/modules, switchable with command/shorcut)
  • Theming
  • Server module (messaging server, tiddlywiki node.js commands)
  • Pipe/chain commands, BulkActions (Apply a command to a filter operation, e.g add field for all tiddler tagged with)

Ideas:

  • Filter operation history (with tiddler history? or when input is [ ?)
  • Context in results ?
  • Highlight match in results ?
  • X button at the right of opened tiddlers ?
  • Show shortcuts of commands ?
  • Show nb of occurrences when searching tags
  • Insert result in previously focused element
  • Search/list content-type
  • Search in page?
  • Show colors in filter results
  • Show backlinks/freelinks
  • Open multiple tiddlers with right arrow ?
  • Open tiddler in edit mode?

TiddlyTweeter

unread,
Jun 13, 2020, 11:34:58 AM6/13/20
to TiddlyWiki
Ciao Souk

One serious suggestion ...

On Ctrl+P immediately populate with "?". 

Using it just having the bare list isn't any advantage over StoryRiver. 

Only with "?" do the real teeth show :-).

A thought ...
TT 

Adam S.

unread,
Jun 13, 2020, 11:05:12 PM6/13/20
to tiddl...@googlegroups.com
BRILLIANT plugin, I love it! I've been wanting something like this since I started using TiddlyWiki! Beautifully well done! (Great, useful work and also I think its visually beautiful with its simplicity) Hats off to you, Souk21 and thank you for this gift!.


I don't think it should immediately populate with a question mark to automatically reveal help, after seeiing the welcome tiddler in the demo and seeing that typing ? reveals help the list of history is much more useful. Maybe it could be an optional checkbox in the settings to have ? typed immediately.


After I upgraded to the new version I started to get the following error when I search for tiddlers with tags (using the @ prefix)

"Internal JavaScript Error
Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser
Uncaught ReferenceError: tagTiddlerExists is not defined"

The same error can be replicated on the demo page (it only shows up after typing an existing tag into the search. Try TableOfContents for example)

Thank you again, amazing plugin!

Ste Wilson

unread,
Jun 14, 2020, 4:35:04 AM6/14/20
to TiddlyWiki
How can I use this on mobile? I want to see what all the excitement is about!!!

TW Tones

unread,
Jun 14, 2020, 4:52:13 AM6/14/20
to TiddlyWiki
Souk21,

It is amazing what you have achieved so far. 

Some notes;
  • I added the F1 key as an alternative to ctrl-p and it works well. Saving the need to do a duel key press
  • This made me think of other opportunities. What if we could program keyboard shortcuts to the "command"  first letters eg ctrl-. (Unsifted >) becomes = "ctrl=P >"
  • I notices if I tried to "See Drafts" and there were none, I had to esc and start again. I wonder if in these cases we could esc back to the step selection. It seems a natural possibility.
  • It surprised me but the history has a real impact on me, distracting me from what I was about to do. At that point I noticed that tab is not captured inside the dialogue (works back in the story with the command window open). I wonder if the history could be displayed only after a "ctrl-p tab" or something similar?
    • Or perhaps this ability to navigate behind the commend dialogue actually offers and opportunity for some other snazzy feature.
FYI:

The last navigated or edited tiddler seems to be reliably stored in {{$:/HistoryList!!current-tiddler}} if we wanted to permit operations on the current Tiddler so that one did not have to select the target tiddler would be nice. 

eg; Imagin ctrl-c as open the command dialogue already with the current tiddler selected as the target.
ctrl-c>add tag<enter> would not ask to select the tiddler but offer to select the tag, the next step

When ever operating on the current tiddler a step and a few keystrokes is saved, the currentTiddler is a very common target.

Regards
Tony


TiddlyTweeter

unread,
Jun 14, 2020, 5:35:24 AM6/14/20
to TiddlyWiki
Adam S. wrote:
I don't think it should immediately populate with a question mark to automatically reveal help, after seeiing the welcome tiddler in the demo and seeing that typing ? reveals help the list of history is much more useful.

Actually you are right! My comment was based on what *I* mainly need. I was not thinking it through.
 
Maybe it could be an optional checkbox in the settings to have ? typed immediately.

If possible, that, I think would be Good. Some use cases don't need the history showing.

Best wishes
TT

TW Tones

unread,
Jun 14, 2020, 5:44:41 AM6/14/20
to TiddlyWiki
On in edit mode.

Even without sophisticated edit mode functions being able to select text tiddler title etc and pass that to the command as the target or search string would be quite useful.

Regards
Tony

Souk21

unread,
Jun 14, 2020, 8:27:55 PM6/14/20
to tiddl...@googlegroups.com


New:
  • The palette now opens with you current text selection by default (this can be disabled with the setting 'Use selection as search query'). There's also a new keyboard shortcut in the Control Panel that bypasses this setting and always open the palette with the selection. So you can use both the 'never-selection' and the 'always-selection' with a different shortcut if you like.
  • Pressing escape now goes back to previous state if possible (setting 'Escape to go back')
  • New setting to show/hide the history on empty search ('Show history on open'), also added a 'Show history' command to still be able to access the history

Changes:

  • Improved settings loading/parsing
  • Improved 'Welcome' tiddler on demo page to better reflect the different features
  • Changed 'Max hint size' setting name to 'Field preview max size'

Bugs:

  • Fixed bug with tag search

@Adam S. Thanks for the kind words, it means a lot! Sorry for the bug, it's fixed now :)

@TiddlyTweeter I'm sorry I forgot to answer to your thoughts about security. But you're definitely right! It's as dangerous as any other plugin. Thanks for the input!

@TiddlyTweeter @Adam S. I tried to make the 'Welcome' tiddler on the demo page more explicit about the different functions, I'd love to have your feedback on it !

@SteWilson I'm sorry, I didn't get the time to work on mobile yet. I think I'm gonna wait for the plugin to be a bit more mature before considering adding mobile support

@TW Tones Thanks for the feedback, I added your idea of a 'show history' setting for when you need to stay focus on what you're doing
I also implemented the 'escape goes back' behavior. I tried to cover all cases, tell me if I missed some :)
Opening with selection was a great idea as well. It composes well with existing keyboard shortcuts (ctrl+shift+p opens with '>yourSelection' as a command)
It's gonna be easy to create a shortcut to open all tiddlers tagged with current selection for example (@yourSelection)

I was looking for {{$:/HistoryList!!current-tiddler}} ! Thank you haha
In that regard, I've indeed been quite conservative with how selecting a tiddler to act on works. Actually, it's the only place where the first result is not automatically selected.
I did that to avoid a user double-pressing enter by mistake and doing something to the wrong tiddler.
I do think the plugin needs a better way to handle acting on the current tiddler, and I like the idea of another shortcut.
Keeping in mind it could be good to avoid having to many different keyboard shortcuts
So yeah, definitely something important to tackle, but I'm not really sure in what form yet.
Any feedback is greatly appreciated :)

What if we could program keyboard shortcuts to the "command"  first letters eg ctrl-. (Unsifted >) becomes = "ctrl=P >"
I'm not sure I understand. Do you mean having a keyboard shortcut to open the palette with a '@' for example?

Mohammad Rahmani

unread,
Jun 14, 2020, 11:26:17 PM6/14/20
to tiddl...@googlegroups.com
Souk21,
 Many thanks for the new update! Command Palette is really wonderful and very useful!

Small comments on ideas:
- Filter operation history (with tiddler history? or when input is [ ?)
  Why not to show filter history when just you type [ and narrow it while typing in searchbox and when press enter show final result!  


Repeated small recommendation
Keep it simple, and there may be ground for sub-plugins!






Best wishes
Mohammad


--
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 tiddlywiki+...@googlegroups.com.

Guido B

unread,
Jun 15, 2020, 12:46:29 AM6/15/20
to TiddlyWiki
Also from myself, many thanks for this wonderful plugin.

As to my point from last week regarding the Edge browser problem: I transpiled your commandpalettewidget.js file with Babel and an es2015 preset and now the plugin works also in the Edge browser. So you don't have to deal with the issue as this is obviously just a problem of Edge and IE not being able to deal with newer flavors of JS. 

Best, Guido


Am Mittwoch, 10. Juni 2020 19:31:24 UTC+2 schrieb Souk21:

TW Tones

unread,
Jun 15, 2020, 4:59:59 AM6/15/20
to TiddlyWiki
Fantastic for the changes and updates

The last question, yes I am more interested in opening it in > mode but being Abel to assign shortcuts to each including would be nice but not essential.

Love your work
Tony

Adam S.

unread,
Jun 15, 2020, 5:51:57 AM6/15/20
to tiddl...@googlegroups.com
Thank you for the quick fix and the update! Great work!
Nice feature to have selections auto-populate the search field!

I have an idea that might increase usability or speed of operation: how about, after entering commands, having shortcuts for them? Like 1 for save, 2 for close all tiddlers etc. this would be configurable (or not) and the list would contain small little numbers on the right side (like the hints that are already there at other parts) to know which one is what number. If it's possible it'd be neat if there would be no need for hitting enter either, typing one would select save wiki and execute the command as well. Users who use the command palette would learn these (or configure them) and operate with it much faster. ctrl+shift+p, 1, and the wiki is saved (or any other command) as opposed to ctrl+shift+p, sa, down arrow, enter (or ctrl+shift+p, save w, enter, doesn't matter, the number solution is faster either way)
Sadly I have no clue how this could be (or even if it could be) implemented, but maybe you'll find it an interesting idea!

Regarding the welcome tiddler: I think this works, but I didn't have a problem with the previous one either.

I see theming on your roadmap, if you mean creating visual styles for it, I wonder if it could be at least partially sidestepped by having the colors conform to the (currently active) tiddlywiki palette (color palette). This would be helpful for folks (like me) who use two themes, a light one during the day and a dark one after the sun went down. I tried to edit the css of the plugin but writing <<colour background>> and other tiddlywiki colors didn't work.
In the meantime I made a dark version with the included css that works better with dark tiddlywiki palettes.
(I also attached a simple scrollbar css that I've been using because the scrollbar defaults to a bright scrollbar everywhere for me.)

$__plugins_souk21_commandpalette_commandpalette.css.tid
scrollbar css.tid
Message has been deleted

si

unread,
Jun 15, 2020, 6:51:50 AM6/15/20
to TiddlyWiki
This is fantastic, great addition to tiddlywiki!

A couple of suggestions for features that might be useful:
  • A way to list open tiddlers and jump to one of them
  • A way to switch sidebar tabs from the command pallet
Anyway this is awsome

TW Tones

unread,
Jun 15, 2020, 8:00:05 AM6/15/20
to TiddlyWiki
Folks

I am also excited about this solution but as a long time user I see many of the suggestions touching on either existing shortcuts or solutions out there.

Perhaps part of this solution should be providing information about existing features. Otherwise in future a new user, once this solution has matured, will find multiple answers and in each there will be extras and deficiencies. I plead we keep quality by ensuring consistency.

This solution appears to have a great deal of flexibility to leverage existing methods, so can I suggest we do our best to align these.

Please try and satisfy requirements through the customizability or standard tweaks as well.

An example may be the creation of a parallel process trigger that will bypass an attempt to customise a global process.

Regards
Tony

TiddlyTweeter

unread,
Jun 16, 2020, 5:16:42 AM6/16/20
to TiddlyWiki

@TiddlyTweeter @Adam S. I tried to make the 'Welcome' tiddler on the demo page more explicit about the different functions, I'd love to have your feedback on it !

Got it! Helpful in understanding it!

Tx, TT 

TiddlyTweeter

unread,
Jun 16, 2020, 6:04:07 AM6/16/20
to TiddlyWiki
I agree with Mohammad that "["  seems a bit "orphaned" ... BUT not sure whether list of filters should be "recent" or "listed" (for example those found under  Advanced Search > Filter dropdown?).

Just a comment!
TT

Reet Pandher

unread,
Jun 16, 2020, 12:54:54 PM6/16/20
to tiddl...@googlegroups.com
Hi Souk,

Just tried Command Palette in my wiki and wanted to report a visual bug: It doesn't take in the custom theme applied by the user. I am using a dark theme and the search box still takes dark gray text color. Also, the dropdown remains black text on white background. I've attached a screenshot. If possible please fix.

@Reet Pandher I tried resolving the save wiki bug, but I'm out of luck. I'm gonna ask over TiddlyWikiDev.

Thanks for looking into it. FYI You can create a new tiddler and then delete it to save the wiki. Maybe under the hood you can tell the save wiki command to do that? I don't know if it is even possible to do something like this but gonna throw out the idea anyway.


text color isn't white.png

Adam S.

unread,
Jun 16, 2020, 2:17:07 PM6/16/20
to tiddl...@googlegroups.com
Hi Reet,

It's not a solution from the developer, but I've uploaded a dark color theme for the plugin that makes the input text brighter (not completely white, but brighter, also makes the whole interface darker.) Download the attached file from here and drag it into your wiki. (The one that starts with a $ is the one you need. The other one solves scrollbars being bright.)
It looks like this:

command palette dark palette 2.jpg

Eskha

unread,
Jun 22, 2020, 12:25:56 PM6/22/20
to TiddlyWiki
Hello Souk21,

When using Command Palette with Firefox 60.7 I have an "Internal JavaScript Error" red box error, any time I hit the down arrow key.

The firefox console displays the following error messages:

| !ReferenceError: event is not defined| %20line%2033389%20%3E%20eval:512:5 |
| onKeyDown| $:/core/modules/widgets/commandpalettewidget.js:512:5 |
| render/<| $:/core/modules/widgets/commandpalettewidget.js:334:50 |

Changing the following elements in the "$:/core/modules/widgets/commandpalettewidget.js" tiddler
event.preventDefault(); event.stopPropagation();

by
e.preventDefault(); e.stopPropagation();

below the following part of the code
onKeyDown(e)

seems to fix the issue.
(since I am not a developer it might not be the right thing to do...)

Best regards,

Eskha

Adam S.

unread,
Jun 22, 2020, 11:02:41 PM6/22/20
to TiddlyWiki
The attached css gets its colors from the currently selected TiddlyWiki color palette (the solution to my problem was provided by a friend, tiddler-type needs to be text/vnd.tiddlywiki for macros to work). I also made a pull request on github to make it part of the official release.

Please don't forget Eskha's post right above this.

 

1.jpg2.jpg3.jpg



$--plugins-souk21-commandpalette-commandpalette.css.tid

Souk21

unread,
Jun 23, 2020, 11:01:47 AM6/23/20
to tiddl...@googlegroups.com
New version 0.0.4 is up!
New: - Theming - Themes now follow your current color palette (thanks to Adam S!) - New Compact theme - New setting to change theme - Deleted "smoothScroll" setting - Added '>See Story List' command to list opened tiddlers - Insert result (ctrl+shift+I) Fixed: - Fixed selection not being recognized in text fields - Command palette now correctly gives back focus - Improved 'Welcome' tiddler Good news! I realized the issue I had with TW text fields was not about how they update. It was about being in iframes (don't know how I missed that).
Fortunately it was a really easy fix! It enabled me to fix a bug with 'selection mode' as well as add a new 'insert shortcut'. As a bonus, it also helped with the palette giving back keyboard focus to text fields! There's still some design decisions to make, for example, should the palette insert results as links when possible? (I'm thinking yes) I'm still thinking about how acting on the current tiddler should work, so anyone with any input on that subject should chime in :) Let me know what you think ! @Mohammad @TiddlyTweeter: I'm sorry I didn't get the time to implement the filter operation history, but it's high on the todo list :) I also like the idea of having common operations available. Maybe a setting could be switchable between 'history' and 'common operations' ? @Guido B: Interesting! Thanks for the heads up :) I'll check if I can make transpiling/polyfilling part of the process. @TW Tones: You can already do that :) For example: '<$action-sendmessage $message="open-command-palette" $param=">"/>' will open the command palette with '>' ($param) as input. You can have a look at '$:/plugins/souk21/commandpalette/CommandPaletteCommandMode', the rest is just a matter of creating a keyboard shortcut with TW provided way. I agree with you about discoverability.
For now, you can set 'neverBasic' setting to true, so you can see what filters operations are used (try it with '>Recent Tiddlers' for example) 'An example may be the creation of a parallel process trigger that will bypass an attempt to customise a global process.' I'm sorry I didn't understand that part @si: Thanks for the input! I added a 'See Story List' command. I'm gonna look into switching tabs :) @Eshka: Thank you for the bug report! Don't know how it even worked in the first place haha. It's fixed now, thanks :) @Adam S.: Thank you a lot for the research you did! I used your pull request as a starting point for the new themes.
I tried it with different palettes and it feels way better now! Thanks again, it really helped me. Let me know what you think of it :) About your numbered shortcuts idea, would it be a way to select results ? (1 for 1st result, 2 for 2nd,...) or would it be user customizable shortcuts?

Reet Pandher

unread,
Jun 25, 2020, 10:37:13 PM6/25/20
to TiddlyWiki
Hi Souk,

Any luck fixing the save wiki command?

Souk21

unread,
Jun 26, 2020, 3:49:30 AM6/26/20
to TiddlyWiki
Hi Reet, I posted a thread in TWDev (https://groups.google.com/forum/#!topic/tiddlywikidev/6nU5W3bQSY0) asking for help about this issue.

Adam S.

unread,
Jun 26, 2020, 10:47:02 AM6/26/20
to tiddl...@googlegroups.com
Hello Souk21!

Thank you for the update, the improvements are great - giving back focus is very handy! I'm glad you liked my fork and I'm very happy you ended up using it as a starting point, the end result is great! :) It was my pleasure to help you with this!


"About your numbered shortcuts idea, would it be a way to select results ? (1 for 1st result, 2 for 2nd,...) or would it be user customizable shortcuts?"

Either way would be awesome, but I'd prefer the latter because then the shortcuts wouldn't mean different things at different times (so one could get used to a setup) while if they are assigned as their position in the list they jump around because the list is updated and lists what you used last (which is a great feature! immensely useful to have my last command at the top! and second last at second place etc, best behavior ever!) and in this way it'd force you to read the list and find your shortcut - slowing the operation down. (I don't know how hard it is to implement so feel free to disregard this part in brackets {implement both, with the option to choose from the two in settings]) This only makes sense in the commands area of the plugin not the tiddler search and filter, because those can have numbers to them. 
I just realized that I could probably make this happen myself if I modify the names, for example  "close all tiddlers" to "1, close all tiddlers" and it would jump there without any code required. I just tried it out and it works. Including the number doesn't make it impossible to search among the commands with type, but if I learn my numbers I don't need to type at all times.
This makes my original request moot. But if its not too much work, I think the " a way to select results (1 for 1st result, 2 for 2nd,..."  could be useful, but since it'd work on the search field too it'd need to have a modifier key to it, like ctrl+3 for example. Although hitting the down arrow three times is not that big of a deal. So its okay if this idea gets forgotten.


I have a new feature idea to consider: when we open command palette and it gives results I tihnk it could be a useful thing if hitting the right arrow key would copy the text from the selected item in the list below to the input field where we write (so for example when one has tiddler 1, tiddler 2, tiddler 3 ... tiddler 15  and you search for tid, you have the list of them, you can either write it out or use the down arrow to get to the number you want, but in this case if you could hit the right arrow to get the name of tiddler 1 you could then easily get to 15 by writing 5 after the copied text, which is better than writing out the whole title. This would save more time on a longer tiddler titles. obviously. Also, I believe it can be useful with non-numbered tiddlers too but they made my point very easily.) 

Souk21

unread,
Jun 28, 2020, 4:05:42 AM6/28/20
to TiddlyWiki
Adding numbers to command names is a clever idea.

Shortcuts are a nice idea, but I fear that it would be a double to TW's own shortcut system, which is already quite powerful.
A middle ground could be having a command that helps you create TW shortcuts ? Either executing a palette command or a TW action.

I like the idea of completing the input with right arrow! I'll add it to the todo list :)

Souk21

unread,
Jun 29, 2020, 4:09:40 AM6/29/20
to tiddl...@googlegroups.com
This time it's a small one with a couple bugfixes:

- Fixed themes tiddlers being modified unexpectedly (Thanks to @linonetwo)
- Fixed "Save Wiki" bug (Thanks to @Saq Imtiaz)

Let me know :)

Diego Mesa

unread,
Jul 22, 2020, 6:20:55 PM7/22/20
to TiddlyWiki
Hey Souk21,

Thanks for this! Do you think this is ready to use in production? Also, any plans to try and make this into the core/official plugin? I think its great!

TW Tones

unread,
Jul 22, 2020, 8:01:02 PM7/22/20
to TiddlyWiki
Souk21,

This is a great contribution from a new tiddlywiki user, thank you. 

I do like its standalone independence behind ctrl-p, We are getting so many advances in quick access to advanced features in a few directions right now so don't be surprised if adoption is slower than normal, users may be being overwhelmed. Floating editor toolbars, editor context responsive and other tools are "in the works". Yours is a serious contributor to tiddlywiki flourishing. 

In a new thread for EditorMagic in Development https://groups.google.com/forum/?hl=en#!topic/tiddlywikidev/HeYGf24BSTE I am developing a method to extract programaticaly macro and widget info from tiddlywiki.com or empty.html to build a library of sorts that can be fed into such tools, 

Perhaps Command Palette can be part of this? allowing such content to be accessed from a shared resource?

If interested please join that thread.

Regards
Tony

JD

unread,
Jul 28, 2020, 8:13:51 AM7/28/20
to TiddlyWiki
Hi Souk21,

I am in love with this! This is truly amazing and exactly what I need in my personal wiki!

I have a question (searching for the answer of which put me into creation mode), how do I access the text of the CommandPalette input box and have it available to an actionString - type custom command? 

I wish to integrate my NTFS22 macros into this elegantly (it works by parsing the content of a tiddler, i.e. the tiddler modified by the searchbar). I tried looking at recently-modified tiddlers to see which one CommandPalette modifies, but there's none!

So, for now I am using a custom command that calls up an identical-looking input box into the screen. I feel like this is a hack because it's not actually using Command Palette's input box like how I wish it will be able to! Am I just missing something? hehe.

Also another idea: how about, inside a custom command tiddler, let there be three additional fields? 
  • command-palette-popup-key can contain a key which, when inputted, will reveal the submenu, in context of the current custom command
  • command-palette-popup contains the title of the tiddler for the body of the submenu
  • command-palette-hint contains the text of the hint informing the user of what the command does (for example)
Sample use:
  1. I have a custom actionString command. This will run a macro on the text string of the input box on "ENTER"
  2. For preferences on how the text string will be parsed, I wish to access a preferences  page... So maybe by inputting "|" the submenu will open and allow me to configure things
Anyway, because I don't know how to create those things natively into the current version of Command Palette, I forked a version of my NTFS22 plugin and it does the above things.

Please take a look here to see what I'm trying to accomplish. My plan is to retire this plugin once I can do the same things with Command Palette!

Thanks again for this, and I'm looking forward to creating more permissive custom commands!

- jd

Saq Imtiaz

unread,
Jul 28, 2020, 8:24:11 AM7/28/20
to TiddlyWiki
@souk21 @jd suggest that CP make the original string from the input available as a variable to the actions invoked by commands.
The last optional argument to invokeActionString is a hashmap of variables that will be available in the actionstring.

Souk21

unread,
Aug 2, 2020, 8:47:43 AM8/2/20
to tiddl...@googlegroups.com
New version 0.0.6 !
Changelog:
  • [BREAKING CHANGE] Renamed field 'cp-hint' to 'command-palette-hint' for consistency
  • New shortcut commands for customization. Allow to call an action string from the command palette with any prefix of your choice. Choose a 'trigger' prefix that will override any other commands (even builtins like + or @). The input (minus the prefix) is then set as a variable <<commandpaletteinput>> for optional use in your action string (see example at the bottom)
  • actionString commands can now ask for user input. Set 'command-palette-user-input' field to 'true'. The input is then set as a variable <<commandpaletteinput>> for use in your action string. (see example at the bottom)

@Diego Mesa: While I would like to do a rewrite and there are still some features I'd like to add, nobody complained about losing data yet.
Another point that might change is the name, as some people think it's misleading in relation to TW's color palettes
So I would say it should be safe to use, but is probably gonna evolve a bit before reaching 1.0 :)
About core/plugins, I've never looked into the process, so I'm not sure.
Thank you !


@TW Tones: Thanks for the kind words!
EditorMagic looks like a really nice addition!
If I understand correctly, it would be some kind of autocompletion engine?
It would indeed be nice for CP to be able to interact with it.
It should be fairly easy when the data is available.


@JD: Thanks a lot :)

how do I access the text of the CommandPalette input box and have it available to an actionString - type custom command?
It was not possible before, thanks to you, it now is :)
You only have to add the field 'command-palette-user-input' to any actionString command and set it to true
The command palette will ask for user input before invoking the actionString (with your hint if it's set)
You can then access the input value with <<commandpaletteinput>> inside of your macro


I tried looking at recently-modified tiddlers to see which one CommandPalette modifies, but there's none!
Woops. I'm a bit ashamed, but for now CP does not use state tiddlers. Instead the state is stored in the DOM. I know it's not really in line with TW philosophy, but it's way easier for me to develop it like that. I'll definitely try to do it at some point.


command-palette-hint contains the text of the hint informing the user of what the command does (for example)
I reworked the hint system and it is now available to every command (where it makes sense)


command-palette-popup-key can contain a key which, when inputted, will reveal the submenu, in context of the current custom command
For preferences on how the text string will be parsed, I wish to access a preferences  page... So maybe by inputting "|" the submenu will open and allow me to configure things
That's something I'd like to do in a next version, I'm still not sure exactly how, but I'll think about it !

BTW, you can also create tiddlers with tags : '+title @tag @tag2'

Let me know if those changes work for you!
Thanks for the support :)


@Saq Imtiaz Thanks a lot! I didn't know. That probably saved me quite a lot of time, and the solution is more elegant :) It's really nice of you, thanks again!



EXAMPLES:
Shortcut:
command-palette-type: shortcut
command
-palette-trigger: =
command
-palette-hint: New Tiddler with name
tags
: $:/tags/CommandPaletteCommand
title
: $:/New Tiddler
type: text/
vnd.tiddlywiki

<$action-sendmessage $message="tm-new-tiddler" title=<<commandpaletteinput>>/>




actionString with user input:
command-palette-type: actionString
command
-palette-name: New Tiddler with name
command
-palette-hint: Enter the name
command
-palette-user-input: true
tags
: $:/tags/CommandPaletteCommand
title
: $:/New Tiddler
type: text/
vnd.tiddlywiki

<$action-sendmessage $message="tm-new-tiddler" title=<<commandpaletteinput>>/>


E Browns

unread,
Aug 2, 2020, 11:13:53 AM8/2/20
to tiddl...@googlegroups.com
Amazing update! Thank you so much! 

What I'm trying to accomplish is the creation of a tiddler with fields and text signified by symbols within the input, and have that save-then-nothing, or save-then-edit, or save-then-navigate. I have those macros ready to feed into CP ^^,

Default CP action for tiddler creation can allow me only title and tags, but that's completely fine because I believe a universal tool like CP shouldn't already contain the very specific things I need, when I can just use its custom command toolset! And that's what makes it all the more amazing, I think. 

That's the same sort of awesome that I also apply to Tiddlywiki ^^, the ability to make /use/ of it endlessly customizable. Thanks again! Will test now! 

-jd



On Sun, Aug 2, 2020, 20:47 Souk21, <soufy...@gmail.com> wrote:
  • [BREAKING CHANGE] Renamed field 'cp-hint' to 'command-palette-hint' for consistency
  • New shortcut commands for customization. Allow to call an action string from the command palette with any prefix of your choice. Choose a 'trigger' prefix that will override any other commands (even builtins like + or @). The input (minus the prefix) is then set as a variable <<command-palette-user-input>> for optional use in your action string (see example at the bottom)
  • actionString commands can now ask for user input. Set 'command-palette-user-input' field to 'true'. The input is then set as a variable <<command-palette-user-input>> for use in your action string. (see example at the bottom)

@Diego Mesa: While I would like to do a rewrite and there are still some features I'd like to add, nobody complained about losing data yet.
Another point that might change is the name, as some people think it's misleading in relation to TW's color palettes
So I would say it should be safe to use, but is probably gonna evolve a bit before reaching 1.0 :)
About core/plugins, I've never looked into the process, so I'm not sure.
Thank you !


@TW Tones: Thanks for the kind words!
EditorMagic looks like a really nice addition!
If I understand correctly, it would be some kind of autocompletion engine?
It would indeed be nice for CP to be able to interact with it.
It should be fairly easy when the data is available.


@JD: Thanks a lot :)

how do I access the text of the CommandPalette input box and have it available to an actionString - type custom command?
It was not possible before, thanks to you, it now is :)
You only have to add the field 'command-palette-user-input' to any actionString command and set it to true
The command palette will ask for user input before invoking the actionString (with your hint if it's set)
You can then access the input value with <<command-palette-input>> inside of your macro


I tried looking at recently-modified tiddlers to see which one CommandPalette modifies, but there's none!
Woops. I'm a bit ashamed, but for now CP does not use state tiddlers. Instead the state is stored in the DOM. I know it's not really in line with TW philosophy, but it's way easier for me to develop it like that. I'll definitely try to do it at some point.

command-palette-hint contains the text of the hint informing the user of what the command does (for example)
I reworked the hint system and it is now available to every command (where it makes sense)

command-palette-popup-key can contain a key which, when inputted, will reveal the submenu, in context of the current custom command
For preferences on how the text string will be parsed, I wish to access a preferences  page... So maybe by inputting "|" the submenu will open and allow me to configure things
That's something I'd like to do in a next version, I'm still not sure exactly how, but I'll think about it !

BTW, you can also create tiddlers with tags : '+title @tag @tag2'

Let me know if those changes work for you!
Thanks for the support :)


@Saq Imtiaz Thanks a lot! I didn't know. That probably saved me quite a lot of time, and the solution is more elegant :) It's really nice of you, thanks again!



EXAMPLES:
Shortcut:
command-palette-type: shortcut
command
-palette-trigger: =
command
-palette-hint: New Tiddler with name
tags
: $:/tags/CommandPaletteCommand
title
: $:/New Tiddler
type: text/
vnd.tiddlywiki

<$action-sendmessage $message="tm-new-tiddler" title=<<command-palette-input>>/>




actionString with user input:
command-palette-type: actionString
command
-palette-name: New Tiddler with name
command
-palette-hint: Enter the name
command
-palette-user-input: true
tags
: $:/tags/CommandPaletteCommand
title
: $:/New Tiddler
type: text/
vnd.tiddlywiki

<$action-sendmessage $message="tm-new-tiddler" title=<<command-palette-input>>/>


--
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/09Ful62YG1g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/d7f5c349-a4db-422d-a591-619f27cedfb2o%40googlegroups.com.

E Browns

unread,
Aug 2, 2020, 12:09:48 PM8/2/20
to tiddl...@googlegroups.com
Hi! So far into testing I found the variable is 

<<commandpaletteinput>>

And not

<<command-palette-input>>

I thought i had my t's and l's mixed up until I scanned the JS code! Hehe! 

-jd


On Sun, Aug 2, 2020, 20:47 Souk21, <soufy...@gmail.com> wrote:
  • [BREAKING CHANGE] Renamed field 'cp-hint' to 'command-palette-hint' for consistency
  • New shortcut commands for customization. Allow to call an action string from the command palette with any prefix of your choice. Choose a 'trigger' prefix that will override any other commands (even builtins like + or @). The input (minus the prefix) is then set as a variable <<command-palette-user-input>> for optional use in your action string (see example at the bottom)
  • actionString commands can now ask for user input. Set 'command-palette-user-input' field to 'true'. The input is then set as a variable <<command-palette-user-input>> for use in your action string. (see example at the bottom)

@Diego Mesa: While I would like to do a rewrite and there are still some features I'd like to add, nobody complained about losing data yet.
Another point that might change is the name, as some people think it's misleading in relation to TW's color palettes
So I would say it should be safe to use, but is probably gonna evolve a bit before reaching 1.0 :)
About core/plugins, I've never looked into the process, so I'm not sure.
Thank you !


@TW Tones: Thanks for the kind words!
EditorMagic looks like a really nice addition!
If I understand correctly, it would be some kind of autocompletion engine?
It would indeed be nice for CP to be able to interact with it.
It should be fairly easy when the data is available.


@JD: Thanks a lot :)

how do I access the text of the CommandPalette input box and have it available to an actionString - type custom command?
It was not possible before, thanks to you, it now is :)
You only have to add the field 'command-palette-user-input' to any actionString command and set it to true
The command palette will ask for user input before invoking the actionString (with your hint if it's set)
You can then access the input value with <<command-palette-input>> inside of your macro


I tried looking at recently-modified tiddlers to see which one CommandPalette modifies, but there's none!
Woops. I'm a bit ashamed, but for now CP does not use state tiddlers. Instead the state is stored in the DOM. I know it's not really in line with TW philosophy, but it's way easier for me to develop it like that. I'll definitely try to do it at some point.

command-palette-hint contains the text of the hint informing the user of what the command does (for example)
I reworked the hint system and it is now available to every command (where it makes sense)

command-palette-popup-key can contain a key which, when inputted, will reveal the submenu, in context of the current custom command
For preferences on how the text string will be parsed, I wish to access a preferences  page... So maybe by inputting "|" the submenu will open and allow me to configure things
That's something I'd like to do in a next version, I'm still not sure exactly how, but I'll think about it !

BTW, you can also create tiddlers with tags : '+title @tag @tag2'

Let me know if those changes work for you!
Thanks for the support :)


@Saq Imtiaz Thanks a lot! I didn't know. That probably saved me quite a lot of time, and the solution is more elegant :) It's really nice of you, thanks again!



EXAMPLES:
Shortcut:
command-palette-type: shortcut
command
-palette-trigger: =
command
-palette-hint: New Tiddler with name
tags
: $:/tags/CommandPaletteCommand
title
: $:/New Tiddler
type: text/
vnd.tiddlywiki

<$action-sendmessage $message="tm-new-tiddler" title=<<command-palette-input>>/>




actionString with user input:
command-palette-type: actionString
command
-palette-name: New Tiddler with name
command
-palette-hint: Enter the name
command
-palette-user-input: true
tags
: $:/tags/CommandPaletteCommand
title
: $:/New Tiddler
type: text/
vnd.tiddlywiki

<$action-sendmessage $message="tm-new-tiddler" title=<<command-palette-input>>/>

JD

unread,
Aug 2, 2020, 2:39:21 PM8/2/20
to TiddlyWiki
Hi Souk! 

Sorry for bothering again but I want to share a sample scenario where It'll help if the input box writes to (for example) $:/temp/command-palette-input instead of a variable available only within CP (like how sidebar search manipulates $:/temp/search).

When it's a tiddler that's being manipulated, we can do a <$list> conditional on whether the tiddler is empty or not. 

In my case I can use it to trigger a style on the input box that'll hide the hint when the input is long (right now the hint isn't acting like a placeholder that disappears, although this can be solved via CSS with a :focus selector)

Another is, we can make a PageTemplate that'll only appear on another <$list> conditional. Sample: Typing a certain key within the custom action, I can emulate a CP-style submenu that'll allow me to configure some things in context of my original actionString... Of course, this is only for while there's no built-in feature like that yet hehe!

But you've shared something already great, writing to a temp tiddler is something I can live without! There are just some thoughts! 

Thanks again ^^,

-jd





On Sunday, August 2, 2020 at 9:47:43 PM UTC+9, Souk21 wrote:
  • [BREAKING CHANGE] Renamed field 'cp-hint' to 'command-palette-hint' for consistency
  • New shortcut commands for customization. Allow to call an action string from the command palette with any prefix of your choice. Choose a 'trigger' prefix that will override any other commands (even builtins like + or @). The input (minus the prefix) is then set as a variable <<command-palette-user-input>> for optional use in your action string (see example at the bottom)
  • actionString commands can now ask for user input. Set 'command-palette-user-input' field to 'true'. The input is then set as a variable <<command-palette-user-input>> for use in your action string. (see example at the bottom)

@Diego Mesa: While I would like to do a rewrite and there are still some features I'd like to add, nobody complained about losing data yet.
Another point that might change is the name, as some people think it's misleading in relation to TW's color palettes
So I would say it should be safe to use, but is probably gonna evolve a bit before reaching 1.0 :)
About core/plugins, I've never looked into the process, so I'm not sure.
Thank you !


@TW Tones: Thanks for the kind words!
EditorMagic looks like a really nice addition!
If I understand correctly, it would be some kind of autocompletion engine?
It would indeed be nice for CP to be able to interact with it.
It should be fairly easy when the data is available.


@JD: Thanks a lot :)

how do I access the text of the CommandPalette input box and have it available to an actionString - type custom command?
It was not possible before, thanks to you, it now is :)
You only have to add the field 'command-palette-user-input' to any actionString command and set it to true
The command palette will ask for user input before invoking the actionString (with your hint if it's set)
You can then access the input value with <<command-palette-input>> inside of your macro


I tried looking at recently-modified tiddlers to see which one CommandPalette modifies, but there's none!
Woops. I'm a bit ashamed, but for now CP does not use state tiddlers. Instead the state is stored in the DOM. I know it's not really in line with TW philosophy, but it's way easier for me to develop it like that. I'll definitely try to do it at some point.

command-palette-hint contains the text of the hint informing the user of what the command does (for example)
I reworked the hint system and it is now available to every command (where it makes sense)

command-palette-popup-key can contain a key which, when inputted, will reveal the submenu, in context of the current custom command
For preferences on how the text string will be parsed, I wish to access a preferences  page... So maybe by inputting "|" the submenu will open and allow me to configure things
That's something I'd like to do in a next version, I'm still not sure exactly how, but I'll think about it !

BTW, you can also create tiddlers with tags : '+title @tag @tag2'

Let me know if those changes work for you!
Thanks for the support :)


@Saq Imtiaz Thanks a lot! I didn't know. That probably saved me quite a lot of time, and the solution is more elegant :) It's really nice of you, thanks again!



EXAMPLES:
Shortcut:
command-palette-type: shortcut
command
-palette-trigger: =
command
-palette-hint: New Tiddler with name
tags
: $:/tags/CommandPaletteCommand
title
: $:/New Tiddler
type: text/
vnd.tiddlywiki

<$action-sendmessage $message="tm-new-tiddler" title=<<command-palette-input>>/>




actionString with user input:
command-palette-type: actionString
command
-palette-name: New Tiddler with name
command
-palette-hint: Enter the name
command
-palette-user-input: true
tags
: $:/tags/CommandPaletteCommand
title
: $:/New Tiddler
type: text/
vnd.tiddlywiki

<$action-sendmessage $message="tm-new-tiddler" title=<<command-palette-input>>/>


Saq Imtiaz

unread,
Aug 2, 2020, 4:33:48 PM8/2/20
to TiddlyWiki

Sorry for bothering again but I want to share a sample scenario where It'll help if the input box writes to (for example) $:/temp/command-palette-input instead of a variable available only within CP (like how sidebar search manipulates $:/temp/search).

For the rewrite I would recommend that CP use an edit-text widget for the input, which would make it easy to store the input in a temp tiddler.

For now, adding something like this to the onInput function will save the value of the input to a temp tiddler whenever it is changed:

this.wiki.setText("$:/temp/command-palette-input","text",undefined,text);

E Browns

unread,
Aug 2, 2020, 6:12:23 PM8/2/20
to tiddl...@googlegroups.com
That is very wild to me! Hehe! I don't even know where to insert that bit of code in the js tiddler... It'll be the first time I'll edit anything javascript if I do! Soo.. I'm very sorry for my current ignorance, but where exactly should I insert it into (while we wait for Souk's update)? 

Thank you so much Saq! 

--
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/09Ful62YG1g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

Souk21

unread,
Aug 2, 2020, 6:54:53 PM8/2/20
to TiddlyWiki
I thought i had my t's and l's mixed up until I scanned the JS code! Hehe!
 
So sorry! I guess that's what you get for coding on a sunday morning haha
I edited the post as well as the github release. Thanks a lot for the report

I don't really have time to update it (or even try it) right now, but I think you can put

this.wiki.setText("$:/temp/command-palette-input","text",undefined,this.input.value);

on line 466 of, before this line

if (this.blockProviderChange) { //prevent provider changes

Souk21

unread,
Aug 2, 2020, 6:56:13 PM8/2/20
to TiddlyWiki
Sorry I must be tired today, I meant

on line 466 of commandpalettewidget.js, before this line

E Browns

unread,
Aug 2, 2020, 9:01:49 PM8/2/20
to tiddl...@googlegroups.com
Aww thanks so much for the help! I'll try this (after numerous backups just in case I mess it up haha)

On Mon, Aug 3, 2020, 06:56 Souk21, <soufy...@gmail.com> wrote:
Sorry I must be tired today, I meant

on line 466 of commandpalettewidget.js, before this line

--
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/09Ful62YG1g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

TW Tones

unread,
Aug 2, 2020, 9:34:58 PM8/2/20
to tiddl...@googlegroups.com
Souk21,

Looking beautiful. 

I notice how ever after ctrl-p most characters at least on a QWERTY keyboard a shifted character
  • > search/execute shift-"."
  • < macro shift-","  if we use this in future for macros << or html <
  • ? help shift-"/"
  • # search tags shift-"3"
  • @ search tiddler with this tag shift-"3"
  • [ filter operation unshifted
  • { transclusion shift-"3" if we use this in future for transclusions
  • + new tiddler (optional @tags) shift-"="
  • | command palette settings shift-"\"
Now I was thinking if the un-shifted character was available as an alias it may reduce the keys needed to invoke a command would reduce by one key for many of the commands.
  • However this may not be sustainable given we may want to use the un-shifted characters in the command dialogue.
I mention this because perhaps this is the opportunity to see if the shortcuts can become shorter, even just an alternative?
  • eg ctrl-= Open command dialogue and feed in "+" (= shifted version) ie "ctrl-p shift-+" four keys vs two needed.
  • Of course this may vary with different keyboards, so perhaps configured by the user 
Regards
Tony
Reply all
Reply to author
Forward
0 new messages