Skip to content

feat(FR-2613): migrate VFolder trash lifecycle mutations to V2 GraphQL API#6817

Merged
graphite-app[bot] merged 1 commit intomainfrom
04-21-feat_fr-2613_migrate_vfolder_trash_lifecycle_mutations_to_v2_graphql_api
Apr 30, 2026
Merged

feat(FR-2613): migrate VFolder trash lifecycle mutations to V2 GraphQL API#6817
graphite-app[bot] merged 1 commit intomainfrom
04-21-feat_fr-2613_migrate_vfolder_trash_lifecycle_mutations_to_v2_graphql_api

Conversation

@ironAiken2
Copy link
Copy Markdown
Contributor

@ironAiken2 ironAiken2 commented Apr 21, 2026

Resolves #6816 (FR-2613)

Summary

Migrates the VFolder trash lifecycle mutations from the legacy REST API to the Strawberry V2 Relay mutations introduced in manager 26.4.2, per the FR-2572 epic guidance.

  • vfolder.delete_by_iddeleteVfolderV2 (row-level soft-delete / move to trash)
  • Bulk move-to-trash (selection toolbar) → bulkDeleteVfoldersV2
  • vfolder.delete_from_trash_binpurgeVfolderV2 (row-level permanent purge)
  • Bulk purge (new selection toolbar action in trash view) → bulkPurgeVfoldersV2
  • Restore path intentionally not migrated: restoreVfolderV2 is not yet present in the V2 schema — the row-level restore in VFolderNodesV2 and the legacy RestoreVFolderModal keep using baiClient.vfolder.restore_from_trash_bin. A backend follow-up will be filed under FR-2572 to add the missing mutation.

Changes

New V2 components (created alongside legacy — legacy files untouched)

  • react/src/components/VFolderNodesV2.tsx
    • New fragment VFolderNodesV2Fragment (same shape as legacy)
    • Relay useMutation for deleteVfolderV2 and purgeVfolderV2
    • Row-level move-to-trash uses BAINameActionCell.popConfirm for inline confirmation
    • Row-level purge uses BAIConfirmModalWithInput (type-folder-name-to-confirm)
  • react/src/components/DeleteVFolderModalV2.tsx
    • New fragment DeleteVFolderModalV2Fragment
    • Uses bulkDeleteVfoldersV2 single mutation (server-side bulk); UI reports deletedCount / total and any folders excluded by permission
  • react/src/components/DeleteForeverVFolderModalV2.tsx (new)
    • New fragment DeleteForeverVFolderModalV2Fragment
    • Uses bulkPurgeVfoldersV2 single mutation; wraps BAIConfirmModalWithInput with the localized confirm word (삭제 / delete)

Shared component update

  • packages/backend.ai-ui/src/components/Table/BAINameActionCell.tsx
    • Adds popConfirm?: Omit<PopconfirmProps, 'children'> to BAINameActionCellAction
    • Visible icon buttons are wrapped with <Popconfirm> when popConfirm is set
    • Overflow-menu items fall back to Modal.confirm mirroring the popConfirm title / description / okText / button props — confirmation UI is preserved in both visible and overflow states

Consumer pages switched to V2

  • react/src/pages/VFolderNodeListPage.tsx
  • react/src/pages/AdminVFolderNodeListPage.tsx
  • Query ...VFolderNodesFragment...VFolderNodesV2Fragment, ...DeleteVFolderModalFragment...DeleteVFolderModalV2Fragment, plus new ...DeleteForeverVFolderModalV2Fragment
  • Trash view bulk toolbar: adds "Delete Forever" button (BAIPurgeIcon) next to the existing "Restore" button; opens DeleteForeverVFolderModalV2
  • RestoreVFolderModal and ...RestoreVFolderModalFragment remain on legacy

i18n

  • New keys under data.folders.*: DeleteForeverConfirmText, DeleteForeverDescription, DeleteForeverMultipleDescription, MultipleFolderDeletedForever, TypeToConfirmDeleteForever, MoveToTrashRestoreHint
  • Propagated to all 21 supported languages

