Skip to content

fix: resource delete action visibility#1832

Merged
kulmann merged 1 commit intomainfrom
fix/resource-delete-action-visibility
Jan 16, 2026
Merged

fix: resource delete action visibility#1832
kulmann merged 1 commit intomainfrom
fix/resource-delete-action-visibility

Conversation

@JammingBen
Copy link
Member

@JammingBen JammingBen commented Jan 15, 2026

Fixes the visibility of the delete actions of the useFileActionsDelete composable 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

@JammingBen JammingBen self-assigned this Jan 15, 2026
@JammingBen JammingBen marked this pull request as ready for review January 15, 2026 15:40
Copilot AI review requested due to automatic review settings January 15, 2026 15:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 of resources.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.

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.
@JammingBen JammingBen force-pushed the fix/resource-delete-action-visibility branch from 80818e5 to cbfefce Compare January 15, 2026 15:41
@JammingBen JammingBen requested a review from kulmann January 15, 2026 15:43
Copy link
Member

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for cleaning this up and making it usable in apps 🤓

@kulmann kulmann merged commit 7678625 into main Jan 16, 2026
28 checks passed
@kulmann kulmann deleted the fix/resource-delete-action-visibility branch January 16, 2026 07:37
@openclouders openclouders mentioned this pull request Jan 16, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Composable useFileActionsDelete can only be used by the files app

3 participants