Skip to content

Mobile gallery block - Upload options #1610

@mkevins

Description

@mkevins

This aims to track issues related to uploading media from the Gallery block. It is part of this issue: #1416.

Test Builds

Builds are open for testing on these draft PRs:

Media uploading and ids

In the current state, the MediaPlaceholder component utilizes the addToGallery prop described here: WordPress/gutenberg#18262 to remove duplicates via the id prop whenever new media is selected. This is because the collection of image elements is currently keyed on id or url if id is not defined.

When a media item is local (i.e. not finished uploading, in the case of adding media from device), it may have a temporary local id. This can result in "collisions" (i.e. the local id of a newly added and currently uploading media item being equal to the "server id" of an already uploaded item within the same gallery).

One way to address this is to negate the local media id over the bridge (both directions), this way, the media models / database on WordPress-Android will not require updating, and the Gutenberg (JavaScript) side will not see collisions. I'd love to know if there are alternative approaches to solving this as well.

Update: The collision id issue has been confirmed with steps here.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions