silverstripe / silverstripe-asset-admin

Silverstripe assets gallery for asset management
BSD 3-Clause "New" or "Revised" License
20 stars 79 forks source link

Show target folder for uploads in UploadField #759

Open chillu opened 6 years ago

chillu commented 6 years ago

Overview

There's been a discussion in https://github.com/silverstripe/silverstripe-asset-admin/issues/742 which surfaced that we've removed a 3.x feature that was quite useful: Knowing which folder is configured to upload files into. While you can view uploaded files after the fact and check their location in the breadcrumbs, it's not an ideal UI.

Acceptance Criteria

Current implementation

3.x

image

4.x empty

image

4.x with file

image

Design direction for solution

https://projects.invisionapp.com/dsm/silver-stripe/silver-stripe/asset/components/5b5e6e3984472000117f3ee4

Notes

chillu commented 6 years ago

@newleeland Can you please create a UX solution for this?

tractorcow commented 6 years ago

Good story, thanks for the split @chillu makes it clearer to me now. :)

newleeland commented 6 years ago

~~Potential Design https://invis.io/FTG16IYV5KB#/289577984_CMS_UploadField_Location~~ OLD designs

clarkepaul commented 6 years ago

Quote from user testing about a month ago, not sure if its a bug or standard SS3 behaviour but thought it might interest others—maybe it has the folder set by developer and they don't want to use the default? If it would help the this issue I can dig a little bit more with the person—let me know.

"They is one thing that really just drives me insane it’s only small, its when you’re on a page and you upload a document to your files area and it goes to the wrong path and press change to navigate to the right location and it never saves it. And so I always have to attach from my computer or attach from files and do it"

maxime-rainville commented 6 years ago

One thing I didn't think off last week before working on #760, is that the modal allows you to upload files and to navigate to different folder.

Let's say a CMS editor opens the modal, navigate to a different folder, and then closes the modal. Should this affect the folder to which the basic dropzone will push files? Or should the basic drop zone always push to the same folder no matter what?

Otherwise, if everyone's happy Jared's design, I can go ahead and implement it.

tractorcow commented 6 years ago

Let's say a CMS editor opens the modal, navigate to a different folder, and then closes the modal. Should this affect the folder to which the basic dropzone will push files?

I don't think so... I think leave the "default" as fixed, and continue to allow users to select their own destination for custom upload destinations via the modal as-is.

clarkepaul commented 6 years ago

I agree with @tractorcow, I don't think it would effect the default location. If there was an action to set this as the default then maybe.

maxime-rainville commented 6 years ago

@tractorcow @clarkepaul Your thoughts aligned with mine. Plus I'm lazy and I don't want to update the upload logic for the dropzone.

chillu commented 6 years ago

Designs look good, but please keep the issue ACs in mind. @newleeland if you think that choosing a folder location is important for the UX, then please separate this out into a new ticket, and write ACs. The scope of this ticket is just to surface the default location.

clarkepaul commented 6 years ago

@chillu my fault as I picked that part up from the conversation rather than AC's. Your right though, and also our intention that its a potential "future" addition which could be separated out.

clarkepaul commented 5 years ago

Designs in SilverStripe DSM show the folder to upload to when the UploadField is empty, but we don't show the folder location once a file has been attached (maybe that is required as well?) and its editable. https://projects.invisionapp.com/dsm/silver-stripe/silver-stripe/asset/components/5b5e6e3984472000117f3ee4

Same issue pretty much https://github.com/silverstripe/silverstripe-cms/issues/999

clarkepaul commented 5 years ago

Points which came up during discussion:

How to handle folder assigning if the developer has pre-configured it already to a specific folder, can the user change it? (applies globally for all upload fields or for a specific field)

I think CMS users should be able to select a new folder even if the developer has configured it, the change would then apply for all subsequent users of that field.

Does a newly selected default folder for a UploadField stay like that forever or is it session based?

I think this sets the folder indefinitely or until its changed (not session-based).

By navigating the files area through the Upload Field does the last visited folder get stored as the new folder location for all subsequent uploads?

I don't think this has any influence on the default folder (as per current functionality).

