-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
Fix keyscheme common settings #3097
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I even got tripped up on this, like the other user, I was wondering why my Emacs bindings didn't work!
750290a
to
34f4e79
Compare
Good call. Updated. |
Because
To avoid breaking things downstream by applying the incorrect mixin, I've switched to |
Leaving Instead of the direction this PR takes, I'd suggest splitting the web/prompt buffer configuration into two separate sections. So that it's: # Regular buffer keyscheme (keyboard shortcuts)
- CUA
- Emacs
- VI
# Prompt buffer (input menu) keyscheme
- CUA
- Emacs
- VI command
- VI insert Notice that VI insert is the Having both web and prompt buffers to have the same keyscheme takes away flexibility and can be harmful in some corner-cases (I myself want to switch to VI bindings for regular buffers, but I'll never surrender Emacs mode in the prompt buffer, because Emacs input scheme is a perfect match for a mode-less input area with instant feedback). On the opposite, having separate prompt buffer configuration makes the behavior more flexible and makes it clear that there are two really different modalities one should consider separately. We lose nothing (except the screen space another |
I just realized this PR exists, so I'm going to put my two cents in, hoping you don't mind. I don't know the ins and outs of this project to the extent to be confident enough about my understanding of the change or the terminology that was discussed. These said, I believe I have understood the code change, and also the comment of @aartaka . As per my understanding, his comment is in-line with my suggestion . Here is a rephrase of my suggestion: In the settings page, allow user to choose the default keybindings (in @aartaka terminology "regular buffer"), and also add another drop-down menu for selecting the keybinding scheme for the "prompt buffer". Upon selection of the "regular buffer" binding scheme:
Something like this mockup can make it clear to users what each option is: This way there is no surprise, and new users would feel like home and also people like me would highly appreciate the customizability and flexibility of Nyxt. 🤓 |
I agree with @aartaka and @mmahmoudian . |
@jmercouris, thoughts? |
I don't care, just make it obvious for the user what is going to happen! :-D |
40cd931
to
bd154cb
Compare
I'm not convinced by the argument that proposes separating setting the keyscheme for From a technical perspective, the separation isn't exhaustive as well. Think of (define-configuration prompt-buffer
((default-modes (pushnew 'nyxt/mode/emacs:emacs-mode %slot-value%))))
(define-configuration web-buffer
((default-modes (pushnew 'nyxt/mode/emacs:emacs-mode %slot-value%))))
(define-configuration nyxt/mode/editor:editor-buffer
((default-modes (pushnew 'nyxt/mode/editor:plaintext-editor-mode %slot-value%)))
The observation above is sensible, and motivates commit 43585e5. An example of a buffer that is an (define-configuration (input-buffer modable-buffer)
((default-modes (pushnew 'nyxt/mode/emacs:emacs-mode %slot-value%))))
(define-configuration input-buffer
((default-modes (pushnew 'nyxt/mode/emacs:emacs-mode %slot-value%)))) |
This is a matter of language used in
Indeed, we've forgotten the
Did you mean
But wait, this enables Emacs mode for:
Booleand OR, in other words. I guess that you meant is just the intersection (boolean AND). For that, you need to target a class that is an intersection of EDIT: Broken quotation syntax. |
Yes, thanks. I've fixed it. I'm conveying that setting a keyscheme mode for
Correct. I had the wrong idea about the semantics of
Today that is correct. We just forgot about While I agree that it's odd to add a keyscheme mode to an entity like (define-configuration input-buffer
((default-modes (pushnew 'nyxt/mode/emacs:emacs-mode %slot-value%))))
(define-configuration (web-buffer prompt-buffer panel-buffer editor-buffer)
((default-modes (pushnew 'nyxt/mode/emacs:emacs-mode %slot-value%)))) |
Not including the things we're not sure/aware/remembering about is more robust than including the things we're not sure/aware/remembering about. It's more dangerous to implicitly rely on all the entities in a set—including forgotten ones—than relying on a small yet safe subset of these. So not including forgotten
Once we add one/N more
I find the second one more robust, because:
In the context of this PR—with most of the team agreeing that |
bd154cb
to
6b56fd1
Compare
I've pushed a version that seems to be a good middle ground between all opinions. |
(nyxt::auto-configure | ||
:form '(define-configuration web-buffer | ||
:form '(define-configuration (web-buffer prompt-buffer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nut wait, that doesn't solve the problem of prompt-buffer
/web-buffer
discrepancy yet 😜 Maybe:
- An additional
prompt buffer
-related:nselect
? - Or at least a comment explaining that the configuration has this totality?
In any way, it would also be nice to split the configuration in two:
web-buffer
,panel-buffer
, andeditor-buffer
.- And
prompt-buffer
.
So that it's easier for one to edit the configuration.
Yet another detail: define-configuration
can have a docstring, and it wouldn't hurt adding one here 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prompt-buffer
vs. anything is the minimum actionable thing, everthing else is optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I've mentioned, my proposal wanted to be a good middle ground between all opinions. The goal of this PR is straightforward: fix common-settings
is such a way that the expectations of new users are met. I don't think it is in our interest to rethink how many dropdowns set the keybindings or focus on other orthogonal topics right now.
We discussed how the goal of setting the keyscheme globally could be achieved, though no consensus was reached. At the end of the day, it's not the most important topic so I simply gave in.
The only (possibly) actionable seems to be:
at least a comment explaining that the configuration has this totality?
Well, if there's a single dropdown isn't it rather obvious? The point of auto configuration is that users set options via the UI. Black belts can craft their own configs. But we digress again from the focus of this PR.
@jmercouris @Ambrevar please advice on how to proceed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, if there's a single dropdown isn't it rather obvious?
Given the uniqueness of prompt buffer as an interface, it might be unclear whether it also respects this configuration.
The point of auto configuration is that users set options via the UI.
So they can also choose prompt buffer setting via UI.
Black belts can craft their own configs.
Making their (and first-time users transitioning though the Nyxt karate dans) work slightly easier is a net-positive change, especially given how little work it requires. And making Nyxt more approachable (to everyone) is a central goal, as I understood.
But we digress again from the focus of this PR.
Based on the linked issue (#3096), the proper fix is also disambiguating betwen prompt and web buffers (which was the initial confusion in the issue). So making the configuration more global may solve some of the problems (propagation of Emacs/VI bindings to both web and prompt buffer), but it consts us another problem ("why is web-buffer
configuration doesn't influence prompt-buffer
" i.e. disambiguation of the two).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two problems.
- This doesn't do what the user expects
- The user wants more fine grained control
this PR solves point 1. Point 2 is a separate one, and probably not suited for Common Settings. A single user does not constitute a pattern. We shouldn't make the experience of everyone worse for the benefit of a single user. As this PR stands right now, it is ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't make the experience of everyone worse for the benefit of a single user.
Here's a set of user stories and their result for interface use with one or two <select>
s:
| Situation\Interface | 1 <select> | 2 <select>s | Notes |
| Casual: Doesn't know what there is, DWIM | ~ | ~ | |
| Casual/Hacky: Wants to configure everything | + | - | 1 vs. 2 clicks |
| Hacky: Wants to configure web-buffer | ~ | + | Ambiguous vs. clear |
| Hacky: Wants to configure prompt-buffer | ~ | + | Ditto |
| Hacky: Curious, looks through settings | ~ | + | Total vs. isolated settings |
Where:
+
means getting to the desired result easily and understanding what happened.~
means getting confused or achieving the uncertain result.-
means not achieving the result or having inconveniences.
Translating +
to 1, ~
to 0, and -
to -1, we get:
- 1
<select>
: 1. - 2
<selects>
: 2.
In other words, the clarity that separate configs provide overweights the inconvenience of having to make an additional click. For both hacky users and casual ones, and for several user stories that are likely to happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's agree to disagree. Reminder: this is also not related to your main tasks.
Reminder: this is also not related to your main tasks.
😰
|
I agree (;p) that it is not a very big deal, and that using different bindings for different things can easily be done outside of Common Settings for now. It's also not hard to add a second |
6b56fd1
to
3653a56
Compare
@jmercouris my understanding is that we should merge this fix. Please do it if that's the case, thanks. |
OK, will do. |
So that it impact all buffers that deal with keyschemes, such as web-buffer, prompt-buffer and editor-buffer.
3653a56
to
3c0942b
Compare
@jmercouris merged so that the fix lands on the release today. |
Sorry about that, thank you for merging. |
For a detailed discussion, see #3097.
For a detailed discussion, see #3097.
For a detailed discussion, see #3097.
Description
A hot fix solution until issues #2351 and #2296 are solved since the current state is hurting our users (see #3096).
Discussion
I believe that
(define-configuration buffer ...)
is superior than(define-configuration (web-buffer prompt-buffer) ...)
since the keyscheme should be propagated to all classes (including user defined ones) inheriting frombuffer
.Checklist:
Everything in this checklist is required for each PR. Please do not approve a PR that does not have all of these items.
cd /path/to/nyxt/checkout git submodule add https://gitlab.common-lisp.net/nyxt/py-configparser _build/py-configparser
:documentation
s written in the aforementioned style. (It's OK to skip the docstring for really trivial parts.)changelog.lisp
with my changes if it's anything user-facing (new features, important bug fix, compatibility breakage).migration.lisp
entry for all compatibility-breaking changes.(asdf:test-system :nyxt)
and(asdf:test-system :nyxt/gi-gtk)
) and they pass.