nyxt icon indicating copy to clipboard operation
nyxt copied to clipboard

Bypassing prompt buffer for cases with a single suggestion

Open lansingthomas opened this issue 1 year ago • 3 comments

Hello all, I think an improvement here could be wonderful for getting users from A-->B a little more efficiently. However, after writing this out I am no longer convinced that we need to bother with it. I am going to post here then close the issue so we have a transparent record of the thinking process, but do not need to take action.

The idea:

Is your feature request related to a problem? Please describe.

Sometimes I find myself indicating a command, then confirming when confirmation can be easily assumed. I get the sense that the system could be doing more for me in some pretty common cases.

Executing a command in Nyxt often follows a pattern.

1. indicate the command you wish to run
2. use the `prompt-buffer` and list of `suggestions` to target your command
3. return
4. fun and profit

Some cases have only one Suggestion, the targeting step is already done. A more efficient flow might look like:

1. indicate the command you wish to run
2. return
3. fun and profit

Describe the solution you'd like FOR cases with a singular suggestion in the prompt-buffer we automatically return the command without displaying the prompt buffer.

Describe alternatives you've considered The seed for this idea came from a discussion in #2984 for finding a keystroke efficient way to close panel buffers.

Perhaps we can test the single suggestion bypass feature on this concrete use case (panel buffer deletion with delete-panel-buffer)

Additional context IF my only options are to EITHER return a singular suggestion OR close the prompt-buffer WHY am I seeing the prompt buffer in the first place?

@aartaka mentioned this earlier

having the prompt is a nice confirmation moment so that one can reconsider (irrevocable) panel deletion.

how we might do it:

Help me answer these questions to move the discussion forward.

Where would this prompt-buffer-bypass apply?

  • single suggestion prompt buffers for common actions
    • delete-panel-buffer & change the Docstring to "Delete a single panel buffer, OR prompt for panel buffers to be deleted."

In which cases do we keep the prompt buffer?

  • Keep it anytime we have more than one suggestion.
  • Keep it in cases with one suggestion where the importance of the action is high enough that users would appreciate a nice confirmation moment.
    • delete-window
    • delete-buffer
  • keep it for commands with "query" as the action verb
    • history-forwards-query
    • history-backwards-query
  • keep it for commands with "prompt" as the action verb

it is looking like we do not have many compelling opportunities for this feature... the only case I can think of seems to be easily done with the delete-all-panel-buffers command (recently bound in #2984)

lansingthomas avatar May 30 '23 19:05 lansingthomas

closing for now, willing to reopen if/when someone finds more use cases for the proposed feature.

lansingthomas avatar May 30 '23 19:05 lansingthomas

I mean, we do this type of action in history-forwards-maybe-query already. As per the docs:

If current node has multiple children, query which one to navigate to.
Otherwise go forward to the only child.

And then, in buffer deletion that critical of an action? It's revocable with reopen-buffer/reopen-last-buffer (we should probably mention it in the echo message for buffer deletion), so it's not that critical. But yes, window deletion is quite critical.

So my list of commands to bypass:

  • history-forwards.
  • delete-panel-buffer.
  • delete-buffer.
  • reload-buffer.

Commands to merge into the commands above:

  • history-forwards-maybe-query—merge into history-forwards?
    • As an author of global history tree, I'm biased here :P
  • reload-buffers—if we make reload-buffer to have multiple selection.
    • Or the other way around—remove reload-buffer for reload-buffers.
    • A long overdue one, actually. Not even sure why we have two commands here...

aartaka avatar May 30 '23 19:05 aartaka

Also see https://github.com/atlas-engineer/prompter/issues/10.

Ambrevar avatar May 31 '23 09:05 Ambrevar