From 76e728eb98bee41badc18399ce574be61c0a59c9 Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Fri, 13 Dec 2024 12:10:47 +0100 Subject: feat(systemtags): add systemtag manage keyboard shortcut Signed-off-by: skjnldsv --- apps/files/src/store/active.ts | 1 - apps/files/src/store/userconfig.ts | 4 ++ apps/files/src/views/FilesList.vue | 6 +- apps/files/src/views/Settings.vue | 82 ++++++++++++++++------ apps/systemtags/src/components/SystemTagPicker.vue | 2 +- .../src/files_actions/inlineSystemTagsAction.ts | 2 +- apps/systemtags/src/init.ts | 8 ++- apps/systemtags/src/logger.ts | 2 +- .../systemtags/src/services/HotKeysService.spec.ts | 56 +++++++++++++++ apps/systemtags/src/services/HotKeysService.ts | 24 +++++++ apps/systemtags/src/services/api.ts | 2 +- apps/systemtags/src/services/files.ts | 5 +- apps/systemtags/src/services/logger.ts | 10 --- 13 files changed, 161 insertions(+), 43 deletions(-) create mode 100644 apps/systemtags/src/services/HotKeysService.spec.ts create mode 100644 apps/systemtags/src/services/HotKeysService.ts delete mode 100644 apps/systemtags/src/services/logger.ts diff --git a/apps/files/src/store/active.ts b/apps/files/src/store/active.ts index 2efb823b232..e261e817f3d 100644 --- a/apps/files/src/store/active.ts +++ b/apps/files/src/store/active.ts @@ -11,7 +11,6 @@ import { getNavigation } from '@nextcloud/files' import { subscribe } from '@nextcloud/event-bus' import logger from '../logger.ts' -import type { set } from 'lodash' export const useActiveStore = function(...args) { const store = defineStore('active', { diff --git a/apps/files/src/store/userconfig.ts b/apps/files/src/store/userconfig.ts index 6fd2ad886bc..ffe07a91bab 100644 --- a/apps/files/src/store/userconfig.ts +++ b/apps/files/src/store/userconfig.ts @@ -27,6 +27,8 @@ export const useUserConfigStore = function(...args) { actions: { /** * Update the user config local store + * @param key + * @param value */ onUpdate(key: string, value: boolean) { Vue.set(this.userConfig, key, value) @@ -34,6 +36,8 @@ export const useUserConfigStore = function(...args) { /** * Update the user config local store AND on server side + * @param key + * @param value */ async update(key: string, value: boolean) { await axios.put(generateUrl('/apps/files/api/v1/config/' + key), { diff --git a/apps/files/src/views/FilesList.vue b/apps/files/src/views/FilesList.vue index 46a84faf188..af9cb45d60d 100644 --- a/apps/files/src/views/FilesList.vue +++ b/apps/files/src/views/FilesList.vue @@ -222,6 +222,9 @@ export default defineComponent({ }, setup() { + const { currentView } = useNavigation() + const { directory, fileId } = useRouteParameters() + const fileListWidth = useFileListWidth() const filesStore = useFilesStore() const filtersStore = useFiltersStore() const pathsStore = usePathsStore() @@ -229,9 +232,6 @@ export default defineComponent({ const uploaderStore = useUploaderStore() const userConfigStore = useUserConfigStore() const viewConfigStore = useViewConfigStore() - const { currentView } = useNavigation() - const fileListWidth = useFileListWidth() - const { directory, fileId } = useRouteParameters() const enableGridView = (loadState('core', 'config', [])['enable_non-accessible_features'] ?? true) const forbiddenCharacters = loadState('files', 'forbiddenCharacters', []) diff --git a/apps/files/src/views/Settings.vue b/apps/files/src/views/Settings.vue index 0ff7a56e37d..ec012ed64ae 100644 --- a/apps/files/src/views/Settings.vue +++ b/apps/files/src/views/Settings.vue @@ -90,31 +90,41 @@

{{ t('files', 'Actions') }}

-
a
+
+ a +
{{ t('files', 'Open the actions menu for a file') }}
-
F2
+
+ F2 +
{{ t('files', 'Rename a file') }}
-
Del
+
+ Del +
{{ t('files', 'Delete a file') }}
-
s
+
+ s +
{{ t('files', 'Favorite or remove a file from favorites') }}
-
-
t
+
+
+ t +
{{ t('files', 'Manage tags for a file') }}
@@ -124,25 +134,33 @@

{{ t('files', 'Selection') }}

-
Ctrl + A
+
+ Ctrl + A +
{{ t('files', 'Select all files') }}
-
ESC
+
+ ESC +
{{ t('files', 'Deselect all files') }}
-
Ctrl + Space
+
+ Ctrl + Space +
{{ t('files', 'Select or deselect a file') }}
-
Ctrl + Shift + Space
+
+ Ctrl + Shift + Space +
{{ t('files', 'Select a range of files') }}
@@ -152,31 +170,41 @@

{{ t('files', 'Navigation') }}

-
+
+ Alt + +
- {{ t('files', 'Navigate to the file above') }} + {{ t('files', 'Navigate to the parent folder') }}
-
Alt +
+
+ +
- {{ t('files', 'Navigate to the parent folder') }} + {{ t('files', 'Navigate to the file above') }}
-
+
+ +
{{ t('files', 'Navigate to the file below') }}
-
+
+ +
{{ t('files', 'Navigate to the file on the left (in grid mode)') }}
-
+
+ +
{{ t('files', 'Navigate to the file on the right (in grid mode)') }}
@@ -186,19 +214,25 @@

{{ t('files', 'View') }}

-
V
+
+ V +
{{ t('files', 'Toggle the grid view') }}
-
D
+
+ D +
{{ t('files', 'Open the sidebar for a file') }}
-
?
+
+ ? +
{{ t('files', 'Show those shortcuts') }}
@@ -209,12 +243,12 @@