Toolbox Search plugin now available

490 views
Skip to first unread message

Aaron Dodson

unread,
Jul 6, 2023, 2:53:41 PM7/6/23
to Blockly
Hi all,

Just wanted to drop a quick note that we've created a plugin that allows searching the available blocks in the toolbox. You can try it out here or include it in your own project via NPM.

The plugin lets you add a search field category to the toolbox, which filters the blocks shown in the flyout as you type. Blocks are filtered based on their human-readable text as well as their programmatic block type (the latter is helpful for surfacing blocks that don't have a lot of text on them). Only blocks that are included in some other category in the toolbox will be shown.

There are a number of limitations - I'll try to address some of those in the future, but PRs are happily accepted!

- Aaron
Message has been deleted

fu6...@gmail.com

unread,
Jul 15, 2023, 11:39:36 PM7/15/23
to Blockly
Hi  Aaron,

Thank you for your sharing. I have referenced the approach provided in this example and successfully implemented a similar functionality. This feature supports two top-level categories, and even if the blocks in the toolbox are modified, it can simultaneously update the variables of the cached blocks to achieve the latest query. I am delighted to have accomplished the feature and share it with everyone. 

This is my sample code.
Please test my project and provide me with suggestions for improvement.
Thank you all for your efforts.

mySearch.png

Best wishes.

fu6...

ado...@google.com 在 2023年7月7日 星期五凌晨2:53:41 [UTC+8] 的信中寫道:

Licorne Magique

unread,
Jul 16, 2023, 6:21:47 PM7/16/23
to Blockly
Hi,
your work are really interesting, because everybody has a different point of view about this "search plugin". Mine is alo different, I added only a system to search a category and check filter when there are too many categories. I also added keyword in toolboxes so I added also a filter that works on category AND blocks.
But as I created it quickly, my code is not clean and embbed in my project..sorry you have to dive in if you want to look at it.

You can test my project (https://a-s-t-u-c-e.github.io/STudio4Education/)  and transform it in plugin, or help me to do something better.
Thank you all for your work.

S4E_search.jpg

Mark Friedman

unread,
Jul 17, 2023, 10:59:51 AM7/17/23
to blo...@googlegroups.com
Perhaps you could make a pull request to make Aaron's toolbox search repo in order to improve the plugin.

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/94d98276-f3e7-4c9f-883a-44d76c81321dn%40googlegroups.com.

Aaron Dodson

unread,
Jul 17, 2023, 6:17:05 PM7/17/23
to Blockly
Thanks everyone for sharing your implementations! And a big +1 to Mark's point - if there are features your feel the plugin I shared is missing, I'd welcome a PR adding them!

Seb Seb

unread,
Jul 19, 2023, 6:53:07 AM7/19/23
to Blockly
As I'm totally newbie in typescript, I need to find spare time to learn it by myself...
So maybe in many months I could make any PR...I'm not as good as fu6.

Mark Friedman

unread,
Jul 19, 2023, 1:48:38 PM7/19/23
to blo...@googlegroups.com
Seb,

  My reply suggesting a PR was directed to fu6, but of course contributions from anyone are welcome!

-Mark


Message has been deleted
Message has been deleted

fu6...@gmail.com

unread,
Jul 27, 2023, 12:07:42 PM7/27/23
to Blockly
Hi all,

After continuous testing,  I have successfully developed a more practical search feature for blocks , as demonstrated in the video. I hope my sharing is helpful to everyone, but I have no experience with TypeScript language and NPM plugins.This is sample code.

Best wishes
fu6...
Toolbox Search.mp4

Seb Seb

unread,
Jul 27, 2023, 2:11:58 PM7/27/23
to Blockly
Congratulation! Very useful!

Murali Manohar Varma

unread,
May 5, 2024, 5:17:17 PM5/5/24
to Blockly
How can i move the search input from toolbox to inside the flyout? Please help me on this.
Message has been deleted

Beka Westberg

unread,
May 6, 2024, 12:18:45 PM5/6/24
to blo...@googlegroups.com
Hello,

It's not currently possible to include custom elements in the flyout rather than the toolbox :/ But we're investigating doing that this year!

Best wishes,
--Beka

On Sun, May 5, 2024 at 2:17 PM Murali Manohar Varma <dev...@gmail.com> wrote:
Hi Aaron,
How can i move the search input to inside the toolbox flyout, i just want to show text on toolbox. Please help me how can i achieve this, some pointers are all i need.

Thanks

On Thursday, July 27, 2023 at 11:41:58 PM UTC+5:30 prt...@gmail.com wrote:

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.

Murali Manohar Varma

unread,
May 6, 2024, 3:19:42 PM5/6/24
to Blockly
Not necessarily inside the flyout, i am good with mapping a outside input element.

Beka Westberg

unread,
May 6, 2024, 4:31:58 PM5/6/24
to blo...@googlegroups.com
Hello,

Could you create a new forum thread showing a picture of what you want to achieve and what you've tried so far? I don't want to clutter up this thread!

Best,
--Beka

Murali Manohar Varma

unread,
May 6, 2024, 5:11:47 PM5/6/24
to Blockly
Sure.
Reply all
Reply to author
Forward
0 new messages