Page MenuHomePhabricator

[web] Update `DisconnectedBar` to display based on `useNetworkConnected()`
ClosedPublic

Authored by atul on Dec 27 2023, 6:27 PM.
Tags
None
Referenced Files
F3535339: D10469.id.diff
Wed, Dec 25, 3:21 PM
Unknown Object (File)
Thu, Dec 12, 2:41 PM
Unknown Object (File)
Wed, Nov 27, 5:26 AM
Unknown Object (File)
Wed, Nov 27, 1:24 AM
Unknown Object (File)
Nov 23 2024, 12:07 PM
Unknown Object (File)
Nov 23 2024, 11:47 AM
Unknown Object (File)
Oct 31 2024, 1:23 AM
Unknown Object (File)
Oct 31 2024, 1:23 AM
Subscribers

Details

Summary

Part of https://linear.app/comm/issue/ENG-6137/modify-disconnectedbar-so-it-pulls-from-connectivityinfo.

To begin, I'm going to update the web and native components to skip eg useShouldShowDisconnectedBar, etc. and just get the boolean they need (is the network connected or not) "directly" from useNetworkConnected on web and (state => state.connectivity.connected) on native.

I'll then go ahead and rename all of eg useDisconnectedBarVisibilityHandler to make it clear that they're no longer connected to the DisconnectedBar. I think we'll still want all the Redux actions and whatnot for the "Keyserver status"? page that @ginsu is working on, so I won't rip them out.

Test Plan
  1. Open local web app
  2. Kill local keyserver
  3. Observe that nothing happens:

9c74cc.png (2×3 px, 1 MB)

  1. Disconnect laptop from WiFi
  2. Observe the DisconnectedBar:

0be6a7.png (612×3 px, 435 KB)

Diff Detail

Repository
rCOMM Comm
Branch
arcpatch-D10469 (branched from master)
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul published this revision for review.Dec 27 2023, 6:33 PM
atul added inline comments.
web/redux/disconnected-bar.js
18 ↗(On Diff #35036)

CC @ashoat there's a product decision to be made here.

We'll no longer have separate "CONNECTING..." and "DISCONNECTED" states. Instead we'll have a networkConnected: boolean which doesn't differentiate between the two.

When the client is disconnected should we show CONNECTING... or DISCONNECTED? I slightly prefer CONNECTING... since it seems less "intense," but don't have a strong preference.

I can easily flip it to DISCONNECTED if that'd be preferred.

ashoat added 1 blocking reviewer(s): ginsu.

Would like one other person's perspective on the product question inline, but the code looks good

web/redux/disconnected-bar.js
18 ↗(On Diff #35036)

I'm okay either way, but have a slight preference for DISCONNECTED since it feels more accurate. Curious what other reviewers think

Let's update CONNECTING... with DISCONNECTED

web/redux/disconnected-bar.js
18 ↗(On Diff #35036)

I prefer DISCONNECTED as well, since I feel that CONNECTING... might create a feeling of a false success

This revision is now accepted and ready to land.Dec 28 2023, 8:31 AM
web/redux/disconnected-bar.js
18 ↗(On Diff #35036)

Okay, going to go with DISCONNECTED text but with connecting style (which is like a gray instead of a red).

address feedback and land

This revision was landed with ongoing or failed builds.Dec 28 2023, 3:39 PM
This revision was automatically updated to reflect the committed changes.