HomePhabricator
Diffusion Comm 136a9e67e3d5

[native] Resize back after WalletConnect modal closes

Tags
None
Referenced Files
F3047306: after.mp4
Wed, Oct 23, 5:13 PM
File Not Attached
F3047299: before.mp4
Wed, Oct 23, 5:13 PM
File Not Attached
F3047317: Screenshot 2024-10-22 at 9.15.40 PM.png
Wed, Oct 23, 5:13 PM
File Not Attached
Subscribers
None

Description

[native] Resize back after WalletConnect modal closes

Summary:
In part 3 of D11491, I made us ignore walletconnect_modal_update with height: 0 because I wanted to avoid a jitter that occurred before these events came before siwe_closed events.

(That jitter has improved since D11948, but is still there.)

The changes I made in D11491 made us also ignore walletconnect_modal_update events when a wallet was successfully connected. I figured this was a good idea because the WalletConnect modal was always larger than the normal modal.

However, in ENG-9537 I discovered that on Android, the WalletConnect modal was smaller than the normal modal, and our failure to resize after it was closed was causing the button to render almost off-screen.

Screenshot 2024-10-22 at 9.15.40 PM.png (272×1 px, 89 KB)

This diff adds code to differentiate between the two cases of walletconnect_modal_update with height: 0:

  1. The jitter case, where a siwe_closed event will be received within 50ms.
  2. The success case, where we want to resize back to the normal size.

We differentiate these cases by starting a timer, and seeing if the modal was closed within 50ms.

Test Plan:
I tested both scenarios on my Android device, with commSIWE hardcoded to point to production. Here's videos of before and after, with me first testing the success case, and then the jitter case. Note that the before video shows the issue with the success case, and that neither the before nor after videos show a jitter when closing the modal.

beforeafter

Reviewers: varun, will

Reviewed By: varun

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D13772

Details

Provenance
ashoatAuthored on Tue, Oct 22, 5:54 PM
Reviewer
varun
Differential Revision
D13772: [native] Resize back after WalletConnect modal closes
Parents
rCOMM7265fc4dcdfc: [lib] Fix basename test case
Branches
Unknown
Tags
Unknown