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

[Feature] Action/Command prompt (and shortcut) #6181

Open
Sourcemancien opened this issue Dec 4, 2024 · 0 comments
Open

[Feature] Action/Command prompt (and shortcut) #6181

Sourcemancien opened this issue Dec 4, 2024 · 0 comments

Comments

@Sourcemancien
Copy link

Sourcemancien commented Dec 4, 2024

Context

Used system: MacOS

As Typora has gained a lot of nice features among the years, it translates into a lot of shortcuts to know currently, or a lot of patterns to keep in mind to insert the intended object into the document.

Now Typora can compete with some lightweight but feature-rich text editors, but this one fully dedicated to markdown format.
This dedication to markdown causes it to have really specific concepts and shortcuts compared to other text editors.
Having to search for some actions, some shortcut can easily break the thinking and writing process of the user, and affects its focus.

Among the ecosystem of text editors (and IDE), we'll notice that SublimeText and Visual Studio Code, also probably Brackets or Atom, and for more advanced IDE like JetBrains' ones... all of them includes a feature of a command-prompt that allows, with a simple shortcut to display a prompt popup to search for any actions, shortcuts or feature of the tool.

⚠️ Note that open-source, free, similar project marktext has a command palette feature, and it's even the first feature explained as a basic, in their Getting Started documentation: https://github.com/marktext/marktext/blob/master/docs/BASICS.md#getting-started

Sum up of the feature

A practical and simple shortcut to invoke a prompt that will help to call the shortcut in regard of an intent.

It simpler to have a command prompt than to associate every feature to a dedicated shortcut.
Actually there's even some feature which doesn't have an insertion shortcut, despite the plenty existing ones.
For exemple, there's not a single shortcut to insert a GitHub-like note/warning/tips/caution quote block. It has to be done manually, or searched for with the mouse.

Expected benefits

  • fluid, better typing experience for users which use a lot of different item but not with enough regularity to lear all shortcuts. Prevent to have to navigate into menus to find some items in case of doubt.
  • better experience for users who regularly switch of OS: no pain from having to know shortcut depending on the current OS, a single shortcut
  • more natural for anyone: item's shortcuts may be perceived as counter intuitive depending on their habits, experiences and culture.
  • no need to learn a cheatsheet
  • new items/actions wouldn't need a shortcut to gain in accessibility

About implementation and expected complexity

Sadly, the project not being open-source we can't help to evaluate the complexity of the feature.

But it doesn't seem to be overcomplicated to have a prompt that'll search a word among the closest feature name.
It could even be i18n compatible without too much pain I think.

For example, the application could index on startup the actions' labels.
Then the prompt could search among the indexed labels for the amount of occurence of inputed word, or the one closest..etc
And not having to find a unique matching result, as the prompt would act as search, the result could be a list of 5 or more results, potentially sorted by amount of matching word or characters.
Thus it would even be i18n compatible.

filtering and ordering the results

considering the input could contains multiple words.
It would be a better experience to not search for something matching the whole input, but use each single word inputted as a filter.
And then ordering the result by the amount of word matched.

process' logic:

  1. split the prompt input into set of words
  2. filter the indexed actions to the ones containing any of these words
  3. compute a ranking in regard of user's intent, based on 1 or more factor: number of matches, whole word matching, order of word, ...
  4. order by rank

Examples of use cases

Let's say the command prompt shortcut would be "CTRL+SHIFT+P":

For instance, whatever I want to insert in the document, first I'll just perform the shortcut, then just a word would be enough to propose the n closest items.

Examples:

note: Intentional use cases of non efficient manner to search, to show the filtering action behavior.

A. I want to insert a code block by searching for "block code"

  1. CTRL+SHIFT+P open the prompt popup with keyboard focus in it
  2. I type block in the prompt; don't have to valid for it to start listing features
  3. it proposes me a list of actions which contains "block":
    {caution block, code block, important block, math block, note block, tip block, ... }
  4. extending the input in the prompt with c thus resulting in the prompt being block c
  5. the list dynamicaly update its content to the ones containing both words :
    {caution block, code block}
  6. appending the last word with o, prompt contains block co
  7. results updated to {code block}

B. I want to insert a tip block

  1. CTRL+SHIFT+P open the prompt popup with keyboard focus in it
  2. I type block in the prompt; don't have to valid for it to start listing features
  3. it displays to me a list of actions which contains "block":
    {caution block, code block, important block, math block, note block, tip block, ... }
  4. extending the input in the prompt with t thus resulting in the prompt being block t
  5. the list dynamicaly update its content to the ones containing both words :
    -> 1st possible behavior, sorted alphabetically : {caution block, important block, math block, note block, tip block}
    -> other possible behavior, sorted by startingWith the not matching whole word: {tip block, caution block, important block, math block, note block}
  6. appending the last word with i, prompt contains block ti
  7. results updated to {tip block}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant