Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug AnimatedComponent getting stuck with rapid changes in state #3899

Open
chrisbobbe opened this issue Feb 12, 2020 · 4 comments
Open

Debug AnimatedComponent getting stuck with rapid changes in state #3899

chrisbobbe opened this issue Feb 12, 2020 · 4 comments
Labels
experimental UI/UX To be user-tested in experimental build help wanted

Comments

@chrisbobbe
Copy link
Contributor

chrisbobbe commented Feb 12, 2020

Good animations can go a long way to smooth out rough edges, and currently we're being blocked from using more of them.

876f22d reverted the use of AnimatedComponent for the OfflineNotice because of this issue:

When disconnecting from a VPN on Android 9 and later, the connection state goes from 'vpn' to 'none' to 'wifi' very quickly. This can result in the online banner getting stuck in mid-animation, until some other event (e.g. the user scrolling) causes a redraw.

I haven't had time to reproduce it, yet, but we'll need a consistent reproduction before we can continue using AnimatedComponent. I'd especially like to use it for a loading banner in #3387.

@chrisbobbe chrisbobbe added the experimental UI/UX To be user-tested in experimental build label Feb 12, 2020
chrisbobbe pushed a commit to chrisbobbe/zulip-mobile that referenced this issue Feb 13, 2020
…ng state.

For zulip#3387, provide the component to be used to show a loading
banner during the /register request.

This will be much improved with an animation, but progress is
blocked by zulip#3899. One idea is to give the exit animation a shorter
duration than the entrance animation, to give the impression that
we've been awaiting updates just as attentively as the user, and
that we're eager to show the updates and get out of the way
immediately.
chrisbobbe pushed a commit to chrisbobbe/zulip-mobile that referenced this issue Feb 13, 2020
…ng state.

For zulip#3387, provide the component to be used to show a loading
banner during the /register request.

This will be much improved with an animation, but progress is
blocked by zulip#3899. One idea is to give the exit animation a shorter
duration than the entrance animation, to give the impression that
we've been awaiting updates just as attentively as the user, and
that we're eager to show the updates and get out of the way
immediately.
@rk-for-zulip
Copy link
Contributor

When disconnecting from a VPN on Android 9 and later, the connection state goes from 'vpn' to 'none' to 'wifi' very quickly. This can result in the online banner getting stuck in mid-animation, until some other event (e.g. the user scrolling) causes a redraw.

I haven't had time to reproduce it, yet, but we'll need a consistent reproduction before we can continue using AnimatedComponent. I'd especially like to use it for a loading banner in #3387.

For the record, I originally tested by building a copy of TunProxy from a fork (raise-isayan/TunProxy, I think?), installing that onto a physical Pie device, and running a trivial HTTP proxy to forward onward to my local HTTP server.

Note that a physical Pie device was required! This bug did not occur in the emulator, possibly because the connection state transition sequence was different.

chrisbobbe pushed a commit to chrisbobbe/zulip-mobile that referenced this issue Feb 19, 2020
…ng state.

For zulip#3387, provide the component to be used to show a loading
banner during the /register request.

This will be much improved with an animation, but progress is
blocked by zulip#3899. One idea is to give the exit animation a shorter
duration than the entrance animation, to give the impression that
we've been awaiting updates just as attentively as the user, and
that we're eager to show the updates and get out of the way
immediately.
@chrisbobbe
Copy link
Contributor Author

chrisbobbe commented Feb 25, 2020

It's been proposed to use "Fluid Transitions for React Navigation". That project doesn't look to be actively maintained, and I'd prefer to stick with AnimatedComponent.

One thing its README.md does point out, here, is that Animated can't use the native driver for width and height values. That's covered in the Animated doc here. It's not clear to me from that paragraph in Fluid Transitions whether Fluid Transitions uses the native driver and thus solves the problem any better than Animated.

From the fact that Fluid Transitions says "The library is JavaScript only - no linking required," can we conclude that it's impossible that it uses the native driver? Or could it access the native driver through an existing link set up by React Native?

chrisbobbe pushed a commit to chrisbobbe/zulip-mobile that referenced this issue Feb 26, 2020
…ng state.

For zulip#3387, provide the component to be used to show a loading
banner during the /register request.

This will be much improved with an animation, but progress is
blocked by zulip#3899. One idea is to give the exit animation a shorter
duration than the entrance animation, to give the impression that
we've been awaiting updates just as attentively as the user, and
that we're eager to show the updates and get out of the way
immediately.
@gnprice
Copy link
Member

gnprice commented Feb 26, 2020

From the fact that Fluid Transitions says "The library is JavaScript only - no linking required," can we conclude that it's impossible that it uses the native driver? Or could it access the native driver through an existing link set up by React Native?

That sounds to me entirely consistent with using the native driver -- it just means that this library doesn't pull in any platform-native code of its own. (In particular "no linking required" sounds like a reference to react-native link and the associated tasks of updating Gradle and Xcode build configs.)

There's also this bit lower down in the README:

For achieving the best experience it's vital to get rid of JS evaluation during animation run. [...] Thus the native driver is used only when the ratio of source and target component are the same and it's recommended for the best quality of animations.

which sounds like it does indeed use the native driver in some circumstances.

chrisbobbe pushed a commit to chrisbobbe/zulip-mobile that referenced this issue Mar 9, 2020
For zulip#3387, provide the component to be used to show a loading
banner during the /register request.

This will be much improved with an animation, but progress is
blocked by zulip#3899. One idea is to give the exit animation a shorter
duration than the entrance animation, to give the impression that
we've been awaiting updates just as attentively as the user, and
that we're eager to show the updates and get out of the way
immediately.
chrisbobbe pushed a commit to chrisbobbe/zulip-mobile that referenced this issue Mar 9, 2020
For zulip#3387, provide the component to be used to show a loading
banner during the /register request.

This will be much improved with an animation, but progress is
blocked by zulip#3899. One idea is to give the exit animation a shorter
duration than the entrance animation, to give the impression that
we've been awaiting updates just as attentively as the user, and
that we're eager to show the updates and get out of the way
immediately.
gnprice pushed a commit to chrisbobbe/zulip-mobile that referenced this issue Mar 9, 2020
For zulip#3387, provide the component to be used to show a loading
banner during the /register request.

This will be much improved with an animation, but progress is
blocked by zulip#3899. One idea is to give the exit animation a shorter
duration than the entrance animation, to give the impression that
we've been awaiting updates just as attentively as the user, and
that we're eager to show the updates and get out of the way
immediately.
@chrisbobbe
Copy link
Contributor Author

chrisbobbe commented May 19, 2020

I haven't yet investigated whether this is very likely to be a cause, but it jogged my memory about this issue, and it looks like it'll be fixed with the RN v0.60 upgrade: facebook/react-native#23712

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental UI/UX To be user-tested in experimental build help wanted
Projects
None yet
Development

No branches or pull requests

3 participants