Repository navigation
refactor: duplicated tiles and table logic - #1819
Merged
Merged
Conversation
JammingBen
force-pushed
the
refactor/duplicated-tiles-table-logic
branch
2 times, most recently
from
January 14, 2026 12:37
de3b0ca to
f9c6e6a
Compare
JammingBen
force-pushed
the
refactor/duplicated-tiles-table-logic
branch
from
January 15, 2026 10:04
f9c6e6a to
73489e3
Compare
JammingBen
marked this pull request as ready for review
January 15, 2026 10:25
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors duplicated logic between ResourceTiles and ResourceTable components by extracting shared functionality into composables. The changes consolidate selection handling, context menu logic, and resource link generation into reusable composables, remove unused mounted hooks, and eliminate the targetRouteCallback prop which was causing unnecessary overhead.
Changes:
- Extracts shared selection, context menu, and helper logic into
useResourceViewSelection,useResourceViewContextMenu, and updates touseResourceViewHelperscomposables - Removes
targetRouteCallbackprop and related logic, replacing it with direct route checks - Removes unused
rowMountedevent emissions and related refs in both tile and table views
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/web-pkg/src/composables/resources/useResourceViewSelection.ts | New composable extracting shared selection logic for resource views |
| packages/web-pkg/src/composables/resources/useResourceViewContextMenu.ts | New composable extracting shared context menu logic for resource views |
| packages/web-pkg/src/composables/resources/useResourceViewHelpers.ts | Updated to integrate new composables and add shared helper methods |
| packages/web-pkg/src/components/FilesList/ResourceTiles.vue | Refactored to use shared composables, removed duplicated logic and unused mounted hooks |
| packages/web-pkg/src/components/FilesList/ResourceTable.vue | Refactored to use shared composables, removed duplicated logic and unused mounted hooks |
| packages/web-pkg/src/composables/filesList/useResourceRouteResolver.ts | Replaced targetRouteCallback with direct route check using isLocationTrashActive |
| packages/web-pkg/src/helpers/contextMenuDropdown.ts | Updated to accept HTMLElement in addition to ComponentPublicInstance |
| packages/web-pkg/tests/unit/components/FilesList/ResourceTiles.spec.ts | Added mock for getElementById to support context menu tests |
| packages/web-pkg/tests/unit/components/FilesList/ResourceTable.spec.ts | Updated test setup to support new composable structure and added deleteQueue parameter |
| packages/web-pkg/src/helpers/folderLink/types.ts | Deleted file as CreateTargetRouteOptions type is no longer needed |
| packages/web-app-files/src/views/trash/Overview.vue | Removed targetRouteCallback prop usage |
| packages/web-app-files/src/views/spaces/GenericSpace.vue | Removed targetRouteCallback prop and related logic |
| packages/web-app-files/src/components/Shares/SharedWithMeSection.vue | Removed targetRouteCallback prop and related logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
targetRouteCallbackbecause it only introduces unnecessary overhead. the only edge case where this made any sense is on the trash overview page, which can be solved via a simple active route query.closes #1518