Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Keybinding code unification #3 #7850

Merged

Conversation

SimonBrandner
Copy link
Contributor

@SimonBrandner SimonBrandner commented Feb 19, 2022

Type: task
Requires element-hq/element-web#21132


This PR does a few things:

  1. Fixes the call shortcuts to be handled by the KeybindingManager for consistency and possible customizability in the future
  2. Moves handling of desktop-only shortcuts (go back/forward, go to space by number...) to the react-sdk. This puts all the keybinding definitions into one place. That makes them easier to work with and will also serve when we want to add customizable keybindings.
  3. Does some refactoring to how the getter functions in KeyboardShorctus.ts work
  4. Updates and adds a few tests

This change is marked as an internal change (Task), so will not be included in the changelog.

Preview: https://pr7850--matrix-react-sdk.netlify.app
⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.

@github-actions github-actions bot added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label Feb 19, 2022
@SimonBrandner SimonBrandner force-pushed the task/keybinds-unification-3 branch from 3c15909 to 7ed7516 Compare February 19, 2022 12:46
@SimonBrandner SimonBrandner force-pushed the task/keybinds-unification-3 branch 2 times, most recently from df88b89 to 0cbefdb Compare February 19, 2022 12:58
Signed-off-by: Šimon Brandner <[email protected]>
Signed-off-by: Šimon Brandner <[email protected]>
@SimonBrandner SimonBrandner force-pushed the task/keybinds-unification-3 branch from 0cbefdb to 5111a4b Compare February 20, 2022 09:16
@SimonBrandner SimonBrandner marked this pull request as ready for review February 20, 2022 09:34
@SimonBrandner SimonBrandner requested a review from a team as a code owner February 20, 2022 09:34
@andybalaam
Copy link
Member

Hi @SimonBrandner , I'd like to review this, but I'm struggling to understand it fully. Please could explain what it's for and what changes when we merge it?

Also, I see that element-web/pull/221132 and this depend on each other - would they need to be released simultaneously, or could we live with a hour or two of only one of these being merged? (If so, which should be merged first? If not, is there a way we can restructure the change so this is possible?)

@t3chguy
Copy link
Member

t3chguy commented Feb 21, 2022

(If so, which should be merged first? If not, is there a way we can restructure the change so this is possible?)

Typically with a breaking change refactor, e.g one which changes signatures or enum members, they must land at the same time.

@SimonBrandner
Copy link
Contributor Author

Hi @SimonBrandner , I'd like to review this, but I'm struggling to understand it fully. Please could explain what it's for and what changes when we merge it?

Yes, sorry for not documenting this in the PR description. I was partially expecting someone with more context to review this but it might not be exactly clear to them either and it's always good to have documentation - I've updated the PR description.

Also, I see that element-web/pull/221132 and this depend on each other - would they need to be released simultaneously, or could we live with a hour or two of only one of these being merged? (If so, which should be merged first? If not, is there a way we can restructure the change so this is possible?)

As Micheal said, both need to be merged at the same time otherwise stuff will go awry

Copy link
Member

@andybalaam andybalaam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I'm not particularly confident about my review, so I'll leave some time a) for the release to be done and b) for someone else to review if they get a chance.

CloseDialogOrContextMenu = "KeyBinding.closeDialogOrContextMenu",
/** Clicks the selected button */
ActivateSelectedButton = "KeyBinding.activateSelectedButton",

/** Toggle visibility of hidden events */
ToggleHiddenEventVisibility = 'KeyBinding.toggleHiddenEventVisibility',
}

type IKeyboardShortcuts = {
// TODO: We should figure out what to do with the keyboard shortcuts that are not handled by KeybindingManager
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this TODO now done?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not really, hopefully the next PR will cover that

@andybalaam
Copy link
Member

OK, let's go for it!

@andybalaam andybalaam merged commit 93a9af7 into matrix-org:develop Feb 23, 2022
@SimonBrandner SimonBrandner deleted the task/keybinds-unification-3 branch February 23, 2022 13:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants