Repository navigation
fix(chat): no reaction alert pill for the open chat - #1138
Merged
Merged
Conversation
A reaction or boost on a message in the open chat raised a "This chat ↓" pill whenever the message was scrolled off screen. ReactionAlertPlacement.decide now returns .bubbleOnly for the open chat regardless, and the thisChat case, its literal, the on-screen lookup and the tap-to-scroll path are removed. Opening a chat also closes its showing pill and drops its queued pills; pills for other chats stay queued in order.
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.
Reaction and boost alerts: no pill for the open chat
The in-app reaction/boost pill shows for a reaction on one of your messages in the chat you are
looking at, whenever that message is scrolled off screen. It is labelled "This chat ↓" and tapping
it scrolls to the message. It should not show at all: the pill is for activity in chats you are
not in.
Both platforms ship the same behaviour today, added in code-android-app#1857 and code-ios-app#1134:
ReactionAlertController.offer(shared/chat/.../alerts/ReactionAlertController.kt:110)chatId == activeChat && messageId in onScreenReactionAlertPlacement.decide(FlipcashCore/.../Models/Chat/ReactionAlert.swift:99-105).bubbleOnly; open chat + off screen →.pill(.thisChat)System pushes are not affected. Both platforms already suppress a chat push for the open chat
(Android
NotificationService.kt:321, iOSNotificationPresentation.presentationDecision).Behaviour
"Open chat" means the chat screen is showing in the foreground. On Android that is the
activeChatreported throughReportVisibleToReactionAlerts; on iOS it isConversationController.visibleConversationID.screen. On iOS an on-screen message still gets its bubble animation (
.bubbleOnly). Anoff-screen message gets nothing; the reaction is in the transcript when the user scrolls to it.
top row, tap opens that chat at the message.
chat closes, and queued pills for that chat are dropped. Pills for other chats stay queued and
show in order.
Removed
The "This chat ↓" variant can no longer be reached. Remove it on both platforms, so neither keeps
a path that later code could reconnect:
ReactionAlertPlacement.Label.thisChatcase, itsswitcharm and the "This chat ↓"literal in
ReactionAlertController.swift:121, and thescrollToMessagebranch oftappedtogether with whatever the conversation screen sets it from.
ReactionAlertState.inActiveChat,refreshActiveChatFlag,ReactionAlertAction.ScrollTo, theMessengerScreencollector for it, thealert_thisChatstring and the pill's branch for it, and any screenshot-test variant that renders it.
Copy
No new copy. "This chat ↓" (
alert_thisChaton Android) is deleted.Test cases
Both platforms cover every row at the unit level: Android in
ReactionAlertControllerTest, iOS inReactionAlertTests(ReactionAlertPlacement) plus the controller wherever it is testable..bubbleOnly).bubbleOnly) — was "This chat ↓"BOOSTED) on own messageRows that break today and must be updated, not deleted: Android
off screen message in the open chat shows with this chat label(becomes row 2) andtap in the open chat scrolls, elsewhere opens(keeps only the "elsewhere opens" half). iOSReactionAlertTests.swift:125(becomes row 2).Android counterpart: code-payments/code-android-app#1861