Repository navigation
fix: shift-click multi select in favorites, shares and trash views - #3472
Merged
Merged
Conversation
tammi-23
previously requested changes
Sep 28, 2026
tammi-23
left a comment
Contributor
There was a problem hiding this comment.
This PR enables useKeyboardFileNavigation in five additional views, but in tile mode pressing Shift+ArrowUp/Down before selecting an item reaches getVerticalProperties() with latestSelectedId === null
and calls .toString() on it.
The defect already exists in views using this composable, but this change exposes it in Favorites, Shares and Trash as well. Pressing Space without a selection also passes null to toggleSelection().
So, in my opinion, we could just fix that directly in this PR.
kulmann
approved these changes
Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Shift-click range selection (and Ctrl/Cmd-click toggling) didn't work in the favorites, shares and trash views, in both the tiles and the table view.
The file list only emits
app.files.list.clicked.shift/app.files.list.clicked.metaevents on click. The handlers for these events are registered byuseKeyboardFileMouseActions, which was only used in the space, projects and search views. In the affected views the events were emitted without any subscriber, so nothing happened.This PR registers
useKeyboardFileNavigationanduseKeyboardFileMouseActionsin:GenericTrash)Besides shift/ctrl-click, this also enables keyboard navigation (arrow keys, Shift+Arrow, Ctrl+A, Esc) in these views. The navigation is based on the list that is actually rendered (after filtering and sorting), so arrow keys follow the visible order.
Favorites additionally gets
useKeyboardFileActions(Ctrl+C), matching the search results list. The shares and trash views don't, because the copy action is hidden for share, trash and space resources there.The trash overview is not selectable (
is-selectable="false"), so it's unchanged.Because keyboard navigation is now active in more views, this PR also fixes two existing bugs in
useKeyboardFileNavigationthat happen when nothing has been selected yet (latestSelectedIdisnull):TypeError, becausegetVerticalProperties()called.toString()onnull. It now returns early.toggleSelection(null), which addednulltoselectedIds. It now does nothing.Related Issue
How Has This Been Tested?
pnpm test:unit --run packages/web-app-files/tests/unit/viewspassesuseKeyboardFileNavigation.spec.tsfor Shift+ArrowUp/Down in tiles view and Space without a selection (they fail without the fix)vue-tsc, ESLint and Prettier pass forweb-app-filesTypes of changes