Page MenuHomePhabricator

[native] Allow MediaGallery items to mount pre-selected
ClosedPublic

Authored by bartek on Feb 1 2023, 8:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 30, 5:59 AM
Unknown Object (File)
Wed, Oct 30, 5:59 AM
Unknown Object (File)
Wed, Oct 30, 5:58 AM
Unknown Object (File)
Wed, Oct 30, 5:53 AM
Unknown Object (File)
Sep 30 2024, 3:21 AM
Unknown Object (File)
Sep 30 2024, 3:21 AM
Unknown Object (File)
Sep 30 2024, 3:21 AM
Unknown Object (File)
Sep 30 2024, 3:18 AM
Subscribers

Details

Summary

For the approach described in https://linear.app/comm/issue/ENG-2411#comment-c4d6a4a4 to work, items can appear in MediaGalleryKeyboard preselected.
I need that MediaGalleryMedia component can be mounted with the pre-selected state already.

I basically copied code that animates the green checkmark from componentDidUpdate to componentDidMount.

Test Plan

Ensured that items that have isQueued = true when mounted have the green checkmark displayed and animated.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Feb 1 2023, 10:15 AM
ashoat requested changes to this revision.Feb 1 2023, 11:03 AM
ashoat added inline comments.
native/media/media-gallery-media.react.js
56 ↗(On Diff #21762)

Instead of animating these on mount, I think we should initialize them to the correct value. We can move the initialization of focusProgress and checkProgress to constructor, and pick the values based on isActive and isQueued. What do you think?

This revision now requires changes to proceed.Feb 1 2023, 11:03 AM
native/media/media-gallery-media.react.js
56 ↗(On Diff #21762)

The reason I animate them instead of just setting the value is to achieve animated effect visible on this video in ~0:08

Ah, that makes sense... without the animation, the user might not realize that the media listed at the start is not the same as it was before

This revision is now accepted and ready to land.Feb 1 2023, 1:04 PM