Say which side of a private reaction you are on
The chip read "private" to everybody who could see it, which says the least useful thing to each of them. The person who sent it is now told who saw it, and the author is told that nobody else did. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
740e8411cb
commit
bfd86f9817
@@ -1785,6 +1785,7 @@ fun ColumnScope.ChatScreen(
|
||||
Bubble(
|
||||
line = line,
|
||||
model = model,
|
||||
myUserId = myUserId,
|
||||
authorName =
|
||||
when {
|
||||
line.mine || chat.group == null -> {
|
||||
@@ -2318,6 +2319,8 @@ private fun ColumnScope.VoiceComposer(
|
||||
private fun Bubble(
|
||||
line: Session.Line,
|
||||
model: MessengerViewModel,
|
||||
/** Ours, so a private reaction can say which side of it you are on. */
|
||||
myUserId: Long = 0L,
|
||||
authorName: String = "",
|
||||
picture: io.flamenet.e2e.Attachment.Ref? = null,
|
||||
) {
|
||||
@@ -2530,7 +2533,12 @@ private fun Bubble(
|
||||
// should not be mistaken for one the group watched arrive.
|
||||
line.privateReactions.entries.sortedBy { it.key }.forEach { (emoji, who) ->
|
||||
Text(
|
||||
if (who.size == 1) "$emoji private" else "$emoji ${who.size} private",
|
||||
run {
|
||||
// The person who sent it is told who saw it;
|
||||
// the author is told that nobody else did.
|
||||
val side = if (myUserId in who) "only them" else "only you"
|
||||
if (who.size == 1) "$emoji $side" else "$emoji ${who.size} $side"
|
||||
},
|
||||
fontSize = 13.sp,
|
||||
color = Palette.SecondaryText,
|
||||
modifier =
|
||||
|
||||
@@ -73,5 +73,8 @@ class PrivateReactionSendTest {
|
||||
assertTrue(chat.contains("react-private-toggle"), "no way to choose a private reaction")
|
||||
assertTrue(chat.contains("privately = privately"))
|
||||
assertTrue(chat.contains("line.privateReactions.entries"), "private reactions are not drawn")
|
||||
// The same chip has to read correctly from both sides of it.
|
||||
assertTrue(chat.contains("\"only them\""))
|
||||
assertTrue(chat.contains("\"only you\""))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user