Intentionally untouched

  • VFolderNodes.tsx, DeleteVFolderModal.tsx, RestoreVFolderModal.tsx remain as-is for backward compatibility through the 26.4.x window.
  • VFolderNodeDescription.tsx still imports statusTagColor from the legacy VFolderNodes.

Follow-up

  • Track the backend gap: file a request under FR-2572 for a restoreVfolderV2 mutation. Once landed, create RestoreVFolderModalV2 and switch the remaining restore paths off the legacy REST client.

Verification

`bash scripts/verify.sh` → `=== ALL PASS ===` (Relay / Lint / Format / TypeScript)

Checklist:

  • Legacy files untouched
  • V2 components created with new fragment names
  • Consumers switched to V2 for delete/purge (row-level + bulk)
  • Restore path preserved on legacy REST (backend gap)
  • verify.sh passes
  • Minimum manager version: 26.4.2 (for V2 mutations)

Copy link
Copy Markdown
Contributor Author

ironAiken2 commented Apr 21, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2613_migrate_vfolder_trash_lifecycle_mutations_to_v2_graphql_api branch from 891cd89 to 9cf781b Compare April 21, 2026 04:50
@ironAiken2 ironAiken2 force-pushed the 04-16-feat_fr-2593_implement_vfolder_creation_modal_using_v2_graphql_mutation branch from fddd97a to 336251a Compare April 21, 2026 04:50
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
8.9% (-0.08% 🔻)
1859/20898
🔴 Branches
8.05% (-0.08% 🔻)
1187/14740
🔴 Functions
5.24% (-0.04% 🔻)
297/5671
🔴 Lines
8.63% (-0.08% 🔻)
1750/20276
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / DeleteForeverVFolderModalV2.tsx
0% 0% 0% 0%
🔴
... / DeleteVFolderModalV2.tsx
0% 0% 0% 0%
🔴
... / RestoreVFolderModalV2.tsx
0% 0% 0% 0%
🔴
... / VFolderNodesV2.tsx
0% 0% 0% 0%

Test suite run success

865 tests passing in 40 suites.

Report generated by 🧪jest coverage report action from 7c822bb

@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2613_migrate_vfolder_trash_lifecycle_mutations_to_v2_graphql_api branch from 9cf781b to 109d1fd Compare April 21, 2026 06:18
@ironAiken2 ironAiken2 marked this pull request as ready for review April 21, 2026 06:18
Copilot AI review requested due to automatic review settings April 21, 2026 06:18
@github-actions github-actions Bot added area:ux UI / UX issue. area:i18n Localization labels Apr 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

Coverage report for ./packages/backend.ai-ui

St.
Category Percentage Covered / Total
🟢 Statements 81.87% 429/524
🟡 Branches 70.43% 362/514
🟡 Functions 76.86% 93/121
🟢 Lines 83.19% 391/470

Test suite run success

319 tests passing in 13 suites.

Report generated by 🧪jest coverage report action from 7c822bb

Copy link
Copy Markdown
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

Migrates the VFolder trash lifecycle UI from legacy REST mutations to the Strawberry V2 Relay mutations (manager ≥ 26.4.2), while intentionally keeping restore on the legacy REST path due to the missing restoreVfolderV2 mutation.

Changes:

  • Switch VFolder list pages to new V2 components/fragments for delete (move-to-trash) and purge (delete forever).
  • Add new V2 React components for VFolder nodes table and delete/purge modals using Relay useMutation.
  • Extend BAINameActionCell to support Popconfirm-gated actions and add new i18n strings for “delete forever” flows.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
