Skip to content

feat(edge-storage): add recursive folder deletion support#3385

Open
marcusgrando wants to merge 4 commits intodevfrom
feat/object-storage-recursive-folder-delete
Open

feat(edge-storage): add recursive folder deletion support#3385
marcusgrando wants to merge 4 commits intodevfrom
feat/object-storage-recursive-folder-delete

Conversation

@marcusgrando
Copy link
Member

Summary

  • Add support for recursive folder deletion in the Object Storage file browser
  • Users can now select folders via checkboxes (alongside files) and delete them, including all nested contents
  • Individual folder deletion available through the row action menu (three-dot menu)
  • Adaptive confirmation dialogs show context-aware messages for files-only, folders-only, and mixed selections

Motivation

Previously, users had to navigate into each folder and manually delete files page by page. There was no way to select or delete a folder and its contents in one operation. This change removes that friction.

How it works

Service layer (edge-storage-service.js)

New deleteRecursiveBucketFolder(bucketName, prefix, onProgress) method that:

  1. Lists all objects under the prefix using all_levels=true, paginating through all pages first (collecting keys into an array)
  2. Then deletes each object one by one with progress tracking

This two-phase approach (list-all-then-delete) avoids skipping objects that would happen if we interleaved listing and deleting on a mutating collection.

Composable layer (useEdgeStorage.js)

deleteMultipleFiles now accepts Array<{ name, isFolder }> instead of string[]:

  • Separates items into files and folders
  • Files go through the existing deleteMultipleEdgeStorageBucketFiles
  • Folders go through the new deleteRecursiveBucketFolder
  • Results are aggregated with unified toast messages ("items" instead of "files")

New refs (currentProcessStep, discoveredItemsCount, totalDeleteItems) support the two-phase progress UI.

UI changes

  • folder-list.vue: Folder rows now have checkboxes, showActions allows the action menu on folders, Download and Move bulk buttons are hidden when any folder is in the selection
  • ListView.vue: Row actions use visibleAction to show only Delete for folders (no Download/Rename/Move). New handleDeleteFolder for single-folder deletion. handleDeleteSelectedItems builds adaptive dialog messages based on selection composition
  • ProgressCard.vue: Shows "Preparing delete list..." with an indeterminate progress bar during the listing phase, then switches to percentage-based progress during deletion

Test plan

  • Select a single file → Delete → existing behavior unchanged
  • Select multiple files → Delete → existing bulk delete unchanged
  • Select a single folder via checkbox → Delete → recursive delete with two-phase progress
  • Delete a folder via row action menu → confirmation dialog → recursive delete
  • Select files + folders → Download and Move buttons disappear, Delete remains
  • Mixed selection delete → dialog shows "X file(s) and Y folder(s)" message
  • Folder-only selection → folder-specific warning text in dialog
  • Delete folder with nested subfolders → all contents removed at all depths
  • Delete empty folder → folder disappears after refresh
  • Large folder (100+ objects) → progress card shows listing phase, then percentage delete
  • Partial failure → toast reports partial completion
  • File row action menu → shows Download, Rename, Move, Delete
  • Folder row action menu → shows only Delete

Enable users to select and delete folders recursively in the Object
Storage file browser. Folders can be deleted via checkbox batch
selection or individual row action menu.

Key changes:
- Add deleteRecursiveBucketFolder service method (list-all-then-delete)
- Update deleteMultipleFiles composable for mixed file+folder selection
- Enable folder checkbox selection in folder-list table
- Hide Download/Move bulk actions when folders are selected
- Add folder Delete row action with adaptive confirmation dialogs
- Show two-phase progress: indeterminate listing, then percentage delete
…tants

- Extract EDGE_STORAGE_DELETE_STEP constants for 'listing'/'deleting' steps
- Replace stringly-typed step comparisons across service, composable, and component
- Consolidate duplicated state cleanup into finally block in deleteMultipleFiles
- Remove redundant totalDeleteItems assignment from onFileProgress callback
- Extract buildObjectKey helper to eliminate folderPath prefix duplication
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant