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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user