Skip to content

feat(files): add keyboard shortcuts - #49432

Merged
skjnldsv merged 8 commits into
masterfrom
feat/files-shortcuts
Dec 17, 2024
Merged

feat(files): add keyboard shortcuts#49432
skjnldsv merged 8 commits into
masterfrom
feat/files-shortcuts

Conversation

@skjnldsv

@skjnldsvskjnldsv commented Nov 21, 2024

Copy link
Copy Markdown
Member

Fix#1444
Fix#30484

12
2024-11-29_13-102024-11-29_13-10_1
Shortcuts ### Selection - [x] Select all - [x] Unselect all - [x] Select/unselect current file

Actions

  • Open actions menu
  • Delete
  • Favourite/star
  • Rename
  • Toggle sidebar/details

Navigation

  • Go up a folder
  • Navigate through files
  • Open file/folder

Usability

  • Open upload menu
  • Show keyboard shortcuts
  • Switch grid/list view

Later

Status

  • Actions
  • Tests
  • Investigate performance loss while scrolling to file ID

@skjnldsvskjnldsv added this to the Nextcloud 31 milestone Nov 21, 2024
@skjnldsvskjnldsv self-assigned this Nov 21, 2024
@skjnldsvskjnldsv changed the title feat(files): add select/unselect all keyboard shortcutfeat(files): add keyboard shortcutsNov 22, 2024
@skjnldsv
skjnldsvforce-pushed the feat/files-shortcuts branch 2 times, most recently from 75f8d4b to 1c44235CompareNovember 29, 2024 11:03
@skjnldsv

This comment was marked as resolved.

@skjnldsv
skjnldsv marked this pull request as ready for review November 29, 2024 12:13
@skjnldsvskjnldsv added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Nov 29, 2024
@skjnldsv
skjnldsv requested review from a team, Pytal, ShGKme, artonge and sorbaugh and removed request for a teamNovember 29, 2024 12:14
@skjnldsv

Copy link
Copy Markdown
MemberAuthor

Alright, first PR is ready.
Some more will follow for tests and some tiny changes

ShGKme

This comment was marked as resolved.

@skjnldsv

Copy link
Copy Markdown
MemberAuthor

Btw, we have useHotKey composable to reuse global shortcuts implementation. It might fix some of the issues and reduce copy-paste like mounted + beforeDestroy hooks.

TIL, thanks :)
Yeah, I just realized the input too!
Btw, we should probably check for role=dialig like I did, instead of .modal-mask
https://github.com/nextcloud/nextcloud-vue/blob/10626766712de1e5858b0f71a9babd552bfa6805/src/composables/useHotKey/index.js#L26

@skjnldsv

Copy link
Copy Markdown
MemberAuthor
  1. This is not clear for me when a file is in focus and when it is not. For example, for arrows and CTRL+Space hotkeys. Especially because the click on the file executes an action rather than selecting it.

Totally agree! But this is not really related to this PR.
The active file design is already a feature since 28 (the fileid in the URL initiate it)

Comment threadapps/files/src/views/Settings.vue
@skjnldsv
skjnldsvforce-pushed the feat/files-shortcuts branch 3 times, most recently from 5223668 to 6e9de1bCompareDecember 14, 2024 09:39
…rtcut
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsvskjnldsv added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Dec 17, 2024
@skjnldsv
skjnldsv requested a review from ShGKmeDecember 17, 2024 09:01
Comment threadapps/files/src/views/Settings.vue Outdated
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Comment on lines +46 to +51
// Trick to detect if the action was called from a keyboard event
// we need to make sure the method calling have its named containing 'keydown'
// here we use `onKeydown` method from the FileEntryActions component
const callStack = new Error().stack || ''
const isCalledFromEventListener = callStack.toLocaleLowerCase().includes('keydown')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option would be to have two actions, delete and deleteWithConfirmation

@skjnldsv

Copy link
Copy Markdown
MemberAuthor

Another option would be to have two actions, delete and deleteWithConfirmation

@artonge yeah, I might revisit this later tbh

@skjnldsv

skjnldsv commented Dec 17, 2024

Copy link
Copy Markdown
MemberAuthor

Failure unrelated 🙈
Live photo test is flaky
image

@nfebenfebe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀🚀🚀

@skjnldsv

Copy link
Copy Markdown
MemberAuthor

image
passes locally 🤔

@skjnldsv
skjnldsv merged commit 7876be3 into masterDec 17, 2024
@skjnldsv
skjnldsv deleted the feat/files-shortcuts branch December 17, 2024 13:00
@skjnldsvskjnldsv mentioned this pull request Jan 7, 2025
@nextcloudnextcloud deleted a comment from ShGKmeJan 20, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Keyboard shortcuts for common actions in Files Keyboard shortcut support

7 participants

@skjnldsv@artonge@nfebe@ShGKme@come-nc@Antreesy@AndyScherzinger