Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the visibility of delete actions in the useFileActionsDelete composable by replacing route-specific logic with resource-specific checks. This ensures delete actions are properly displayed outside the files app context.
Changes:
- Replaced route-based visibility checks with resource type validations
- Updated delete action to use
resources.every()instead ofresources.some()for consistent batch behavior - Added
isShareRoot()method to incoming and outgoing share resources and trash resources
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
packages/web-pkg/src/composables/actions/files/useFileActionsDelete.ts |
Removed route-specific logic and replaced with resource type checks using isSpaceResource, isIncomingShareResource, and isTrashResource |
packages/web-pkg/tests/unit/composables/actions/files/useFileActionsDelete.spec.ts |
Updated tests to validate resource-based visibility logic and removed route-based test cases |
packages/web-client/src/helpers/share/functions.ts |
Added isShareRoot() implementation to incoming and outgoing share resources |
packages/web-client/src/helpers/resource/functions.ts |
Added isShareRoot() implementation to trash resources |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/web-pkg/tests/unit/composables/actions/files/useFileActionsDelete.spec.ts
Outdated
Show resolved
Hide resolved
Fixes the visibility of the delete actions of the `useFileActionsDelete` composable outside of the files app. To achieve this, I remove all the route-specific logic in favor of resource-specific checks. Note that this leads to a slightly different behavior on the search result page: When selecting e.g. 5 resources and one of them is not deletable for some reason, the delete action will not be displayed as a batch action.
80818e5 to
cbfefce
Compare
kulmann
approved these changes
Jan 16, 2026
Member
kulmann
left a comment
There was a problem hiding this comment.
Awesome, thanks for cleaning this up and making it usable in apps 🤓
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.
Fixes the visibility of the delete actions of the
useFileActionsDeletecomposable outside of the files app. To achieve this, I removed all the route-specific logic in favor of resource-specific checks.Note that this leads to a slightly different behavior on the search result page: When selecting e.g. 5 resources and one of them is not deletable for some reason, the delete action will not be displayed as a batch action.
fixes #1806