Open Bug 1603718 Opened 5 years ago Updated 2 years ago

Implement basic version of a command menu

Categories

(DevTools :: General, enhancement, P3)

enhancement

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: sebo, Assigned: nchevobbe)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

This bug is meant to implement a basic version of the command menu mentioned in bug 1603713.

The menu should consist of a list of commands and a filter field which overlay the current panel. It should include the basic functionally of opening the menu via a keyboard shortcut (probably Ctrl+Shift+P) and the general DevTools menu.

The commands list needs to be scrollable, navigatable via mouse and keyboard (and maybe touch) and filterable.

The filter field should at least allow to match commands by ignoring the case and any spaces in the command's words. E.g. entering showd should match a command called "Show Debugger".

Clicking a command or pressing Enter when it's selected executes it and closes the command menu.

The commands that should initially be supported are one-off commands, i.e. commands that can be called directly without options. For example, those tasks may include global ones like panel navigation, preference toggling, or reloading the page as well as panel-specific actions like clearing the console or deactivate all JavaScript breakpoints. In preparation for easy extensibility, any panel-specifc commands should be registered by the panels themselves.

The command palette implemented in the Debugger panel can serve as a good starting point, UI wise, and might be reused for this purpose.

Sebastian

Some related items:

See Also: → 1567497, 1567550
Priority: -- → P3

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: General → Debugger
Component: Debugger → General

Just a quick heads up. I've started playing a bit around with this and already could get the commands registration and execution to work. So far there is no command menu yet, the commands are directly executed by pressing Ctrl+Shift+P.
Once I have something proper including a simple version of the command menu, I'll upload the patch in order to get some feedback.

Sebastian

Sebo, as we discussed it this week, feel free to upload you WIP patch here so we can discuss about it :)

Flags: needinfo?(sebastianzartner)

This is a very basic WIP patch for a command menu. It registers the DevTools-wide keyboard shortcut Cmd+Shift+P/Ctrl+Shift+P which opens the menu as a stacked <div>. The menu is based on a new Modal dialog which is intended to be a general feature that can be used for different kinds of popups. For testing purposes, the menu includes two commands for toggling between the light and dark theme.

There are still many ToDos (might be incomplete):

  • Properly implement the Modal component so it can be closed/dismissed
  • Implement the search logic
  • Add keyboard control
  • Style everything nicely
  • Add a preference to further implement the feature behind it
  • Add more commands
  • Add an option to theh menu to be able to also access it from there
  • Fix ESLint issues
  • Add tests

Hi Nicolas, here it is. It was lying around for several months now and the implementation is very rudimentary, so please bear with me!
Furthermore, please note that the UI/UX still needs to be discussed. Victoria created some nice mockups for it at some point. Those differ a lot to what other tools have, though.

Your feedback to the current implementation and whether that's generally the right approach is greatly appreciated!

Merry Christmas and a Happy New Year 2022!

Sebastian

Flags: needinfo?(sebastianzartner)
Severity: normal → S3
Flags: needinfo?(nchevobbe)
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Flags: needinfo?(nchevobbe)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: