Skip to content

Conversation

AlexD717
Copy link
Member

@AlexD717 AlexD717 commented Aug 14, 2025

Task

Create a command tool, that allows synthesis users to type in "/" followed by a command that then executes a specific action.

AARD-2079

Symptom

It can get annoying for developers and users to have to go through multiple panels to achive what they want. For advanced users of Synthesis a command tool would let them quickly type commands to implement a specific action. For example, instead of having to go to debug tools, then clicking toggle drag mode, then clicking hide debug tools panel, you could just type "/drag mode" and it will toggle the drag mode.

Solution

Implement a simple Command palette that appears when pressing "/" and lists options of different commands. It uses an algorithm to determine what you are most likely typing and then suggesting that as an option. This means that both "/drag" or "/drqg" (typo example) will triggle the toggle drag mode command.

Verification

  • Pressing "/" opens up a command pallet
    • Doesn't open in the welcome screen (singleplayer/multiplayer selection screen)
    • Doesn't open if a modal is open
  • Pressing "esc" closes the command palette
  • Starting to type in a command has different options appear, with options that you most likely want appearing at the bottom
  • pressing enter runs the command you have selected (or clicking on the command with the mouse)
  • Can use arrow keys to navigate between selected commands (or mouse)
  • Clicking outside of the command palette closes it

Before merging, ensure the following criteria are met:

  • All acceptance criteria outlined in the ticket are met.
  • Necessary test cases have been added and updated.
  • A feature toggle or safe disable path has been added (if applicable).
  • User-facing polish:
    • Ask: "Is this ready-looking?"
  • Cross-linking between Jira and GitHub:
    • PR links to the relevant Jira issue.
    • Jira ticket has a comment referencing this PR.

@AlexD717 AlexD717 self-assigned this Aug 14, 2025
@AlexD717 AlexD717 added the ui/ux Relating to user interface, or in general, user experience label Aug 14, 2025
@AlexD717 AlexD717 marked this pull request as ready for review August 14, 2025 17:01
@AlexD717 AlexD717 requested review from a team as code owners August 14, 2025 17:01
@azaleacolburn
Copy link
Contributor

Doesn't open in menu selection

  1. I'm not sure what you mean by this, but it does still open when you have panels open (including the main menu panel which is what I assume you mean). If you mean within the command palette, then yes indeed typing / doesn't open another one.
  2. I like how the drag mode command works, I think the commands that open panels should toggle them instead.
  3. I think that trying to navigate past the first or last option should wrap around to the other end of the list.

@AlexD717
Copy link
Member Author

Doesn't open in menu selection

  1. I'm not sure what you mean by this, but it does still open when you have panels open (including the main menu panel which is what I assume you mean). If you mean within the command palette, then yes indeed typing / doesn't open another one.

I meant the welcome screen. Will clarify that
Screenshot 2025-08-14 at 10 38 03 AM

I agree with your other suggestions and will implement them

@AlexD717
Copy link
Member Author

  1. I like how the drag mode command works, I think the commands that open panels should toggle them in

Waiting on pr #1268 to be merged in first, as that implements support for detecting if panels/modals are already opened

@AlexD717 AlexD717 marked this pull request as draft August 14, 2025 18:18
@AlexD717 AlexD717 marked this pull request as ready for review August 14, 2025 22:22
Copy link
Member

@rutmanz rutmanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Looks like typing in the search bar also drives robots around (WASD and arrow keys)
  2. I think whenever you reference a robot name, you should also reference the control scheme name (currently two dozers can't be distinguished)

@AlexD717 AlexD717 requested a review from rutmanz August 15, 2025 15:48
Copy link
Member

@rutmanz rutmanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Luna scheme conflicts with this binding. I would either make the triggering key rebindable or prevent inputs from using it

@AlexD717 AlexD717 requested a review from rutmanz August 15, 2025 16:13
Copy link
Contributor

@itspvty itspvty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this concept overall and the use of fuse.js is very cool.

Copy link
Member

@ryanzhangofficial ryanzhangofficial left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love it!

Copy link
Member

@PepperLola PepperLola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you get rid of this highlight ring?

Image

Also, I think it would be worth adding options for the different tabs of the configure panel just like there are for spawning.

@AlexD717
Copy link
Member Author

Could you get rid of this highlight ring?

Image

In my opinion, the command pallet without any border looks weird, when you have something other than the bottom part selected.
Screenshot 2025-08-22 082846

If I make the boarder 1px dark grey, it adds a slight line, which separates the text box, making it more clear.
Screenshot 2025-08-22 083021

Are you fine with the second option or do you still think the first is better? (@PepperLola)

@azaleacolburn
Copy link
Contributor

I like the last option best personally

Autocomplete could sometimes get in the way, and be annoying.
Copy link
Member

@PepperLola PepperLola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the separator but I think it would make sense either to have the border around the whole thing or just have a separator between the input and the options (only the top of the input), and maybe then get rid of the border radius on the top left and right.

@AlexD717 AlexD717 requested a review from PepperLola August 22, 2025 19:26
Copy link
Member

@PepperLola PepperLola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I added a bunch of new commands, they weren't all accessible since it was only including enough to fit. I think the list should have a max height but should be scrollable and include all the registered commands
Image

@AlexD717
Copy link
Member Author

I like the separator but I think it would make sense either to have the border around the whole thing

The border is around the whole thing right now

When I added a bunch of new commands, they weren't all accessible since it was only including enough to fit. I think the list should have a max height but should be scrollable and include all the registered commands Image

If you start typing it very quickly filters them out

@PepperLola
Copy link
Member

PepperLola commented Aug 22, 2025

If you start typing it very quickly filters them out

That's true, but I think you should be able to scroll through all of them to see what options are available. It's true that you can filter some out so I guess it's not super important to include in this PR but I definitely think it would be worthwhile to add.

EDIT: on second thought, I think it should be included in this PR as it's pretty core functionality and I think necessary for a good user experience

@AlexD717 AlexD717 requested a review from PepperLola August 22, 2025 20:07
Copy link
Member

@PepperLola PepperLola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks good. It would be nice if the scrolling were smooth, and there were a couple bugs I couldn't figure out how to consistently reproduce (sometimes it would always scroll the selected option to the second slot from the top, regardless of whether I was scrolling up or down). I think it's in a good state to be merged, keeping these fixes in mind for the future.

@PepperLola PepperLola merged commit f03177a into dev Aug 23, 2025
15 of 18 checks passed
@BrandonPacewic BrandonPacewic deleted the alexey/2079/command-tool branch August 29, 2025 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui/ux Relating to user interface, or in general, user experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants