Hi,

I was playing with spotter a bit and run into the following idea.

I wanted to search for the Configuration Browser. So I type "configuration
bro".

Of course, nothing appears because it is in the Tools submenu of the World
menu. Which I should know if I'm looking for it...

But, I thought that maybe it would make sense to show then the "Tools" menu
when I type configuration browser. More generally, when the thing I look
for is in the sub menu of an item, I show its parent.

I found my way and change this method:

MenuMorph>>spotterItemsFor: aStep
<spotterOrder: 10>
^ aStep listProcessor
title: 'Items';
candidatesLimit: Float infinity;
allCandidates: [ self items ];
itemName: #contents;
itemIcon: [ :item | item icon ];
actLogic: [ :item | item hasSubMenu
ifTrue: [ aStep diveIn ]
ifFalse: [ item spotterActDefault. aStep exit ] ];
added ==> matchLogic: [ :item :string |
item hasSubMenu
ifFalse: [ (string, '*') match: item contents ]
ifTrue: [ item subMenu allItems anySatisfy: [ :sub | (string, '*') match:
sub contents ] ]]

My question is: Does this behavior make sense to my spotter designer
friends? Can it be applied more generally?

Then, something I didn't implement but I'd like to have. When a sub-item
matches, the shown element should have some visual feedback showing the
reason of the selection...

Reply via email to