resources/i18n/en.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/ko.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/ja.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/zh-CN.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/zh-TW.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/de.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/el.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/es.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/fi.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/fr.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/id.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/it.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/mn.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/ms.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/pl.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/pt.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/pt-BR.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/ru.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/th.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/tr.json Adds new translation keys for delete-forever confirmation + messages.
resources/i18n/vi.json Adds new translation keys for delete-forever confirmation + messages.
react/src/pages/VFolderNodeListPage.tsx Switches to V2 nodes + V2 delete/purge modals; adds bulk “Delete forever” action in trash view.
react/src/pages/AdminVFolderNodeListPage.tsx Same as above for admin view.
react/src/components/VFolderNodesV2.tsx New V2 table component using deleteVfolderV2/purgeVfolderV2 Relay mutations; restore stays on REST.
react/src/components/DeleteVFolderModalV2.tsx New V2 bulk move-to-trash modal using bulkDeleteVfoldersV2.
react/src/components/DeleteForeverVFolderModalV2.tsx New V2 bulk purge modal using bulkPurgeVfoldersV2 with input confirmation.
packages/backend.ai-ui/src/components/Table/BAINameActionCell.tsx Adds popConfirm support for action buttons rendered in the name/action cell.

Comment thread packages/backend.ai-ui/src/components/Table/BAINameActionCell.tsx
Comment thread react/src/components/DeleteVFolderModalV2.tsx Outdated
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2613_migrate_vfolder_trash_lifecycle_mutations_to_v2_graphql_api branch from 109d1fd to 74ea66e Compare April 21, 2026 06:32
@ironAiken2 ironAiken2 force-pushed the 04-16-feat_fr-2593_implement_vfolder_creation_modal_using_v2_graphql_mutation branch from 336251a to 70f6fc0 Compare April 21, 2026 07:56
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2613_migrate_vfolder_trash_lifecycle_mutations_to_v2_graphql_api branch from 74ea66e to d38e445 Compare April 21, 2026 07:56
Comment thread react/src/components/DeleteVFolderModalV2.tsx Outdated
Comment thread react/src/components/DeleteForeverVFolderModalV2.tsx Outdated
Comment thread react/src/components/DeleteVFolderModalV2.tsx
Comment thread react/src/components/DeleteForeverVFolderModalV2.tsx
Comment thread react/src/components/VFolderNodesV2.tsx
Comment thread react/src/pages/VFolderNodeListPage.tsx Outdated
@ironAiken2 ironAiken2 force-pushed the 04-16-feat_fr-2593_implement_vfolder_creation_modal_using_v2_graphql_mutation branch from 6aa41ef to 89d9c8a Compare April 27, 2026 02:42
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2613_migrate_vfolder_trash_lifecycle_mutations_to_v2_graphql_api branch from ccbb51f to 42e2427 Compare April 27, 2026 02:43
@ironAiken2 ironAiken2 requested a review from nowgnuesLee April 27, 2026 02:43
@ironAiken2 ironAiken2 force-pushed the 04-16-feat_fr-2593_implement_vfolder_creation_modal_using_v2_graphql_mutation branch from 89d9c8a to 795a7f5 Compare April 27, 2026 04:19
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2613_migrate_vfolder_trash_lifecycle_mutations_to_v2_graphql_api branch from 42e2427 to 2ab0d52 Compare April 27, 2026 04:19
@ironAiken2 ironAiken2 force-pushed the 04-16-feat_fr-2593_implement_vfolder_creation_modal_using_v2_graphql_mutation branch from 795a7f5 to e3deb1f Compare April 27, 2026 06:57
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2613_migrate_vfolder_trash_lifecycle_mutations_to_v2_graphql_api branch from 2ab0d52 to 6f4f7f0 Compare April 27, 2026 06:57
@ironAiken2 ironAiken2 force-pushed the 04-16-feat_fr-2593_implement_vfolder_creation_modal_using_v2_graphql_mutation branch from e3deb1f to 671d373 Compare April 27, 2026 08:55
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2613_migrate_vfolder_trash_lifecycle_mutations_to_v2_graphql_api branch from 6f4f7f0 to 1d95414 Compare April 27, 2026 08:55
@ironAiken2 ironAiken2 force-pushed the 04-16-feat_fr-2593_implement_vfolder_creation_modal_using_v2_graphql_mutation branch from 671d373 to ef6dc35 Compare April 27, 2026 10:00
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2613_migrate_vfolder_trash_lifecycle_mutations_to_v2_graphql_api branch 2 times, most recently from ac4de81 to 7db3eb6 Compare April 28, 2026 02:03
@ironAiken2 ironAiken2 force-pushed the 04-16-feat_fr-2593_implement_vfolder_creation_modal_using_v2_graphql_mutation branch from ef6dc35 to 6405784 Compare April 28, 2026 02:03
@ironAiken2 ironAiken2 changed the base branch from 04-16-feat_fr-2593_implement_vfolder_creation_modal_using_v2_graphql_mutation to graphite-base/6817 April 28, 2026 03:17
@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2613_migrate_vfolder_trash_lifecycle_mutations_to_v2_graphql_api branch from 7db3eb6 to 03cf13c Compare April 28, 2026 03:21
@ironAiken2 ironAiken2 changed the base branch from graphite-base/6817 to 04-16-feat_fr-2593_implement_vfolder_creation_modal_using_v2_graphql_mutation April 28, 2026 03:21
Copy link
Copy Markdown
Contributor

