Project

General

Profile

Actions

Feature #20031

closed

New collection file browser copy/move operations

Added by Peter Amstutz about 1 year ago. Updated 8 months ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Workbench2
Target version:
Story points:
2.0
Release relationship:
Auto

Description

New operations using the collection service object based on replace_files API.

Use the file picker (with search/filter capability) for picking popup dialogs.

  • Copy selected files or directories to an existing collection (was implemented previously, is presently commented out)
  • Move selected files or directories to an existing collection
  • Copy/move to existing collection should work when the source and destination collection are the same (i.e. within the same collection)
    • When opening a dialog to move or copy files to a collection, the dialog should start with the current collection selected.
  • Move files or directories to a new collection (very similar UI to copying files to a new collection)
  • Copy/move each selected item to its own separate collection

Files

off-viewport auto-selected item.mov (1.7 MB) off-viewport auto-selected item.mov Lucas Di Pentima, 05/26/2023 01:43 PM

Subtasks 1 (0 open1 closed)

Task #20279: Review 20031-collection-files-batch-operationsResolvedStephen Smith05/02/2023Actions

Related issues

Related to Arvados Epics - Idea #16944: WB2 collections page feature parityClosed01/01/202203/31/2022Actions
Related to Arvados Workbench 2 - Bug #16065: Navigate to the newly created collection when extracting files from an existing oneNewActions
Blocks Arvados - Feature #20225: Let users choose collection subdirectories for workflow Directory inputsResolvedStephen Smith09/22/2023Actions
Actions #1

Updated by Peter Amstutz about 1 year ago

  • Story points set to 2.0
  • Description updated (diff)
  • Subject changed from New file operations to New collection file browser copy/move operations
Actions #2

Updated by Peter Amstutz about 1 year ago

  • Target version changed from Future to To be scheduled
Actions #3

Updated by Sarah Zaranek about 1 year ago

From Customers this list of operations:

Ability to split collections by folder
Merging collection (flat merge)
Extract files in collection by pattern
Rename files in collection
Will in UUID – download listing of all files
File in list of new and old file name and can also filter that way
Note have new API to do this but need to implement it in workbench
Also have a front end for arv-copy, hard to set up for Windows User (Customer is mostly Windows so hard for them to set up some of the utilities for things like arv-copy)

Actions #4

Updated by Sarah Zaranek about 1 year ago

There seems to be two tickets with this information. Let me find the other one.

Actions #5

Updated by Sarah Zaranek about 1 year ago

  • Related to Idea #16944: WB2 collections page feature parity added
Actions #7

Updated by Peter Amstutz about 1 year ago

  • Target version changed from To be scheduled to Development 2023-04-12 sprint
Actions #8

Updated by Peter Amstutz about 1 year ago

  • Description updated (diff)
Actions #9

Updated by Peter Amstutz about 1 year ago

  • Assigned To set to Stephen Smith
Actions #10

Updated by Stephen Smith about 1 year ago

  • Status changed from New to In Progress
Actions #11

Updated by Peter Amstutz about 1 year ago

  • Target version changed from Development 2023-04-12 sprint to Development 2023-04-26 sprint
Actions #12

Updated by Peter Amstutz 12 months ago

  • Target version changed from Development 2023-04-26 sprint to Development 2023-05-10 sprint
Actions #13

Updated by Stephen Smith 12 months ago

Changes at arvados-workbench2|7b8448155a3b9ca4c3c17c4879ed7ca256b4a42a
Tests developer-tests-workbench2: #1192

  • Add move/copy to new/existing collection
  • Add directory mode to tree picker for selecting collection subpath destinations
  • Navigate to newly created collection when copying/moving to new collection
  • Add move/copy to separate collections
  • Preselect current collection in move/copy to existing collection
    • Add collection support to ancestor service
    • Initialize copy/move to existing collection form with current collection
    • Use initial form value and ancestor service to preload tree picker with initial selection
    • Add refresh action to tree picker search actions to populate initial expanded tree picker items after p
      reselection
    • Allow pristine copy/move to existing form to be submitted with initial value (relies on form validation
      to disable submit if no initial value)
Actions #14

Updated by Stephen Smith 12 months ago

  • Related to Bug #16065: Navigate to the newly created collection when extracting files from an existing one added
Actions #15

Updated by Peter Amstutz 11 months ago

  • Target version changed from Development 2023-05-10 sprint to Development 2023-05-24 sprint
Actions #16

Updated by Peter Amstutz 11 months ago

  • Blocks Feature #20225: Let users choose collection subdirectories for workflow Directory inputs added
Actions #17

Updated by Lucas Di Pentima 11 months ago

