Add a keyboard shortcut to toggle hidden event visibility when labs are enabled. (#7584)
Notes: The keyboard shortcut is control (or cmd) shift h. Signed-off-by: Katarzyna Stachura <uwunyaa@outlook.com>
This commit is contained in:
parent
00912c0b50
commit
debf4caade
6 changed files with 82 additions and 3 deletions
|
@ -125,6 +125,12 @@ export enum NavigationAction {
|
|||
SelectNextUnreadRoom = 'SelectNextUnreadRoom',
|
||||
}
|
||||
|
||||
/** Actions only available when labs are enabled */
|
||||
export enum LabsAction {
|
||||
/** Toggle visibility of hidden events */
|
||||
ToggleHiddenEventVisibility = 'ToggleHiddenEventVisibility',
|
||||
}
|
||||
|
||||
/**
|
||||
* Represent a key combination.
|
||||
*
|
||||
|
@ -213,6 +219,7 @@ export interface IKeyBindingsProvider {
|
|||
getRoomListBindings: KeyBindingGetter<RoomListAction>;
|
||||
getRoomBindings: KeyBindingGetter<RoomAction>;
|
||||
getNavigationBindings: KeyBindingGetter<NavigationAction>;
|
||||
getLabsBindings: KeyBindingGetter<LabsAction>;
|
||||
}
|
||||
|
||||
export class KeyBindingsManager {
|
||||
|
@ -264,6 +271,10 @@ export class KeyBindingsManager {
|
|||
getNavigationAction(ev: KeyboardEvent | React.KeyboardEvent): NavigationAction | undefined {
|
||||
return this.getAction(this.bindingsProviders.map(it => it.getNavigationBindings), ev);
|
||||
}
|
||||
|
||||
getLabsAction(ev: KeyboardEvent | React.KeyboardEvent): LabsAction | undefined {
|
||||
return this.getAction(this.bindingsProviders.map(it => it.getLabsBindings), ev);
|
||||
}
|
||||
}
|
||||
|
||||
const manager = new KeyBindingsManager();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue