Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command pallete should have access to almost all ui actions #1132

Open
Wumpf opened this issue Feb 7, 2023 · 1 comment
Open

Command pallete should have access to almost all ui actions #1132

Wumpf opened this issue Feb 7, 2023 · 1 comment
Labels
📺 re_viewer affects re_viewer itself ui concerns graphical user interface

Comments

@Wumpf
Copy link
Member

Wumpf commented Feb 7, 2023

We need to make the command pallete much more powerful and much easier to integrate in almost all aspects of the viewer.
To achieve that we need to (among other things):

  • Catch the current selection (and maybe even hover-) context
  • think of ways to add more generic commands that capture a wider variety of actions?
  • add tags/alias text that improves the search result
  • grind through all other existing actions and add them to the palette (as of writing this means adding more values to Command in https://github.com/rerun-io/rerun/blob/main/crates/re_ui/src/command.rs)

Stronger formalization of actions in the code like this will also make it easier in the future to add undo/redo!

@Wumpf Wumpf added ui concerns graphical user interface 📺 re_viewer affects re_viewer itself labels Feb 7, 2023
@emilk
Copy link
Member

emilk commented Jan 2, 2024

Me and @nikolausWest discussed this a bit more today. There are some thoughts:

Summary

  • The command palette should be powerful enough to do (almost) anything in the UI.
  • It should replace all our modal dialogs, e.g.:
    • clicking "Add entities…" on a space-view selection would open the command palette with the first half of the command filled in: space_view:3d add (list of entities shown)
    • right-clicking an entity could select it and open the command palette with available commands for that entity: $selection (list of commands for the selection are shown)
  • You should be able to select entities, space views, and time ranges in it.
  • You should be able to act on the current selection (e.g. save it to .rrd).
  • It should be similar in structure to our (upcoming) CLI tool for working on .rrd files
  • It should have ways to copy out the command as a CLI command or a Python log line
  • Good auto-completion and filtering
  • In the viewer, use Commandenum for basically every GUI interaction

This issue is just a VERY rough outline. There is much to figure out when it comes to syntax.

The blank command palette

When you open the command palette, it should invite you to do one out of a few things:

  • Run a "static" command (show a list of most recent ones)
  • Run a command based on the current item selection (if any), e.g. "save selection as .rrd" or "add selected entities to a new space view"
  • Select something (search among entities, space views, etc)

Selections

There are many things we may want to be able to select:

  • Data: entity path, component path, instance path, …
    • We have a design for the syntax for this: world/foo:Color[#123]
    • Entity trees, e.g. world/3d
  • Space Views and Space View containers
    • by name? or by path in the hierarchy?
  • Times and time ranges

Some commands require multiple arguments, e.g. "add world/** to space-view 3d" should be expressible in the command palette.

How do we differentiate what is beeing selected? Do we prefix? E.g. DataStore:world/* vs Blueprint:spaceviews/3d? Put everything in the same entity path hierarchy ("everything is an entity path")?

Command order

Consider the command for adding entities to some space view.

It could be viewed as one function with two arguments: add_entities_to_space_view world/** 3d. This will create a very large number of commands, with no context awareness of what is currently selected.

It is probably better with a more object-oriented design, where we have a list of functions that is dependent on the preceeding object (like obj.member() functions in OO languages): space_view:3d add_entities world/**. For symmetry, we should probably also support entity:world/** add_to space_view:3d.

We should also allow using the current selection in any command, at least in the first position
* $selection add_to space_view:3d
* $selection add_entities world/**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📺 re_viewer affects re_viewer itself ui concerns graphical user interface
Projects
None yet
Development

No branches or pull requests

2 participants