Repository navigation
feat(messenger): add a Message shortcut to a member's profile - #1534
Merged
Merged
Conversation
A group member's profile had no way to reach that person directly. The header now carries two round shortcuts under the join date: Message opens the DM, and Send Cash opens the DM with send cash already started. Send Cash sets a new AppRoute.Messaging.Chat.openSendCash flag. The chat dispatches OnSendCash once, after the participant is set and the opening fee is settled, because the handler drops the event without a participant and falls back to the keypad before the fee loads. A saved flag keeps it from firing again on rotation or on return from the payment step. The shortcuts are hidden on a tip DM's profile, where they would reopen the chat behind it, and on the viewer's own profile.
Send Cash is held back for now. Its button is commented out in ProfileShortcuts; the openSendCash route flag and the once-ready dispatch behind it stay wired. Message now sits 25dp below the join date and 25dp above the first row's text. The first menu row already has a 25dp inset, so the header drops its bottom padding when the shortcut shows. Above, the mute line no longer holds its empty height: ChatMuteStatusChip takes reserveSpace, off when the shortcuts show. That only happens on a group member's profile, which has no Mute row to change it while open.
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 group member's profile had no direct way to reach that person.
ChatProfileScreen's header now has a round Message shortcut under the join date, above the Report and Block rows. It pushesAppRoute.Messaging.Chat(ChatIdentifier.ByUser(...)), the same route "View in Chat" uses from transaction details. It goes throughLocalCodeNavigator, like the Report row, so the DM opens as a top-level route over the group chat.Send Cash, held back
A second Send Cash shortcut is built but commented out in
ProfileShortcuts. Everything behind it stays wired so it can come back by uncommenting:AppRoute.Messaging.Chat.openSendCashopens the DM with send cash started: the fee sheet if this payment creates the DM, the keypad if it already exists.OnSendCashdrops the event whileparticipantis null. It also falls back to the keypad before the opening fee loads. So the chat can't dispatch it on first composition the wayopenKeyboarddoes.ChatViewModel.State.sendCashReadybecomes true once the participant is set and the chat's existence and fee agree: it exists with no fee, or it doesn't exist and the fee has resolved.StartSendCashOnceReadydispatches once on that edge, behind arememberSaveableflag, so rotation or returning from the payment step doesn't fire it again.isChatInitializednow reads from a nullablechatExistenceflow, to tell "not answered yet" apart from "no DM".SendCashButtonis nowCondensedSymbolFontSize, for the shortcut to share.Visibility
profileShortcutRecipientreturns theTipUserto message, or null to hide the shortcut:TIP_DM, because a DM's profile is the other person in it, so the shortcut would only reopen that chatuserManager.accountId)TipUser, sinceByUserneeds a user idBlocked users aren't checked.
Layout
surfaceVariant, holding a 20dp white Material Symbolschat_bubble(filled).textSmallintextSecondary, 5dp below the circle, in a 100dp column.ChatMuteStatusChipnow takesreserveSpace, which is off when the shortcut shows. That only happens on a group member's profile, which has no Mute row to change it while the screen is open.Tests
ProfileShortcutRecipientTest: the visibility rule.ChatViewModelStateTest:isSendCashReadyacross participant, existence and fee.StartSendCashOnceReadyTest: waits for ready, fires once, and doesn't refire after recreation.ChatIdentityScreenshotTest: the header with the shortcut.