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:
Paul Hitt
2026-09-11 21:10:52 -04:00
co-authored by Claude Opus 5
parent 740e8411cb
commit bfd86f9817
2 changed files with 12 additions and 1 deletions
@@ -1785,6 +1785,7 @@ fun ColumnScope.ChatScreen(
Bubble( Bubble(
line = line, line = line,
model = model, model = model,
myUserId = myUserId,
authorName = authorName =
when { when {
line.mine || chat.group == null -> { line.mine || chat.group == null -> {
@@ -2318,6 +2319,8 @@ private fun ColumnScope.VoiceComposer(
private fun Bubble( private fun Bubble(
line: Session.Line, line: Session.Line,
model: MessengerViewModel, model: MessengerViewModel,
/** Ours, so a private reaction can say which side of it you are on. */
myUserId: Long = 0L,
authorName: String = "", authorName: String = "",
picture: io.flamenet.e2e.Attachment.Ref? = null, picture: io.flamenet.e2e.Attachment.Ref? = null,
) { ) {
@@ -2530,7 +2533,12 @@ private fun Bubble(
// should not be mistaken for one the group watched arrive. // should not be mistaken for one the group watched arrive.
line.privateReactions.entries.sortedBy { it.key }.forEach { (emoji, who) -> line.privateReactions.entries.sortedBy { it.key }.forEach { (emoji, who) ->
Text( 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, fontSize = 13.sp,
color = Palette.SecondaryText, color = Palette.SecondaryText,
modifier = modifier =
@@ -73,5 +73,8 @@ class PrivateReactionSendTest {
assertTrue(chat.contains("react-private-toggle"), "no way to choose a private reaction") assertTrue(chat.contains("react-private-toggle"), "no way to choose a private reaction")
assertTrue(chat.contains("privately = privately")) assertTrue(chat.contains("privately = privately"))
assertTrue(chat.contains("line.privateReactions.entries"), "private reactions are not drawn") 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\""))
} }
} }