From 0ca69f0e5c5d49bc88c625b5c7ad9be486fe47c2 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 27 Jan 2026 10:02:44 +0100 Subject: [PATCH] ReactionSummaryEvents -> ReactionSummaryEvent --- .../android/features/messages/impl/MessagesStateProvider.kt | 4 ++-- .../element/android/features/messages/impl/MessagesView.kt | 4 ++-- .../{ReactionSummaryEvents.kt => ReactionSummaryEvent.kt} | 6 +++--- .../components/reactionsummary/ReactionSummaryPresenter.kt | 6 +++--- .../components/reactionsummary/ReactionSummaryState.kt | 2 +- .../components/reactionsummary/ReactionSummaryView.kt | 2 +- .../android/features/messages/impl/MessagesViewTest.kt | 6 +++--- .../reactionsummary/ReactionSummaryPresenterTest.kt | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) rename features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/{ReactionSummaryEvents.kt => ReactionSummaryEvent.kt} (85%) diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesStateProvider.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesStateProvider.kt index 03d12049cc..cf46e896b9 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesStateProvider.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesStateProvider.kt @@ -30,7 +30,7 @@ import io.element.android.features.messages.impl.timeline.aTimelineItemList import io.element.android.features.messages.impl.timeline.aTimelineState import io.element.android.features.messages.impl.timeline.components.customreaction.CustomReactionEvent import io.element.android.features.messages.impl.timeline.components.customreaction.CustomReactionState -import io.element.android.features.messages.impl.timeline.components.reactionsummary.ReactionSummaryEvents +import io.element.android.features.messages.impl.timeline.components.reactionsummary.ReactionSummaryEvent import io.element.android.features.messages.impl.timeline.components.reactionsummary.ReactionSummaryState import io.element.android.features.messages.impl.timeline.components.receipt.bottomsheet.ReadReceiptBottomSheetEvents import io.element.android.features.messages.impl.timeline.components.receipt.bottomsheet.ReadReceiptBottomSheetState @@ -187,7 +187,7 @@ fun aUserEventPermissions( fun aReactionSummaryState( target: ReactionSummaryState.Summary? = null, - eventSink: (ReactionSummaryEvents) -> Unit = {} + eventSink: (ReactionSummaryEvent) -> Unit = {} ) = ReactionSummaryState( target = target, eventSink = eventSink, diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesView.kt index 32fe8cddf5..87efc50528 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesView.kt @@ -76,7 +76,7 @@ import io.element.android.features.messages.impl.timeline.aTimelineItemEvent import io.element.android.features.messages.impl.timeline.aTimelineState import io.element.android.features.messages.impl.timeline.components.customreaction.CustomReactionBottomSheet import io.element.android.features.messages.impl.timeline.components.customreaction.CustomReactionEvent -import io.element.android.features.messages.impl.timeline.components.reactionsummary.ReactionSummaryEvents +import io.element.android.features.messages.impl.timeline.components.reactionsummary.ReactionSummaryEvent import io.element.android.features.messages.impl.timeline.components.reactionsummary.ReactionSummaryView import io.element.android.features.messages.impl.timeline.components.receipt.bottomsheet.ReadReceiptBottomSheet import io.element.android.features.messages.impl.timeline.components.receipt.bottomsheet.ReadReceiptBottomSheetEvents @@ -187,7 +187,7 @@ fun MessagesView( fun onEmojiReactionLongClick(emoji: String, event: TimelineItem.Event) { if (event.eventId == null) return - state.reactionSummaryState.eventSink(ReactionSummaryEvents.ShowReactionSummary(event.eventId, event.reactionsState.reactions, emoji)) + state.reactionSummaryState.eventSink(ReactionSummaryEvent.ShowReactionSummary(event.eventId, event.reactionsState.reactions, emoji)) } fun onMoreReactionsClick(event: TimelineItem.Event) { diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryEvents.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryEvent.kt similarity index 85% rename from features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryEvents.kt rename to features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryEvent.kt index 987b61e505..0203eb71b0 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryEvents.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryEvent.kt @@ -11,7 +11,7 @@ package io.element.android.features.messages.impl.timeline.components.reactionsu import io.element.android.features.messages.impl.timeline.model.AggregatedReaction import io.element.android.libraries.matrix.api.core.EventId -sealed interface ReactionSummaryEvents { - data object Clear : ReactionSummaryEvents - data class ShowReactionSummary(val eventId: EventId, val reactions: List, val selectedKey: String) : ReactionSummaryEvents +sealed interface ReactionSummaryEvent { + data object Clear : ReactionSummaryEvent + data class ShowReactionSummary(val eventId: EventId, val reactions: List, val selectedKey: String) : ReactionSummaryEvent } diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryPresenter.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryPresenter.kt index a95fe57bc7..d212aa6ff3 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryPresenter.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryPresenter.kt @@ -37,14 +37,14 @@ class ReactionSummaryPresenter( } val targetWithAvatars = populateSenderAvatars(members = membersState.roomMembers().orEmpty().toImmutableList(), summary = target.value) - fun handleEvent(event: ReactionSummaryEvents) { + fun handleEvent(event: ReactionSummaryEvent) { when (event) { - is ReactionSummaryEvents.ShowReactionSummary -> target.value = ReactionSummaryState.Summary( + is ReactionSummaryEvent.ShowReactionSummary -> target.value = ReactionSummaryState.Summary( reactions = event.reactions.toImmutableList(), selectedKey = event.selectedKey, selectedEventId = event.eventId ) - ReactionSummaryEvents.Clear -> target.value = null + ReactionSummaryEvent.Clear -> target.value = null } } return ReactionSummaryState( diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryState.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryState.kt index cf5342f853..36ba50a237 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryState.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryState.kt @@ -14,7 +14,7 @@ import kotlinx.collections.immutable.ImmutableList data class ReactionSummaryState( val target: Summary?, - val eventSink: (ReactionSummaryEvents) -> Unit + val eventSink: (ReactionSummaryEvent) -> Unit ) { data class Summary( val reactions: ImmutableList, diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryView.kt index 944fd9a195..c138378a3a 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryView.kt @@ -84,7 +84,7 @@ fun ReactionSummaryView( modifier: Modifier = Modifier, ) { fun onDismiss() { - state.eventSink(ReactionSummaryEvents.Clear) + state.eventSink(ReactionSummaryEvent.Clear) } if (state.target != null) { diff --git a/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/MessagesViewTest.kt b/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/MessagesViewTest.kt index 7be3365067..abac682a10 100644 --- a/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/MessagesViewTest.kt +++ b/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/MessagesViewTest.kt @@ -48,7 +48,7 @@ import io.element.android.features.messages.impl.timeline.aTimelineRoomInfo import io.element.android.features.messages.impl.timeline.aTimelineState import io.element.android.features.messages.impl.timeline.components.customreaction.CustomReactionEvent import io.element.android.features.messages.impl.timeline.components.customreaction.CustomReactionState -import io.element.android.features.messages.impl.timeline.components.reactionsummary.ReactionSummaryEvents +import io.element.android.features.messages.impl.timeline.components.reactionsummary.ReactionSummaryEvent import io.element.android.features.messages.impl.timeline.components.receipt.aReadReceiptData import io.element.android.features.messages.impl.timeline.components.receipt.bottomsheet.ReadReceiptBottomSheetEvents import io.element.android.features.messages.impl.timeline.model.TimelineItem @@ -406,7 +406,7 @@ class MessagesViewTest { @Test fun `long clicking on a reaction emits the expected Event`() { - val eventsRecorder = EventsRecorder() + val eventsRecorder = EventsRecorder() val state = aMessagesState( timelineState = aTimelineState( timelineItems = aTimelineItemList(aTimelineItemTextContent()), @@ -424,7 +424,7 @@ class MessagesViewTest { text = "👍️", useUnmergedTree = true, ).onFirst().performTouchInput { longClick() } - eventsRecorder.assertSingle(ReactionSummaryEvents.ShowReactionSummary(timelineItem.eventId!!, timelineItem.reactionsState.reactions, "👍️")) + eventsRecorder.assertSingle(ReactionSummaryEvent.ShowReactionSummary(timelineItem.eventId!!, timelineItem.reactionsState.reactions, "👍️")) } @Test diff --git a/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryPresenterTest.kt b/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryPresenterTest.kt index a05b7da5f5..4621a87e75 100644 --- a/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryPresenterTest.kt +++ b/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryPresenterTest.kt @@ -32,7 +32,7 @@ class ReactionSummaryPresenterTest { private val aggregatedReaction = anAggregatedReaction(userId = A_USER_ID, key = "👍", isHighlighted = true) private val roomMember = aRoomMember(userId = A_USER_ID, avatarUrl = AN_AVATAR_URL, displayName = A_USER_NAME) - private val summaryEvent = ReactionSummaryEvents.ShowReactionSummary(AN_EVENT_ID, listOf(aggregatedReaction), aggregatedReaction.key) + private val summaryEvent = ReactionSummaryEvent.ShowReactionSummary(AN_EVENT_ID, listOf(aggregatedReaction), aggregatedReaction.key) private val room = FakeBaseRoom().apply { givenRoomMembersState(RoomMembersState.Ready(persistentListOf(roomMember))) } @@ -49,7 +49,7 @@ class ReactionSummaryPresenterTest { initialState.eventSink(summaryEvent) assertThat(awaitItem().target).isNotNull() - initialState.eventSink(ReactionSummaryEvents.Clear) + initialState.eventSink(ReactionSummaryEvent.Clear) assertThat(awaitItem().target).isNull() } }