Re: [tw5] Re: Plugin prototype: Command Palette

2020-08-02 Thread Souk21
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 the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/6d965bcd-9f66-4412-8453-f6b6d220984do%40googlegroups.com.


Re: [tw5] Re: Plugin prototype: Command Palette

2020-08-02 Thread Souk21

>
> 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

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/338b9a71-bb15-4c43-b4d4-f714c3819db0o%40googlegroups.com.


[tw5] Re: Plugin prototype: Command Palette

2020-08-02 Thread Souk21
New version 0.0.6 ! <https://github.com/Souk21/TW-commandpalette>
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 
   <> 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 <> 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 <> 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=<>/>




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=<>/>


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d7f5c349-a4db-422d-a591-619f27cedfb2o%40googlegroups.com.


[tw5] Re: Plugin prototype: Command Palette

2020-06-29 Thread Souk21
New version 0.0.5 is up :) <https://github.com/Souk21/TW-commandpalette>
This time it's a small one with a couple bugfixes:

- Fixed themes tiddlers being modified unexpectedly (Thanks to @linonetwo) 
<https://github.com/Souk21/TW-commandpalette/pull/4>
- Fixed "Save Wiki" bug (Thanks to @Saq Imtiaz) 
<https://groups.google.com/d/msg/tiddlywikidev/6nU5W3bQSY0/_C4xXoSyBwAJ>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/fe055dfc-f3dc-4114-9e55-25ebd52ed9afo%40googlegroups.com.


[tw5] Re: Plugin prototype: Command Palette

2020-06-28 Thread Souk21
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 :)

Le vendredi 26 juin 2020 16:47:02 UTC+2, Adam S. a écrit :
>
> 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.) 
>
>
>
> On Friday, June 26, 2020 at 9:49:30 AM UTC+2, Souk21 wrote:
>>
>> Hi Reet, I posted a thread in TWDev (
>> https://groups.google.com/forum/#!topic/tiddlywikidev/6nU5W3bQSY0) 
>> asking for help about this issue.
>>
>> Le vendredi 26 juin 2020 04:37:13 UTC+2, Reet Pandher a écrit :
>>>
>>> Hi Souk,
>>>
>>> Any luck fixing the *save wiki *command?
>>>
>>>
>>> On Tuesday, June 23, 2020 at 8:31:47 PM UTC+5:30, Souk21 wrote:
>>>>
>>>> New version 0.0.4 is up! <https://souk21.github.io/TW-commandpalette/>
>>>> 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
&

[tw5] Re: Plugin prototype: Command Palette

2020-06-26 Thread Souk21
Hi Reet, I posted a thread in TWDev (
https://groups.google.com/forum/#!topic/tiddlywikidev/6nU5W3bQSY0) asking 
for help about this issue.

Le vendredi 26 juin 2020 04:37:13 UTC+2, Reet Pandher a écrit :
>
> Hi Souk,
>
> Any luck fixing the *save wiki *command?
>
>
> On Tuesday, June 23, 2020 at 8:31:47 PM UTC+5:30, Souk21 wrote:
>>
>> New version 0.0.4 is up! <https://souk21.github.io/TW-commandpalette/>
>> 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?
>>
>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/6bc04603-bc91-4af8-9e40-22559cebe5a3o%40googlegroups.com.


[tw5] Re: Plugin prototype: Command Palette

2020-06-23 Thread Souk21


New version 0.0.4 is up! <https://souk21.github.io/TW-commandpalette/>
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's 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?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e4583f4c-5141-413c-90c4-8a62c0139b65o%40googlegroups.com.


[tw5] Re: Plugin prototype: Command Palette

2020-06-14 Thread Souk21
New version 0.0.3 is up! <https://github.com/Souk21/TW-commandpalette>


*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?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/c5eeefa7-ab4f-4402-a278-f64984837d6do%40googlegroups.com.


[tw5] Re: Plugin prototype: Command Palette

2020-06-13 Thread Souk21
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
Published roadmap (copied below) 
<https://github.com/Souk21/TW-commandpalette/blob/master/README.md>

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 9 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)

<https://github.com/Souk21/TW-commandpalette/blob/master/README.md#ideas>
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?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d7b015ba-d005-420e-a9c8-65b3c4dc8257o%40googlegroups.com.


Re: [tw5] Re: Plugin prototype: Command Palette

2020-06-11 Thread Souk21
@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 :)

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5445f755-62d2-4399-aff2-07d0f5848a59o%40googlegroups.com.


[tw5] Re: Plugin prototype: Command Palette

2020-06-11 Thread Souk21
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 :)

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/9ac5565a-1fbc-4579-805d-6712ad08ac54o%40googlegroups.com.


Re: [tw5] Re: Plugin prototype: Command Palette

2020-06-10 Thread Souk21
@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.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/3f617310-1898-4baa-898d-b7f475c6a0efo%40googlegroups.com.


Re: [tw5] Plugin prototype: Command Palette

2020-06-10 Thread Souk21
@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
>
>
> On Wed, Jun 10, 2020 at 10:01 PM Souk21 > 
> wrote:
>
>> 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.
>>
>> You can demo it here : https://souk21.github.io/TW-commandpalette/
>>
>> Let me know :)
>>
>> -- 
>> 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 tiddl...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/tiddlywiki/558ff87a-a6f6-47a9-b0e5-4d0b2714569bo%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/tiddlywiki/558ff87a-a6f6-47a9-b0e5-4d0b2714569bo%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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/98ff8a7e-1602-486a-b1ba-038df8521f05o%40googlegroups.com.


[tw5] Re: Plugin prototype: Command Palette

2020-06-10 Thread Souk21
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

Le mercredi 10 juin 2020 19:52:49 UTC+2, Saq Imtiaz a écrit :
>
> 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:
>>
>> 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.
>>
>> You can demo it here : https://souk21.github.io/TW-commandpalette/
>>
>> Let me know :)
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/cd577c3e-ce55-4817-8e3f-1839bbb3f3ffo%40googlegroups.com.


[tw5] Plugin prototype: Command Palette

2020-06-10 Thread Souk21


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.

You can demo it here : https://souk21.github.io/TW-commandpalette/

Let me know :)

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