@nowgnuesLee nowgnuesLee left a comment

Choose a reason for hiding this comment

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

LGTM

@ironAiken2 ironAiken2 force-pushed the 04-21-feat_fr-2613_migrate_vfolder_trash_lifecycle_mutations_to_v2_graphql_api branch from 03cf13c to 99b663c Compare April 29, 2026 01:07
@ironAiken2 ironAiken2 force-pushed the 04-16-feat_fr-2593_implement_vfolder_creation_modal_using_v2_graphql_mutation branch from ea1af20 to 82e39a0 Compare April 29, 2026 01:07
Copy link
Copy Markdown
Member

yomybaby commented Apr 30, 2026

image.png

image.png

It works fine. But can you unify tooltip terminology to 'Delete forever'?

We will proceed separately with the task of using distinct icons for "Send to Trash" and "Permanently Delete" and also unifying the terminology.

@yomybaby yomybaby dismissed agatha197’s stale review April 30, 2026 03:04

will be handled in other issue.

@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Apr 30, 2026

Merge activity

…L API (#6817)

Resolves #6816 (FR-2613)

## Summary

Migrates the VFolder trash lifecycle mutations from the legacy REST API to the Strawberry V2 Relay mutations introduced in manager 26.4.2, per the FR-2572 epic guidance.

- `vfolder.delete_by_id` → `deleteVfolderV2` (row-level soft-delete / move to trash)
- Bulk move-to-trash (selection toolbar) → `bulkDeleteVfoldersV2`
- `vfolder.delete_from_trash_bin` → `purgeVfolderV2` (row-level permanent purge)
- Bulk purge (new selection toolbar action in trash view) → `bulkPurgeVfoldersV2`
- Restore path intentionally **not** migrated: `restoreVfolderV2` is not yet present in the V2 schema — the row-level restore in `VFolderNodesV2` and the legacy `RestoreVFolderModal` keep using `baiClient.vfolder.restore_from_trash_bin`. A backend follow-up will be filed under FR-2572 to add the missing mutation.

## Changes

### New V2 components (created alongside legacy — legacy files untouched)
- `react/src/components/VFolderNodesV2.tsx`
  - New fragment `VFolderNodesV2Fragment` (same shape as legacy)
  - Relay `useMutation` for `deleteVfolderV2` and `purgeVfolderV2`
  - Row-level move-to-trash uses `BAINameActionCell.popConfirm` for inline confirmation
  - Row-level purge uses `BAIConfirmModalWithInput` (type-folder-name-to-confirm)
- `react/src/components/DeleteVFolderModalV2.tsx`
  - New fragment `DeleteVFolderModalV2Fragment`
  - Uses `bulkDeleteVfoldersV2` single mutation (server-side bulk); UI reports `deletedCount` / `total` and any folders excluded by permission
- `react/src/components/DeleteForeverVFolderModalV2.tsx` *(new)*
  - New fragment `DeleteForeverVFolderModalV2Fragment`
  - Uses `bulkPurgeVfoldersV2` single mutation; wraps `BAIConfirmModalWithInput` with the localized confirm word (`삭제` / `delete`)

### Shared component update
- `packages/backend.ai-ui/src/components/Table/BAINameActionCell.tsx`
  - Adds `popConfirm?: Omit<PopconfirmProps, 'children'>` to `BAINameActionCellAction`
  - Visible icon buttons are wrapped with `<Popconfirm>` when `popConfirm` is set
  - Overflow-menu items fall back to `Modal.confirm` mirroring the popConfirm title / description / okText / button props — confirmation UI is preserved in both visible and overflow states

### Consumer pages switched to V2
- `react/src/pages/VFolderNodeListPage.tsx`
- `react/src/pages/AdminVFolderNodeListPage.tsx`
- Query `...VFolderNodesFragment` → `...VFolderNodesV2Fragment`, `...DeleteVFolderModalFragment` → `...DeleteVFolderModalV2Fragment`, plus new `...DeleteForeverVFolderModalV2Fragment`
- Trash view bulk toolbar: adds "Delete Forever" button (`BAIPurgeIcon`) next to the existing "Restore" button; opens `DeleteForeverVFolderModalV2`
- `RestoreVFolderModal` and `...RestoreVFolderModalFragment` remain on legacy

### i18n
- New keys under `data.folders.*`: `DeleteForeverConfirmText`, `DeleteForeverDescription`, `DeleteForeverMultipleDescription`, `MultipleFolderDeletedForever`, `TypeToConfirmDeleteForever`, `MoveToTrashRestoreHint`
- Propagated to all 21 supported languages

### Intentionally untouched
- `VFolderNodes.tsx`, `DeleteVFolderModal.tsx`, `RestoreVFolderModal.tsx` remain as-is for backward compatibility through the 26.4.x window.
- `VFolderNodeDescription.tsx` still imports `statusTagColor` from the legacy `VFolderNodes`.

## Follow-up

- Track the backend gap: file a request under FR-2572 for a `restoreVfolderV2` mutation. Once landed, create `RestoreVFolderModalV2` and switch the remaining restore paths off the legacy REST client.

## Verification

\`bash scripts/verify.sh\` → \`=== ALL PASS ===\` (Relay / Lint / Format / TypeScript)

**Checklist:**
- [x] Legacy files untouched
- [x] V2 components created with new fragment names
- [x] Consumers switched to V2 for delete/purge (row-level + bulk)
- [x] Restore path preserved on legacy REST (backend gap)
- [x] verify.sh passes
- [ ] Minimum manager version: 26.4.2 (for V2 mutations)
@graphite-app graphite-app Bot force-pushed the 04-16-feat_fr-2593_implement_vfolder_creation_modal_using_v2_graphql_mutation branch from 82e39a0 to 38fa50f Compare April 30, 2026 03:07
@graphite-app graphite-app Bot force-pushed the 04-21-feat_fr-2613_migrate_vfolder_trash_lifecycle_mutations_to_v2_graphql_api branch from 99b663c to 7c822bb Compare April 30, 2026 03:08
Base automatically changed from 04-16-feat_fr-2593_implement_vfolder_creation_modal_using_v2_graphql_mutation to main April 30, 2026 03:11
@graphite-app graphite-app Bot merged commit 7c822bb into main Apr 30, 2026
8 checks passed
@graphite-app graphite-app Bot deleted the 04-21-feat_fr-2613_migrate_vfolder_trash_lifecycle_mutations_to_v2_graphql_api branch April 30, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:i18n Localization area:lib Library and SDK related issue. area:ux UI / UX issue. size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate VFolder trash lifecycle mutations to Strawberry V2 GraphQL API

5 participants