diff --git a/src-ui/src/app/components/document-list/document-list.component.spec.ts b/src-ui/src/app/components/document-list/document-list.component.spec.ts index 39a340a3c..c4420ad3f 100644 --- a/src-ui/src/app/components/document-list/document-list.component.spec.ts +++ b/src-ui/src/app/components/document-list/document-list.component.spec.ts @@ -620,6 +620,10 @@ describe('DocumentListComponent', () => { document.dispatchEvent(new KeyboardEvent('keydown', { key: 'a' })) expect(selectAllSpy).toHaveBeenCalled() + const selectPageSpy = jest.spyOn(documentListService, 'selectPage') + document.dispatchEvent(new KeyboardEvent('keydown', { key: 'p' })) + expect(selectPageSpy).toHaveBeenCalled() + jest.spyOn(documentListService, 'documents', 'get').mockReturnValue(docs) fixture.detectChanges() const detailSpy = jest.spyOn(component, 'openDocumentDetail') diff --git a/src-ui/src/app/components/document-list/document-list.component.ts b/src-ui/src/app/components/document-list/document-list.component.ts index 6c2f69157..75658f4c7 100644 --- a/src-ui/src/app/components/document-list/document-list.component.ts +++ b/src-ui/src/app/components/document-list/document-list.component.ts @@ -208,6 +208,13 @@ export class DocumentListComponent this.list.selectAll() }) + this.hotKeyService + .addShortcut({ keys: 'p', description: $localize`Select page` }) + .pipe(takeUntil(this.unsubscribeNotifier)) + .subscribe(() => { + this.list.selectPage() + }) + this.hotKeyService .addShortcut({ keys: 'o', description: $localize`Open first document` }) .pipe(takeUntil(this.unsubscribeNotifier))