-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Modifying ChordKeybinding to support multiple chords #65826
Conversation
As a start to support key chords of longer than two parts, modifying the internal structure of ChordKeybinding to not specifically call out two parts.
👍 This makes sense. The next step should be to adopt multiple chords in the |
It was difficult to refactor the ResolvedKeybindings without also refactoring label creators, as the null checks where handled in the label generation.
The major change with the unit tests was no longer requiring a secondary null field for dispatchparts. As chords can be any length, it's more forward-thinking to modify the unit tests to accept new behavior.
27a51c0
to
50670b9
Compare
@alexandrudima I think I have everything for the first major change. I've made the choice to modify some interfaces slightly in a more future direction (return an array of parts vs a chord part). So you'll see a lot of changes there. Also I'm switching all bindings to ChordKeybinding rather than SingleKeybinding because it removes the conditional code significantly. Curious about your thoughts. |
@alexandrudima if you have a chance can you take a look at this PR? I've gone as far as I feel comfortable at this point, as I've seen giant prs become harder and harder to merge. |
@toumorokoshi, I agree this PR has grown large enough. I've only found a couple of bugs where some I've also tweaked a bit the label calls and having done so, I plan to further refactor those classes and raise some methods to their abstract parent class. I've left
The first one is rather easy to tackle, the second one is a bit more work, as the |
Awesome, thanks so much! Darn, I thought I caught all the bound errors... I'll be more careful. Thanks for the TODOs! I'll take a look at those next. |
Hi! I'm very interested in getting support for keychords of more than two keys (see #6966), so here's a PR to kick off my interest.
I think a see a general strategy to get there, but before I get too deep, I wanted to get a quick review on my approach.
In general, it looks like many parts of the code base are built on the concept of a "firstPart" and a "chordPart" for key chords. I think the first step is modifying all of these to support an arbitrary number of parts. Once that is done, the logic needs to be modified slightly to iteratively run through each part rather than stop at the first two.
As a start to support key chords of longer than two parts,
modifying the internal structure of ChordKeybinding to not specifically
call out two parts.
@alexandrudima you are the assignee of the ticket mentioned. Would you mind giving me some feedback on this approach?
Thank you!