digidem / comapeo-mobile

The next version of Mapeo mobile
GNU General Public License v3.0
5 stars 1 forks source link

feat: more thoroughly implement attachments list in existing observation screen #491

Closed achou11 closed 3 months ago

achou11 commented 3 months ago

~Towards #449~ EDIT: see PR comment - not totally accurate

Updates the existing observation screen to better handle valid attachment types that it may be unfamiliar with. At the moment, any non-photo attachments are essentially rendering a placeholder thumbnail with some copy about what it is. when saving other attachment types is more extensively implemented, updating the corresponding placeholders should be straightforward.

Open to ideas about what the placeholders should look like. Tried to use my best judgment but I'm sure it can be improved upon.


To support this, this PR introduces more flexible and reusable components with the intention of replacing the existing MediaScrollView component. reasons for a new component:

Follow up PRs will update the other callsites of the MediaScrollView component (editor component, which is planned to be used in the observation edit screen)

There may be some design help needed but I did what felt reasonable for now, especially since we don't have a non-experimental way of creating other attachment types just yet.


Preview

Success (not scrollable):

image

Success (scrollable):

image image

Loading (when fetching blob url, not the image itself):

image

Error (when trying to fetch blob url, or if the image can't load):

image
achou11 commented 3 months ago

Misunderstood the ticket that this is supposedly addressing, so this PR is relatively non-urgent. will keep as a draft for now in case we are interested in potentially merging since it's mostly done. what's missing is implementation of some of the thumbnails based on ready-to-go designs.

gmaclennan commented 3 months ago

Let's maybe hold off on this until we have some UX time available to think through whether these should be pressable and when the modal should look like, and also make sure that we have the different states correctly included.