Confusing interface when you attach a file to a post
When you want to attach a file to a post you get this menu
This is confusing because in practice you can attach many other kinds of file (pdf for example) and as long as you dont try you dont know you can.
Not a major issue, but it could be improved.
The audio, image, and video file types have been added for mobile. It allows opening directly the correct interface. E.g., if you click on "Attach an image", it will open the photo gallery and the camera to directly take a picture. On a computer, it will add a filter to only show images when browsing your files.
On a computer, it will add a filter to only show images when browsing your files.
Ah! Ok, now I understand my 'mistake'. If I want to insert another kind of file (e.g. a pdf file) I need to click the "image button" (which is also confusing !) in the menu bar.
If I want to insert another kind of file (e.g. a pdf file) I need to click the "image button"
No. For any file types (PDF, etc.), you need to click on the "Cloud" button:
On a computer, it will add a filter to only show images when browsing your files.
Ah! Ok, now I understand my 'mistake'. If I want to insert another kind of file (e.g. a pdf file) I need to click the "image button" (which is also confusing !) in the menu bar.
I agree it's confusing.
Many of our users are certainly confused by it. . Regardless of the technical reasons, (and the image and audio filters etc that were added are certainly appreciated) in practice it would be helpful to also add a file icon to the list of your types - as common users simply see a list of items they can attach, and no sign of files.
Also to click the 'upload' button for files, but instead to block the dropdown menu for images, audio etc feels a bit duplicative.
@spoorun I agree. @Eladnarlea maybe you have a suggestion?
We are aware of this problem and are actively looking for a good fix for this!
Thank you for your suggestions :)
Perhaps we could implement following as a workaround.
We replace the "Split Button" (Left side general Upload, Right Side More) with one button which always shows the dropdown menu.
- Here we add an option for regular files.
- Always show an icon, if necessary simply a fallback to the cloud or similar
@luke- What I would do (not sure, first idea reviewing the code):
Add UploadFileHandler::class to https://github.com/humhub/humhub/blob/72b0bb807a4d81fef687d0c4188dda88e92d59a1/protected/humhub/modules/file/Module.php#L114-L114
Rewrite https://github.com/humhub/humhub/blob/72b0bb807a4d81fef687d0c4188dda88e92d59a1/protected/humhub/modules/file/widgets/FileHandlerButtonDropdown.php#L62-L82 to deal with 2 possibilities:
- Module::defaultFileHandlers has 1 handler: display a basic button
- 2 or more handlers: display a dropdown button as you described
It means we must removeUploadButton widget in all HumHub core and all modules using file upload, e.g.: https://github.com/humhub/humhub/blob/72b0bb807a4d81fef687d0c4188dda88e92d59a1/protected/humhub/modules/content/widgets/views/wallCreateContentFormFooter.php#L58-L65
Do you think we should do this? Maybe on HumHub 1.17 as some modules are already compatible with HumHub 1.16? Or you have a better idea?
@marc-farre Thank you for your research here.
Here are a few thoughts without having looked at the code in detail.
- Does it make sense to always have two widgets here
UploadButtonandFileHandlerButtonDropdown. Wouldn't it make sense to have only oneUploadButton, which always displays a DropDown. - For better migration,
FileHandlerButtonDropdowncould always produce empty output. - Are there cases where only
UploadButtonis used withoutFileHandlerButtonDropdown. - Unfortunately it is probably too late for
v16. But I hope we won't need that long forv17.
@luke- Yes, that's a good solution, I think.
So if you agree, when I have time (as it's for v17 only), I will try to do the following:
- Merge
FileHandlerButtonDropdowncode intoUploadButton - Mark
FileHandlerButtonDropdownas deprecated and always return an empty output (so if there are cases where onlyUploadButtonis used withoutFileHandlerButtonDropdown, it won't be a problem) - Add
UploadFileHandler::classto https://github.com/humhub/humhub/blob/72b0bb807a4d81fef687d0c4188dda88e92d59a1/protected/humhub/modules/file/Module.php#L114-L114
In all modules, the handlers widget param sent to FileHandlerButtonDropdown must be moved to UploadButton (e.g. 'handlers' => $fileHandlers in https://github.com/humhub/humhub/blob/72b0bb807a4d81fef687d0c4188dda88e92d59a1/protected/humhub/modules/content/widgets/views/wallCreateContentFormFooter.php#L66).
If not, the default handler list will be used.
It seems to concern the Messenger and cFile modules. I'll also update them.
2 button types:
- if
Module::defaultFileHandlershas 1 handler only: display a basic button - if 2 or more handlers: display a dropdown button as you described
@marc-farre Sounds good to me!
Let me know if I can support you!