From 8943c4e72418a561503971c0c1cf0e06377c8e67 Mon Sep 17 00:00:00 2001 From: hayaksi1 <193020925+hayaksi1@users.noreply.github.com> Date: Sun, 9 Aug 2026 14:46:13 +0300 Subject: [PATCH] Drop the comments from the filter selection guard Review feedback: the guard and the test name already say what the check is for, so the narration was redundant. --- .../impl/filters/selection/DefaultFilterSelectionStrategy.kt | 4 ---- .../home/impl/filters/RoomListFiltersPresenterTest.kt | 2 -- 2 files changed, 6 deletions(-) diff --git a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/filters/selection/DefaultFilterSelectionStrategy.kt b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/filters/selection/DefaultFilterSelectionStrategy.kt index 4121ff9ab4..9b5951ae3d 100644 --- a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/filters/selection/DefaultFilterSelectionStrategy.kt +++ b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/filters/selection/DefaultFilterSelectionStrategy.kt @@ -22,10 +22,6 @@ class DefaultFilterSelectionStrategy : FilterSelectionStrategy { override val filterSelectionStates = MutableStateFlow(buildFilters()) override fun select(filter: RoomListFilter) { - // Incompatible filters are hidden from the UI rather than disabled, so a filter can still be - // selected while its chip is on its way out, typically when two chips are tapped in the same - // frame. Ignore it, the currently applied filters win. - // See https://github.com/element-hq/element-x-android/issues/5383 if (selectedFilters.any { it in filter.incompatibleFilters }) return selectedFilters.add(filter) filterSelectionStates.value = buildFilters() diff --git a/features/home/impl/src/test/kotlin/io/element/android/features/home/impl/filters/RoomListFiltersPresenterTest.kt b/features/home/impl/src/test/kotlin/io/element/android/features/home/impl/filters/RoomListFiltersPresenterTest.kt index ae1d7b5083..02d947613f 100644 --- a/features/home/impl/src/test/kotlin/io/element/android/features/home/impl/filters/RoomListFiltersPresenterTest.kt +++ b/features/home/impl/src/test/kotlin/io/element/android/features/home/impl/filters/RoomListFiltersPresenterTest.kt @@ -78,8 +78,6 @@ class RoomListFiltersPresenterTest { val presenter = createRoomListFiltersPresenter() presenter.test { awaitItem().let { state -> - // Both events are sent on the same state, i.e. before any recomposition, which is what - // happens when the two chips are tapped simultaneously. state.eventSink.invoke(RoomListFiltersEvent.ToggleFilter(RoomListFilter.Favourites)) state.eventSink.invoke(RoomListFiltersEvent.ToggleFilter(RoomListFilter.Invites)) }