-
Notifications
You must be signed in to change notification settings - Fork 25
feat: add context actions to trash #887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 adds context menu actions to the Trash view, enabling users to invoke space-specific operations on trashed items and extends the navigation logic to cover personal spaces.
- Extend
useSpaceActionsNavigateToTrashto allow personal space resources. - Inject
TrashContextActionsinto theResourceTablecontext menu in the Trash overview. - Create a new
TrashContextActionscomponent to render available actions.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/web-pkg/src/composables/actions/spaces/useSpaceActionsNavigateToTrash.ts | Import and check isPersonalSpaceResource alongside project spaces |
| packages/web-app-files/src/views/trash/Overview.vue | Add context-menu slot with TrashContextActions and import dependencies |
| packages/web-app-files/src/components/Trash/TrashContextActions.vue | Introduce component rendering the context action menu for trash items |
Comments suppressed due to low confidence (1)
packages/web-app-files/src/components/Trash/TrashContextActions.vue:1
- There are no tests covering the new
TrashContextActionscomponent; consider adding unit or integration tests to ensure context menu items render and behave as expected.
<template>
packages/web-pkg/src/composables/actions/spaces/useSpaceActionsNavigateToTrash.ts
Outdated
Show resolved
Hide resolved
| const menuSections = computed(() => { | ||
| const sections: MenuSection[] = [] | ||
| if (unref(menuItemsPrimaryActions)) { |
Copilot
AI
Jul 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An empty array is truthy in JavaScript, so this check always passes. Use unref(menuItemsPrimaryActions).length > 0 to only push a section when there are items.
| if (unref(menuItemsPrimaryActions)) { | |
| if (unref(menuItemsPrimaryActions).length > 0) { |
packages/web-app-files/src/components/Trash/TrashContextActions.vue
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1,51 @@ | |||
| <template> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script setup would be nice for new components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true!

Description
Related Issue
How Has This Been Tested?
Types of changes