element-hq / element-hq/element-meta
Multi-file upload placeholder until protocol will arrive
- Dominant language
- No language data
- Stars
- 112
- Forks
- 25
- Avg merge
- 6h 6m
- Merged PRs (30d)
- 4
Description
### Your use case
#### What would you like to do?
While there are no "multiple files on a single message" protocol released yet, I would like to still have a way to send multiple files at a single time and/or wait files in the compositor list as a list of removable, reorderable cards until I press send, instead of each file going straight into its own upload dialog and out to the room.
Implementing the current placeholder will allow easily wire it to proper "multiple files on a single message" protocol protocol in the future. Also it will unblock file-related features to implement, like Spoiler toggle and Media editor.
_// TODO: Add links/create feature requests for Spoiler and Media editor._
Each pending attachment shows enough to identify it without opening it:
- file name
- file size
- video container and codec (sniffed from the file, shown for videos only)
- whether the image is animated (GIF, animated PNG, animated WEBP)
Nothing is uploaded until send. Sending still produces one event per file, since Matrix has no multi-file event yet, but the order of those events is the one I chose rather than the one the file picker happened to return.
#### Why would you like to do it?
Attaching several files today is a one-at-a-time in the Element-web modal loop with no review step. Once a file is picked it is already on its way to the room. There is no way to drop one, no way to reorder, and no way to see what you actually selected.
There is also a consistency point. Every other messenger people run alongside Element (Discord, Slack, WhatsApp, Signal, Telegram) stages attachments before sending.
There was an [issue](https://github.com/element-hq/element-meta/discussions/686), where asked for this and was closed on the grounds that Matrix cannot put several files in one event. That is true of the wire format, but the complaint in that thread is about the composer, and the composer half was never addressed. Display-side counterpart and is [closed](https://github.com/element-hq/element-meta/discussions/754) and migrated to discussions, and probably stale.
#### How would you like to achieve it?
A staging area in the message composer that holds pending attachments, with one card per file, a remove control on each, and drag to reorder. Uploads start on send, not on attach.
I have a [PR](https://github.com/element-hq/element-web/pull/34550) created with the full working implementation and a video. I am creating this issue for discussing it with product and design.
### Have you considered any alternatives?
N/A
### Additional context
_No response_
Contributor guide
No contributing guide indexed for this repository
Research direction
Review PR #34550 and its accompanying video first, then compare the implementation with this issue's requested staging behavior. Done means pending files can be identified, removed, and reordered; uploads begin only on send, which still emits one event per file in the chosen order.
Written by the indexing model from the issue text.
Assessment
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100