feat: Added command palette for quick actions and switching between items (#2933) [skip e2e]
* wip: command palette * use code instead of key * show recent items above commands * refactor * fix command * add placeholder * Tab/Shift-Tab to switch tabs * Fix test * Add menu item to general account menu * if shortcut_id is available, use that as the id * make toggle fn more stable * small naming changes * fix name * Close open modals and popovers when opening command palette * use stable ids + make sure selectedNotesCount only changes when the count actually changes * display all commands, even ones in recents list
This commit is contained in:
@@ -41,6 +41,7 @@ import { AbstractViewController } from './Abstract/AbstractViewController'
|
||||
import { NotesController } from './NotesController/NotesController'
|
||||
import { downloadOrShareBlobBasedOnPlatform } from '@/Utils/DownloadOrShareBasedOnPlatform'
|
||||
import { truncateString } from '@/Components/SuperEditor/Utils'
|
||||
import { RecentActionsState } from '../Application/Recents'
|
||||
|
||||
const UnprotectedFileActions = [FileItemActionType.ToggleFileProtection]
|
||||
const NonMutatingFileActions = [FileItemActionType.DownloadFile, FileItemActionType.PreviewFile]
|
||||
@@ -105,6 +106,7 @@ export class FilesController extends AbstractViewController<FilesControllerEvent
|
||||
private platform: Platform,
|
||||
private mobileDevice: MobileDeviceInterface | undefined,
|
||||
private _isNativeMobileWeb: IsNativeMobileWeb,
|
||||
private recents: RecentActionsState,
|
||||
eventBus: InternalEventBusInterface,
|
||||
) {
|
||||
super(eventBus)
|
||||
@@ -278,6 +280,7 @@ export class FilesController extends AbstractViewController<FilesControllerEvent
|
||||
break
|
||||
case FileItemActionType.PreviewFile:
|
||||
this.filePreviewModalController.activate(file, action.payload.otherFiles)
|
||||
this.recents.add(file.uuid)
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user