Skip to content

Conversation

@AlexAndBear
Copy link
Contributor

@AlexAndBear AlexAndBear commented Jul 2, 2025

Description

image

Related Issue

  • Fixes <issue_link>

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

Copilot AI review requested due to automatic review settings July 2, 2025 09:35
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 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 useSpaceActionsNavigateToTrash to allow personal space resources.
  • Inject TrashContextActions into the ResourceTable context menu in the Trash overview.
  • Create a new TrashContextActions component 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 TrashContextActions component; consider adding unit or integration tests to ensure context menu items render and behave as expected.
<template>

const menuSections = computed(() => {
const sections: MenuSection[] = []
if (unref(menuItemsPrimaryActions)) {
Copy link

Copilot AI Jul 2, 2025

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.

Suggested change
if (unref(menuItemsPrimaryActions)) {
if (unref(menuItemsPrimaryActions).length > 0) {

Copilot uses AI. Check for mistakes.
@AlexAndBear AlexAndBear moved this from Qualification to In Progress in OpenCloud Team Board Jul 2, 2025
@JammingBen
Copy link
Contributor

For disabled spaces you still can open the context menu, which then looks like this:

image

Can we somehow check before if there are actions available?

@@ -0,0 +1,51 @@
<template>
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true!

@AlexAndBear AlexAndBear merged commit 4867fa6 into main Jul 3, 2025
19 checks passed
@AlexAndBear AlexAndBear deleted the trash-add-context-actions branch July 3, 2025 15:04
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenCloud Team Board Jul 3, 2025
@openclouders openclouders mentioned this pull request Jul 3, 2025
1 task
@openclouders openclouders mentioned this pull request Jul 21, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants