DEV Community

Cover image for Inkscape Command Palette: GSoC 2020
Abhay Raj Singh
Abhay Raj Singh

Posted on

Inkscape Command Palette: GSoC 2020

Command Palette

Command Palette strives to be, in simple terms an Access Point. The interface it chooses is text.

Some features that we have included(and planned to include) in the command palette are:

  • Actions Search: Inkscape has a plethora of features and it becomes hard to remember where they are in deeply nested menus. A large number of operations also create difficulty in assigning shortcuts for all of them. This feature helps to search and execute all actions(operations) specifically Gio::Actions, search files, preferences, and others.
  • Python execution: This feature depends(blocking) on Integrating Python into Inkscape, Merge Request. This useful for the times when you need some programming goodness for technical accuracy in your designs. For example: Plotting 2D density of an equations
  • Shell execution: This is more of a developer and CLI users oriented feature, to test that commands have the desired effect.

Progress

30 June 2020

Command Palette is now capable of searching and executing actions. Actions are the future of how Inkscape will do things/operations. There are close to 100 as I write. Though it's still a long way to go converting all verbs to actions we will get there.

Let me give you a tour of how to use Command Palette.

The default key to toggle CP is ? (question mark). Thanks to Maren Hachmann for the idea.

Once you press ?. A rectangular box with rounded corners appears on the canvas. (comment below if you like/dislike this design also suggest other locations/design for CP)

Command Palette Open SS

Let's start with anatomy.

Anatomy

The most annoying part (Ctrl + `) is a placeholder for shortcuts of the actions. Placeholder because currently, only verbs predecessors to actions have shortcuts.

In the bold fonts are action names. Currently, an action's name is a verb name of that action. They aren't translatable but I am working and soon will be replaced.

Action name is preceded by the group that action belongs to. Example, File, Dialog, Transform, etc.

Below the action name is the description for what action does.

That's not all let's see what invisible.
CP Preferences
Let's enable the options
CP Preferences checked
After restarting Inkscape this is how Command Palette looks like.
CP Open all enabled

The name in small size letters will always be in English, this is to enable tutors of different Interface language to help others.

The cryptic name in far-right is the full action name helpful for CLI users.

Usage

You type to search and click to execute. Press Esc key at any time to close CP. Currently, searching relies on a substring search algorithm.
TODO: I'm working on a fuzzy search algorithm for this.

CP Searched

Alternatively, you can navigate between suggestions with Tab and Shift + Tab or arrow key and press enter to execute.

The top row is automatically highlighted when searching so when you press enter/return/linefeed.
NOTE: some bug causes this feature to require 2 presses and highlighting only work if the same row is on top for 2 letters pressed during a search.

Arguments

We ask action parameters/data as depicted below
How we ask for data

Due to restriction of Gio::Actions we, for now, can only ask for one parameter.

TODO:

  • Add better(snippet like) support for multiple params
  • Better descriptions/context of parameter

Links:
GitLab Merge Request
GitLab UX issue
GitLab Technical issue

Theme: Flat Remix

Please comment below any Ideas/Questions you can think of.
Decency level: *Roast me

Top comments (1)

Collapse
 
sovtrotter profile image
Arsh Sharma

Don't know if it's the right thing to do, but I think you can add a transparency setting(some slider) for the palette. Also some syntax highlighting like feature for the Action title, description, shortcut and other text items in the palette would be really nice?PS:I don't know how to roast you. xDDD