mastodon-sc / mastodon

Mastodon – a large-scale tracking and track-editing framework for large, multi-view images.
BSD 2-Clause "Simplified" License
65 stars 20 forks source link

Provide textual way to search and run commands in Mastodon #309

Open stefanhahmann opened 4 weeks ago

stefanhahmann commented 4 weeks ago

User Story

In Fiji the, there is a search box that can be used to search and run FIJI commands.

grafik

This provides a convenient way to find and access functions for users, which does not require to search within the menus. It would be cool to have a similar mechanism also within Mastodon, since there are also a lot of functions in the core and also in the plugins, which are difficult to explore.

I could imagine three options how to provide this function:

  1. Add a search box to Mastodon windows in the lower right corner just as in Fiji to search Mastodon and run Mastodon commands: grafik
  2. Add a search box to the main Mastodon panel: grafik
  3. Add a new "Test" button in the Keymap settings that would run the currently filtered/selected command grafik
tinevez commented 3 weeks ago

Hello

Could you test the command-finder branch? Right now the command finder is implemented for all the views, but not the extra windows. The default shortcut is ctrl shift F I would be glad to have a first feedback

stefanhahmann commented 3 weeks ago

I think this branch goes very much into the direction to what was asked by the user who approached me with this idea.

This would be my feedback after testing:

stefanhahmann commented 3 weeks ago

I will make the version of this branch available for the user who had the idea for this feature and ask him for feedback as well.

tinevez commented 3 weeks ago

Thanks!

  • It would be nice, if there was an alternative way to access the command finder. With only the CTRL + Shift + F shortcut, it would be a bit hidden. I think, if there was some additional visual search bar, users would benefit even more from the existence of the Mastodon command finder

Yes, this is true. I am still a bit unsure though. I think that if we add too many widgets we will loose data content and confuse the new users. I need to think and use it.

  • The list of available commands seems incomplete:
    • E.g., if opened from BDV, I cannot set the 2d drag rotate in the command finder, while in the dialog File > Preferences > KeyMap, I can:

It's actually on purpose. What you mention here are Behaviors, they require something with the mouse (drag, click etc). The command finder only work for Actions that can just run as is.

  • The Workflow e.g. CTRL + Shift + F > Fix Project Path > Run > Cancel should maybe leave the command finder open, since users may want to run some other commands

Mrmlml not such a fan of letting it open. Maybe we could make this configurable?

  • A Double Click on an action should start the action as well

Yes.

stefanhahmann commented 3 weeks ago

Yes, this is true. I am still a bit unsure though. I think that if we add too many widgets we will loose data content and confuse the new users. I need to think and use it.

I see your point. I would still vote for it, since it helps also new users.

It's actually on purpose. What you mention here are Behaviors, they require something with the mouse (drag, click etc). The command finder only work for Actions that can just run as is.

I see. How can actions from plugins be added?

tinevez commented 3 weeks ago

I see. How can actions from plugins be added?

I realize that I collect actions only from one Actions instance. In Mastodon, they are spread over several instances, sorted by category. I need to rewrite this to include several instances, including the Plugins one.

stefanhahmann commented 3 weeks ago

Mrmlml not such a fan of letting it open. Maybe we could make this configurable?

Yes. Maybe this is an option. A checkbox in the command finder dialog "keep open". It could be off by default.

I realize that I collect actions only from one Actions instance. In Mastodon, they are spread over several instances, sorted by category. I need to rewrite this to include several instances, including the Plugins one.

Sounds good.

tinevez commented 3 weeks ago

Can you test again?

tinevez commented 3 weeks ago
stefanhahmann commented 3 weeks ago

Can you test again?

Yes.

the plugin actions should be supported

I still have difficulties with this. E.g. I was looking in the command finder for some actions from the Trees Management, but can't see them:

grafik

In the Preferences dialog, I can see them however:

grafik

Is there something that needs to be adapted on the side of the plugins?

installed also on the main window

Works nicely!

common commands are merged in the table

Works nicely!

double-click works

Works nicely.

tinevez commented 2 weeks ago

I think you need to run the command finder on the window that can accept the commands to see them. For instance the tree management commands you mention are only visible in trackscheme and bdv context, so they will appear only in these windows. If you want them to appear everywhere you need to add them to the mastodon context

stefanhahmann commented 2 weeks ago

Yes, I can confirm that it works exactly like this. Thanks for the explanation

jgirstmair commented 6 days ago

Hi JY and Stefan! I tested the latest version of the command finder, which I find extremely useful (I am the user who asked for it 😅 inspired by Fiji's quick search bar). I couldn't find any issues and was already happy to discover some new commands like 'select all links' that I haven't been aware of. I will keep testing it and come back here in case I notice something unexpected or if I have further suggestions. But right now I think it could stay like it is. One minor thing I agree with Stefan: It would be nice to have the option somewhere that the command finder stays open after running a command. I had a feeling Fiji's quick search bar used to behave like this, but it got changed. Right now it also closes after executing any command. Is there a specific reason why this was changed and why it should be avoided in Mastodon's command finder? Cheers