Page MenuHomePhabricator

[native] Update `DisconnectedBar` to display based on `state.connectivity.connected`
ClosedPublic

Authored by atul on Dec 28 2023, 12:50 AM.
Tags
None
Referenced Files
F3535340: D10475.id.diff
Wed, Dec 25, 3:21 PM
Unknown Object (File)
Thu, Dec 12, 10:36 PM
Unknown Object (File)
Sun, Dec 1, 1:57 AM
Unknown Object (File)
Sat, Nov 30, 7:49 AM
Unknown Object (File)
Wed, Nov 27, 4:14 AM
Unknown Object (File)
Wed, Nov 27, 3:53 AM
Unknown Object (File)
Wed, Nov 27, 1:34 AM
Unknown Object (File)
Nov 24 2024, 5:21 AM
Subscribers

Details

Summary

Similar to D10469, but for native.

As mentioned in that diff, going to start by updating the DisconnectedBar on both native and web client to use network connectivity info instead of keyserver connectivity info.

Will then go ahead and rename eg useDisconnectedBarVisibilityHandler to make it clear that they're no longer connected to DisconnectedBar.


Depends on D10469

Test Plan
  1. Open native app on physical device
  2. Kill local keyserver
  3. Observe that nothing happens
  4. Turn off WiFi
  5. Observe DisconnectedBar

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/navigation/disconnected-bar.react.js
61 ↗(On Diff #35043)

CC @ashoat, similarly to https://phab.comm.dev/D10469#inline-63752 there's product decision to be made here on whether we want to show DISCONNECTED or CONNECTING.... Can easily change to DISCONNECTED if that'd be preferred.

atul requested review of this revision.Dec 28 2023, 1:08 AM
ashoat added 1 blocking reviewer(s): ginsu.

Would like one other person's perspective on the product question inline

native/navigation/disconnected-bar.react.js
26 ↗(On Diff #35043)

Can we try to use the "native driver" so that the animation is more smooth? I remember trying this initially, but it didn't work at the time the component was built. Maybe that's changed. Docs: [1], [2], [3]

If that doesn't work, we could potentially try Reanimated. Back in Reanimated 1 there was an issue preventing it from working, but hopefully Reanimated 2 fixes it.

Converting to Reanimated is a more involved task, though... if that's necessary, it can probably be handled as a follow-up task.

61 ↗(On Diff #35043)

Same opinion as in D10469. We could also consider using the connecting color, but the disconnected text

native/navigation/disconnected-bar.react.js
61 ↗(On Diff #35043)

I think "DISCONNECTED" text with connecting color is the best bet.

native/navigation/disconnected-bar.react.js
26 ↗(On Diff #35043)

Just to clarify, we'd set useNativeDriver: true in the call to Animated.timing(...) on lines 35-38 right? Just want to make sure there's no change that needs to happen here when we're setting showingRef.current

address feedback (useNativeDriver + change copy)

This revision is now accepted and ready to land.Dec 28 2023, 4:42 PM
This revision is now accepted and ready to land.Jan 4 2024, 10:41 AM

Re-landing with useNativeDriver removed, created task for converting animation to use Reanimated: https://linear.app/comm/issue/ENG-6348/consider-converting-disconnectedbar-animation-to-reanimated

This revision was landed with ongoing or failed builds.Jan 4 2024, 10:57 AM
This revision was automatically updated to reflect the committed changes.