Repository navigation
feat(router): open a person's flipcash.com link on their profile - #1608
Merged
Merged
Conversation
A tapped `flipcash.com/<username>` or `flipcash.com/<uuid>` used to present that user's tip card, and TipCardDecorator then pushed their DM 450ms later. It now opens their profile, over the Chats tab, with a Message shortcut into the same DM route the chat profile uses. - `DeeplinkType.TipcardByUsername` becomes `DeeplinkType.Profile`, which also takes the bare-host UUID form. `/tip/<uuid>` stays `Tipcard` and still presents the card. - New `AppRoute.Messaging.Profile(ProfileAddress)` and `ProfileScreen`, reusing `ProfileHeader`, `ProfileShortcuts` and `dmRoute()`. `ProfileViewModel` resolves the handle or id. - A scanned profile link still presents the tip card: a printed code is there to be paid. - Your own link still lands on the You tab. A cold-start self-link by handle, which the router can't match yet, is caught by the screen once the lookup returns your id. - An unclaimed handle shows "Nobody has claimed @x" and a failed lookup shows "Couldn't Open Profile"; either pops the screen.
Tapping another person's link card in a chat pushed the DM with them. It now pushes their profile, the screen their flipcash.com link opens, and its Message shortcut goes on to the DM. Your own card and a card for the person you're already talking to behave as before.
The profile a link opens gets a Share shortcut next to Message. It shares the same flipcash.com link through Shareable.TipCard, in the handle form when they have one, titled with their name. The chat profile keeps just Message: ProfileShortcuts takes Share as an optional callback and only the standalone screen passes it.
Tapping a member's avatar in a group opens the in-chat profile, which already shows Message for them. It now shows Share too, with the same link and title as the profile a link opens. A DM's profile still has no shortcuts. The share handler moves into rememberProfileShare() so both screens build the Shareable the same way.
The profile a flipcash.com link opens had its own layout with only the Message and Share shortcuts. It now renders the same screen as a chat's profile, so it has Report and Block, and its rows follow the rules that screen already has. ChatProfileScreen splits into the chat wrapper and PersonProfileScreen, which takes the chat as nullable. With no chat there is no Mute row or muted chip, and the shortcuts show. ProfileViewModel still does the lookup, then hands the person to ChatProfileViewModel, which runs Block. A successful block pops the profile, since there is no chat to leave.
ChatProfileViewModel fetches the person's profile again to get a join date the chat's cached copy lacks. A profile a link opened was fetched a moment earlier, so that second request was redundant. OnParticipantSet now takes fromServer, and ProfileScreen sets it to use the join date it already has.
Share followed Message's rule, so a tip DM's profile and your own had none. It now shows for any person with a link: the DM's counterpart, a group member, yourself, and a profile a link opened. Message and Send Cash keep profileShortcutRecipient's rule, so ProfileShortcuts takes onMessage as nullable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A tapped
flipcash.com/<username>orflipcash.com/<uuid>presented that user's tip card, andTipCardDecoratorthen pushed their DM after 450ms. It now opens their profile over the Chats tab. The profile's Message button opens the DM through the samedmRoute()the chat profile uses. iOS is making the same change separately by pushing itsUserProfileScreen.What changed
AppRouter.handleProfileLink()returnsDeeplinkType.Profile(ProfileAddress), which replacesTipcardByUsernameand also covers the bare-host UUID form./tip/<uuid>is stillTipcardand still presents the card.ProfileproducesDeeplinkAction.Navigate([Tabs.Chats, Messaging.Profile(address)]).App.ktandMainRootalready handleNavigateon warm and cold start, so neither needed a new branch.AppRoute.Messaging.Profile.ProfileScreenrenders the same screen as a chat's profile:ChatProfileScreensplits into its chat wrapper andPersonProfileScreen, which takes the chat as nullable. With no chat behind it there is no Mute row or muted chip, and Report and Block stay.ProfileViewModelresolves the address throughProfileController, then hands the person toChatProfileViewModel, which runs Block; a successful block pops the profile.dmRoute()moved intoProfileShortcuts.kt.LinkCard.User, as before. Tapping another person’s card now pushes their profile instead of the DM. Your own card and a card for the person you’re already talking to behave as before.flipcash.comlink throughShareable.TipCard, in the handle form when there is one, viarememberProfileShare(). Message and Send Cash keepprofileShortcutRecipient's rule.ChatProfileViewModel.Event.OnParticipantSettakesfromServer, so a linked profile uses the join date its lookup already fetched instead of fetching the profile again.Own link and failures
Tests
AppRouterTest: the bare-host tests now expectProfileand the newNavigatestack. A new test pins/tip/<uuid>toPresentTipCard.ProfileViewModelTest(7 cases): resolve by handle and by id, unclaimed handle, failed fetch, unknown id, a profile with no id, and your own handle.LinkCardClassifierTest,ConversionsTestandDeeplinkScanPolicyTestare updated for the renamed type.