So sorry about the delay, here're some initial comments, I haven't looked at the code yet, just played with the branch:

  • There're some pending linter warnings that used to be mandatory previous to the create-react-app script upgrade but now are optional. I think those need to be dealt with because they help making the compiled app leaner.
  • If I understand correctly, the "copy selected into separate collections" is to create one collection per selected file, correct? If that's the case I think the menu item should be disabled unless more than 1 selection is made.
  • Also, using the action "copy selected into separate collections" doesn't navigate into the newly created collections' parent, do you think it would be useful? At least for consistency's sake I think it should bring the user where the newly created collections are.
  • When selecting "copy into existing collection" and the current collection is somewhat deep in a project hierarchy (in my case, just inside a project from my home project), the "current collection auto-selecting" behavior makes the dialog's content flicker a bit while rendering the preselected collection. I think it would be less confusing if it shows a "loading..." indication until it's ready to render everything.
  • Not sure if this is scope creeping, but it would also be nice to have the "[copy|move] to [existing|new] collection" actions for individual items (e.g: righ-click context menu)
  • The "[un]select all" group of commands might need to be separated from the "copy" group of commands (on the menu), wdyt?
  • Are the "copy/move selected into existing collection" actions supposed to support creating sub directories on the existing target collections? In the edge case of using the current collection as the target, unless the collection already has subdirs where to place the files, is kind of confusing why we allow it.
  • When using "move selected into existing collection" to move one or more files to the same collection, they disappear from the collection. Looking at the request, it seems that "replace_files" is asking just that. Example: replace_files: {/some-file-to-copy: ""}
Actions #18

Updated by Peter Amstutz 11 months ago

  • Target version changed from Development 2023-05-24 sprint to Development 2023-06-07
Actions #19

Updated by Stephen Smith 11 months ago

Changes at arvados-workbench2|5e8d8fd1172273a14c9306f36eefc7aef8442dc6 branch 20031-collection-files-batch-operations
Tests developer-tests-workbench2: #1235

  • Removed unused imports
  • Hide copy/move to separate when only 1 file selected
  • Navigate to parent project when splitting to separate collections
  • Remove redundant tree picker expand call to reduce flickering some
    • I also tried to trigger the loading indicator on the root tree item, but the ancestors api call needs to be done before you can tell which one is loading, which is important since setting both home and shared nodes to pending to get the loading animation causes both to get loaded - I'm not sure if it's worth making a separate loading indicator (an overlay maybe?) or whether there's a better way to solve it, wdyt?
  • Add move/copy to new/existing to single file context menu
  • Separate select actions in menu
  • For creating a new directory, currently the picker doesn't have any way to do file operations within its UI, so that would need to be designed or we could add a create directory operation to the file browser. I agree this would be useful I'm just not sure where it should go or whether I should do that in this ticket
  • Stop loading spinner when copy/move error
  • Detect when move source & destination is the same and throw an error/toast
Actions #20

Updated by Lucas Di Pentima 11 months ago

This is looking very good, here're some minor comments that I think shouldn't take too much time to apply, if relevant:

  • Can you explain what's being attempted with the intercept call on the workbench2/cypress/integration/collection.spec.js test (arvados-workbench2|5e8d8fd)? If this intercept call avoids the test to exercise the entire wb2 -> keepweb -> api -> ws -> wb2 interaction, I think that's a conflict because AFAIR, the test was written with that in mind.
  • For consistency, do you think it would be nice to add icons besides every action on the menu? Also remember a comment from last demo that the icon instead of being a "hamburguer" should be the vertical three-dotted one like in the main panel (and the individual context menu icon be a horizontal three-dotted, IIRC)
  • When selecting the "copy or move into existing collection" options, and the current collection that gets auto-selected on the dialog is down on the list of tree items, I think the user can get confused and not realize that the current collection is selected. I think it would be nice to have the auto-selected item scrolled into the viewport, wdyt? (see attached video)
  • There some left over console.log(...) calls at:
    • src/views-components/dialog-forms/partial-copy-to-new-collection-dialog.ts:17
    • src/store/collections/collection-partial-copy-actions.ts:233
  • Re: cancelling submit spinners with dispatch(stopSubmit(SOMETHING)) (arvados-workbench2|e3c6784, for example), a simple way to do it is just do it on a finally { ... } clause instead of adding them on the try{...} and catch{...} ones because it doesn't matter the outcome, we'll want the spinner to stop anyways.
Actions #21

Updated by Lucas Di Pentima 11 months ago

I realized I didn't attached the video mentioned above, sorry about that!

Actions #22

Updated by Stephen Smith 11 months ago

Changes at arvados-workbench2|a167017da0181a84d0c5493364bc0f7f3fa3e942 branch 20031-collection-files-batch-operations
Tests developer-tests-workbench2: #1240

  • The intercept call in the collection tests is just for spying and waiting for the request, it doesn't modify the request or response since a static response body or intercept handler is omitted but it seems to reduce the chances of the test timing out
  • Added icons to the more options menu, corrected the kebab vs meatballs icon usage
  • Added auto scrolling to selected & preselected items
    • I had to convert Tree to a functional component to use react hooks
    • I initially tried using react refs, but they are only updated on first render, so I used a useCallback instead
    • I'm not sure how to differentiate an initial selected value from the user selecting a value in the tree picker, so it will scroll any selected item to the middle - hopefully that's not too annoying since there isn't any reason to repeatedly change the selection
  • Removed stray console logs
  • Simplified stopsubmit and progress indicator into finally blocks
Actions #23

Updated by Lucas Di Pentima 11 months ago

This LGTM, please merge. Thanks!

Actions #24

Updated by Stephen Smith 11 months ago

  • Status changed from In Progress to Resolved
Actions #25

Updated by Peter Amstutz 8 months ago

  • Release set to 66
Actions

Also available in: Atom PDF