Page MenuHomePhabricator

[lib/native] introduce connect farcaster alert handler
ClosedPublic

Authored by ginsu on Apr 9 2024, 10:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 3:00 AM
Unknown Object (File)
Sun, Nov 3, 8:22 AM
Unknown Object (File)
Oct 12 2024, 8:50 PM
Unknown Object (File)
Oct 12 2024, 8:50 PM
Unknown Object (File)
Oct 12 2024, 8:50 PM
Unknown Object (File)
Oct 12 2024, 8:50 PM
Unknown Object (File)
Oct 12 2024, 8:50 PM
Unknown Object (File)
Oct 12 2024, 8:49 PM
Subscribers

Details

Summary

This diff introduces ConnectFarcasterAlertHandler component which handles the mechanism to prompt the user to connect to farcaster.

I needed to introduce a new handler because FarcasterDataHandler lives in lib and I needed to be able to use the useNavigation hook.

Linear task: https://linear.app/comm/issue/ENG-7525/extend-farcaster-data-handler-to-handle-navigating-to-the-connect + https://linear.app/comm/issue/ENG-7623/introduce-shouldskipconnectfarcasteralert

Depends on D11601

Test Plan

Please see the demo video below

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Apr 9 2024, 10:33 PM
Harbormaster failed remote builds in B28116: Diff 38972!
ginsu requested review of this revision.Apr 9 2024, 10:47 PM

will make sure ci passes before landing

lib/utils/push-alerts.js
18 ↗(On Diff #38972)

I intentionally introduced this gate because I figured it would be annoying as a dev to keep getting this alert everyday. I introduced a new linear task to track removing this gate when we are ready to flip the switch with the farcaster integration

https://linear.app/comm/issue/ENG-7662/remove-gate-connect-farcaster-alert-gate

native/components/farcaster-handler.react.js
45 ↗(On Diff #38972)

this half second sleep is intentional. Without it, the bottom sheet immediately flys in when the app opens up and bombards the user with things to do. I felt that this was a bit too much/not the best user experience.

native/root.react.js
301 ↗(On Diff #38972)

Needed to move the handler to be within the navigation container so that I could use the useNavigation hook

lib/utils/push-alerts.js
18 ↗(On Diff #38972)

I don't think this makes sense. You're concerned about the dev experience, but you have no way to launch this work without introducing the very dev experience issue you're worried about. See my comment on the Linear task

lib/utils/push-alerts.js
18 ↗(On Diff #38972)

Responded on Linear, but updated the gate to be based on isDev and usingCommServicesAccessToken

native/components/farcaster-handler.react.js
51 ↗(On Diff #39025)

this 1 second sleep is intentional. Without it, the bottom sheet immediately flys in when the app opens up and bombards the user with things to do. I felt that this was a bit too much/not the best user experience.

native/root.react.js
301 ↗(On Diff #39025)

Needed to move the handler to be within the navigation container so that I could use the useNavigation hook

native/components/farcaster-handler.react.js
22 ↗(On Diff #39025)

Typo

67 ↗(On Diff #39025)

What's the thinking behind having this render FarcasterHandler? It feels to me like it might make more sense for the two components to be siblings, and to rename this one something more specific to what it's doing

native/components/farcaster-handler.react.js
67 ↗(On Diff #39025)

Was thinking that it would be cleaner to only have a singular "farcaster handler" component that handles all the farcaster business logic, but sounds like having the two components + renaming this one to be more specific to what farcaster logic is being handled here is a better way to go about it

address comments

native/components/connect-farcaster-alert-handler.react.js
50 ↗(On Diff #39088)

this 1 second sleep is intentional. Without it, the bottom sheet immediately flys in when the app opens up and bombards the user with things to do. I felt that this was a bit too much/not the best user experience.

ginsu retitled this revision from [lib/native] introduce farcaster handler to [lib/native] introduce connect farcaster alert handler.Apr 12 2024, 12:28 PM
ginsu edited the summary of this revision. (Show Details)

Code changes look good, would be good to make sure all other notes left by other reviewers are addressed/responded to before landing.

lib/utils/push-alerts.js
9–18 ↗(On Diff #39088)

So we just turned this from arrow function to a "traditional"(?) function?

native/components/connect-farcaster-alert-handler.react.js
50 ↗(On Diff #39088)

We're using "our" BottomSheet component here, right? So things should be identical on iOS and Android and we don't need to go out of our way to see how things look on Android?

This revision is now accepted and ready to land.Apr 15 2024, 4:33 PM
lib/utils/push-alerts.js
9–18 ↗(On Diff #39088)

Yea sorry probs should have annotated that, but yea this is just bc of my personal preference

native/components/connect-farcaster-alert-handler.react.js
50 ↗(On Diff #39088)

Yea that's correct

Code changes look good, would be good to make sure all other notes left by other reviewers are addressed/responded to before landing.

Confirmed all points of feedback have been addressed

This revision was landed with ongoing or failed builds.Apr 15 2024, 7:32 PM
This revision was automatically updated to reflect the committed changes.