Keen to hear other opinions on this. cc @jonom

jonom commented 5 years ago

@clarkepaul here are some sprawling thoughts 😄

Separation of concerns For the most part, I don't think devs should be deciding where uploads go. SilverStripe CMS prides itself on separating developer and content-author concerns. I'd argue that file organisation is a concern of the CMS user, not the developer, and the setFolder() method is there because in the past it hasn't been possible for the user to determine where a file should go, and without that setting everything would up in that darn Uploads folder.

setFolder behaviour I'd suggest that if a dev uses setFolder(), then it should be respected and at least be the starting point every time, but I'd also suggest that devs should only use this when it's really important that files go to a certain place.

Never make default the only option Currently if you drop a file on to an UploadField or click the upload button it will go in to whatever folder was set with setFolder, or if that hasn't been set, it will go in to the Uploads folder (Yuck). I think that after starting the upload, users should get a modal interface that lets them confirm and edit the basic details (title/filename/location... focuspoint 😄) of each file. This would hopefully encourage users to keep their files better organised, by being able to do it at the point of upload instead of having to go back and do it after the fact (which is not likely to happen).

Different approaches to file organisation I'm not sure I like the idea of persisting the 'last uploaded to' state on individual UploadFields. I assume that you would scope that by Model->Field rather than Record->Field? To me that assumes a behaviour that if you're uploading to a 'Hero Image' field on a Page, you want to e.g. always use a 'Hero Images' folder. That's probably a common approach, but it might be equally common (and my preference) to organise files by theme not application. For example if you have a page called 'Autumn' you might want to have a folder of the same name where you keep all your images of pretty leaves 🍁. In that case remembering last-opened locations at the page level would make more sense. I think both of these approaches are valid and I don't think the CMS should assume either one, as that could create an annoying UX for the other.

Conclusion Because of the different approaches to organising files, my preference would be:

  1. Whenever you open the file manager in a modal, whether to upload or choose existing, it opens to wherever you were the last time you opened any file manager (global).
  2. The only exception to this would be if a dev has used setFolder, then it should open to that location. (But devs... please don't use setFolder)

Bonus points:

  1. Introduce a 'recent folders' panel for quick access to recent locations
    • Only show folders that were actually utilised, e.g. attached from or uploaded to, not just browsed to
    • Would be great if folders could be permanently bookmarked as well
jonom commented 5 years ago

@clarkepaul p.s. I forgot another more radical suggestion.

Just one upload UI We could remove the dropzone and the upload button from the base field and just have a 'Choose' button which would mirror the current 'Choose existing' button functionality by opening a File Manager modal. Users can then either choose existing files or upload new ones, including by dropping files, so there's no functionality lost really.

It is potentially one more click if you want to upload, but it would reduce the complexity of the UI (and thus maintenance debt) by having a single UX for uploads, and would channel content editors in to an interface that shows them where their files are going to be uploaded and allows them to choose to change that location. That solves the two main problems above:

  1. users don't know where their files are going
  2. users can't change where they're going

Removing the direct upload functionality would solve both of those problems, and hopefully come with a third benefit which is encouraging good file management. (I'm sick of seeing seven copies of the same file in the Uploads folder.)

Sorry for going way out of scope here!

clarkepaul commented 5 years ago

@jonom I think that last suggestion (removing uploading on the Upload Field) would need a bit of user testing before going that far but it would resolve a lot of pain development-wise. I'll have a bit more of a think on that one. Maybe the simplified version could be an alternative, and if successful phase out the old Upload Field (Upload Field even states it in its name—making uploading possible on a page).

I'd argue that file organisation is a concern of the CMS user

I agree with you on that one.

Editing directly as soon as you drop files into an Upload Field would need to be added as a separate enhancement, would be nice to have for bulk uploads for sure. We actually designed a carousel of sorts for bulk editing years ago but never got built, it's exactly what you are referring to though.

I also agree on not assuming the last folder is the one to be used again (unless it's specified and set as the preferred folder). A similar idea we had way back was to have a "Recently added/edited files" section on the landing page of the File Manager, it would kind of act like a smart bookmark for recent activity.