Remove FeatureFlag.MarkAsUnread
This commit is contained in:
parent
be4e52e6ec
commit
fe8009e6bf
6 changed files with 28 additions and 51 deletions
|
|
@ -101,36 +101,34 @@ private fun RoomListModalBottomSheetContent(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if (contextMenu.markAsUnreadFeatureFlagEnabled) {
|
if (contextMenu.hasNewContent) {
|
||||||
if (contextMenu.hasNewContent) {
|
ListItem(
|
||||||
ListItem(
|
headlineContent = {
|
||||||
headlineContent = {
|
Text(
|
||||||
Text(
|
text = stringResource(id = R.string.screen_roomlist_mark_as_read),
|
||||||
text = stringResource(id = R.string.screen_roomlist_mark_as_read),
|
style = MaterialTheme.typography.bodyLarge,
|
||||||
style = MaterialTheme.typography.bodyLarge,
|
)
|
||||||
)
|
},
|
||||||
},
|
onClick = onRoomMarkReadClick,
|
||||||
onClick = onRoomMarkReadClick,
|
leadingContent = ListItemContent.Icon(
|
||||||
leadingContent = ListItemContent.Icon(
|
iconSource = IconSource.Vector(CompoundIcons.MarkAsRead())
|
||||||
iconSource = IconSource.Vector(CompoundIcons.MarkAsRead())
|
),
|
||||||
),
|
style = ListItemStyle.Primary,
|
||||||
style = ListItemStyle.Primary,
|
)
|
||||||
)
|
} else {
|
||||||
} else {
|
ListItem(
|
||||||
ListItem(
|
headlineContent = {
|
||||||
headlineContent = {
|
Text(
|
||||||
Text(
|
text = stringResource(id = R.string.screen_roomlist_mark_as_unread),
|
||||||
text = stringResource(id = R.string.screen_roomlist_mark_as_unread),
|
style = MaterialTheme.typography.bodyLarge,
|
||||||
style = MaterialTheme.typography.bodyLarge,
|
)
|
||||||
)
|
},
|
||||||
},
|
onClick = onRoomMarkUnreadClick,
|
||||||
onClick = onRoomMarkUnreadClick,
|
leadingContent = ListItemContent.Icon(
|
||||||
leadingContent = ListItemContent.Icon(
|
iconSource = IconSource.Vector(CompoundIcons.MarkAsUnread())
|
||||||
iconSource = IconSource.Vector(CompoundIcons.MarkAsUnread())
|
),
|
||||||
),
|
style = ListItemStyle.Primary,
|
||||||
style = ListItemStyle.Primary,
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ListItem(
|
ListItem(
|
||||||
headlineContent = {
|
headlineContent = {
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,6 @@ import io.element.android.features.leaveroom.api.LeaveRoomState
|
||||||
import io.element.android.libraries.architecture.AsyncData
|
import io.element.android.libraries.architecture.AsyncData
|
||||||
import io.element.android.libraries.architecture.Presenter
|
import io.element.android.libraries.architecture.Presenter
|
||||||
import io.element.android.libraries.core.coroutine.mapState
|
import io.element.android.libraries.core.coroutine.mapState
|
||||||
import io.element.android.libraries.featureflag.api.FeatureFlagService
|
|
||||||
import io.element.android.libraries.featureflag.api.FeatureFlags
|
|
||||||
import io.element.android.libraries.fullscreenintent.api.FullScreenIntentPermissionsState
|
import io.element.android.libraries.fullscreenintent.api.FullScreenIntentPermissionsState
|
||||||
import io.element.android.libraries.matrix.api.MatrixClient
|
import io.element.android.libraries.matrix.api.MatrixClient
|
||||||
import io.element.android.libraries.matrix.api.core.RoomId
|
import io.element.android.libraries.matrix.api.core.RoomId
|
||||||
|
|
@ -74,7 +72,6 @@ class RoomListPresenter @Inject constructor(
|
||||||
private val client: MatrixClient,
|
private val client: MatrixClient,
|
||||||
private val leaveRoomPresenter: Presenter<LeaveRoomState>,
|
private val leaveRoomPresenter: Presenter<LeaveRoomState>,
|
||||||
private val roomListDataSource: RoomListDataSource,
|
private val roomListDataSource: RoomListDataSource,
|
||||||
private val featureFlagService: FeatureFlagService,
|
|
||||||
private val filtersPresenter: Presenter<RoomListFiltersState>,
|
private val filtersPresenter: Presenter<RoomListFiltersState>,
|
||||||
private val searchPresenter: Presenter<RoomListSearchState>,
|
private val searchPresenter: Presenter<RoomListSearchState>,
|
||||||
private val sessionPreferencesStore: SessionPreferencesStore,
|
private val sessionPreferencesStore: SessionPreferencesStore,
|
||||||
|
|
@ -244,7 +241,6 @@ class RoomListPresenter @Inject constructor(
|
||||||
roomName = event.roomSummary.name,
|
roomName = event.roomSummary.name,
|
||||||
isDm = event.roomSummary.isDm,
|
isDm = event.roomSummary.isDm,
|
||||||
isFavorite = event.roomSummary.isFavorite,
|
isFavorite = event.roomSummary.isFavorite,
|
||||||
markAsUnreadFeatureFlagEnabled = featureFlagService.isFeatureEnabled(FeatureFlags.MarkAsUnread),
|
|
||||||
hasNewContent = event.roomSummary.hasNewContent,
|
hasNewContent = event.roomSummary.hasNewContent,
|
||||||
displayClearRoomCacheAction = appPreferencesStore.isDeveloperModeEnabledFlow().first(),
|
displayClearRoomCacheAction = appPreferencesStore.isDeveloperModeEnabledFlow().first(),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@ data class RoomListState(
|
||||||
val roomName: String?,
|
val roomName: String?,
|
||||||
val isDm: Boolean,
|
val isDm: Boolean,
|
||||||
val isFavorite: Boolean,
|
val isFavorite: Boolean,
|
||||||
val markAsUnreadFeatureFlagEnabled: Boolean,
|
|
||||||
val hasNewContent: Boolean,
|
val hasNewContent: Boolean,
|
||||||
val displayClearRoomCacheAction: Boolean,
|
val displayClearRoomCacheAction: Boolean,
|
||||||
) : ContextMenu
|
) : ContextMenu
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ internal fun aContextMenuShown(
|
||||||
roomId = RoomId("!aRoom:aDomain"),
|
roomId = RoomId("!aRoom:aDomain"),
|
||||||
roomName = roomName,
|
roomName = roomName,
|
||||||
isDm = isDm,
|
isDm = isDm,
|
||||||
markAsUnreadFeatureFlagEnabled = true,
|
|
||||||
hasNewContent = hasNewContent,
|
hasNewContent = hasNewContent,
|
||||||
isFavorite = isFavorite,
|
isFavorite = isFavorite,
|
||||||
displayClearRoomCacheAction = false,
|
displayClearRoomCacheAction = false,
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,6 @@ import io.element.android.libraries.dateformatter.api.DateFormatter
|
||||||
import io.element.android.libraries.dateformatter.test.FakeDateFormatter
|
import io.element.android.libraries.dateformatter.test.FakeDateFormatter
|
||||||
import io.element.android.libraries.eventformatter.api.RoomLastMessageFormatter
|
import io.element.android.libraries.eventformatter.api.RoomLastMessageFormatter
|
||||||
import io.element.android.libraries.eventformatter.test.FakeRoomLastMessageFormatter
|
import io.element.android.libraries.eventformatter.test.FakeRoomLastMessageFormatter
|
||||||
import io.element.android.libraries.featureflag.api.FeatureFlagService
|
|
||||||
import io.element.android.libraries.featureflag.test.FakeFeatureFlagService
|
|
||||||
import io.element.android.libraries.fullscreenintent.api.aFullScreenIntentPermissionsState
|
import io.element.android.libraries.fullscreenintent.api.aFullScreenIntentPermissionsState
|
||||||
import io.element.android.libraries.matrix.api.MatrixClient
|
import io.element.android.libraries.matrix.api.MatrixClient
|
||||||
import io.element.android.libraries.matrix.api.core.RoomId
|
import io.element.android.libraries.matrix.api.core.RoomId
|
||||||
|
|
@ -217,7 +215,6 @@ class RoomListPresenterTest {
|
||||||
roomName = summary.name,
|
roomName = summary.name,
|
||||||
isDm = false,
|
isDm = false,
|
||||||
isFavorite = false,
|
isFavorite = false,
|
||||||
markAsUnreadFeatureFlagEnabled = true,
|
|
||||||
hasNewContent = false,
|
hasNewContent = false,
|
||||||
displayClearRoomCacheAction = false,
|
displayClearRoomCacheAction = false,
|
||||||
)
|
)
|
||||||
|
|
@ -235,7 +232,6 @@ class RoomListPresenterTest {
|
||||||
roomName = summary.name,
|
roomName = summary.name,
|
||||||
isDm = false,
|
isDm = false,
|
||||||
isFavorite = true,
|
isFavorite = true,
|
||||||
markAsUnreadFeatureFlagEnabled = true,
|
|
||||||
hasNewContent = false,
|
hasNewContent = false,
|
||||||
displayClearRoomCacheAction = false,
|
displayClearRoomCacheAction = false,
|
||||||
)
|
)
|
||||||
|
|
@ -263,7 +259,6 @@ class RoomListPresenterTest {
|
||||||
roomName = summary.name,
|
roomName = summary.name,
|
||||||
isDm = false,
|
isDm = false,
|
||||||
isFavorite = false,
|
isFavorite = false,
|
||||||
markAsUnreadFeatureFlagEnabled = true,
|
|
||||||
// true here.
|
// true here.
|
||||||
hasNewContent = false,
|
hasNewContent = false,
|
||||||
displayClearRoomCacheAction = true,
|
displayClearRoomCacheAction = true,
|
||||||
|
|
@ -295,7 +290,6 @@ class RoomListPresenterTest {
|
||||||
roomName = summary.name,
|
roomName = summary.name,
|
||||||
isDm = false,
|
isDm = false,
|
||||||
isFavorite = false,
|
isFavorite = false,
|
||||||
markAsUnreadFeatureFlagEnabled = true,
|
|
||||||
hasNewContent = false,
|
hasNewContent = false,
|
||||||
displayClearRoomCacheAction = false,
|
displayClearRoomCacheAction = false,
|
||||||
)
|
)
|
||||||
|
|
@ -604,7 +598,6 @@ class RoomListPresenterTest {
|
||||||
dateFormatter: DateFormatter = FakeDateFormatter(),
|
dateFormatter: DateFormatter = FakeDateFormatter(),
|
||||||
roomLastMessageFormatter: RoomLastMessageFormatter = FakeRoomLastMessageFormatter(),
|
roomLastMessageFormatter: RoomLastMessageFormatter = FakeRoomLastMessageFormatter(),
|
||||||
sessionPreferencesStore: SessionPreferencesStore = InMemorySessionPreferencesStore(),
|
sessionPreferencesStore: SessionPreferencesStore = InMemorySessionPreferencesStore(),
|
||||||
featureFlagService: FeatureFlagService = FakeFeatureFlagService(),
|
|
||||||
analyticsService: AnalyticsService = FakeAnalyticsService(),
|
analyticsService: AnalyticsService = FakeAnalyticsService(),
|
||||||
filtersPresenter: Presenter<RoomListFiltersState> = Presenter { aRoomListFiltersState() },
|
filtersPresenter: Presenter<RoomListFiltersState> = Presenter { aRoomListFiltersState() },
|
||||||
searchPresenter: Presenter<RoomListSearchState> = Presenter { aRoomListSearchState() },
|
searchPresenter: Presenter<RoomListSearchState> = Presenter { aRoomListSearchState() },
|
||||||
|
|
@ -626,7 +619,6 @@ class RoomListPresenterTest {
|
||||||
sessionCoroutineScope = backgroundScope,
|
sessionCoroutineScope = backgroundScope,
|
||||||
dateTimeObserver = FakeDateTimeObserver(),
|
dateTimeObserver = FakeDateTimeObserver(),
|
||||||
),
|
),
|
||||||
featureFlagService = featureFlagService,
|
|
||||||
searchPresenter = searchPresenter,
|
searchPresenter = searchPresenter,
|
||||||
sessionPreferencesStore = sessionPreferencesStore,
|
sessionPreferencesStore = sessionPreferencesStore,
|
||||||
filtersPresenter = filtersPresenter,
|
filtersPresenter = filtersPresenter,
|
||||||
|
|
|
||||||
|
|
@ -21,13 +21,6 @@ enum class FeatureFlags(
|
||||||
override val defaultValue: (BuildMeta) -> Boolean,
|
override val defaultValue: (BuildMeta) -> Boolean,
|
||||||
override val isFinished: Boolean,
|
override val isFinished: Boolean,
|
||||||
) : Feature {
|
) : Feature {
|
||||||
MarkAsUnread(
|
|
||||||
key = "feature.markAsUnread",
|
|
||||||
title = "Mark as unread",
|
|
||||||
description = "Allow user to mark a room as unread",
|
|
||||||
defaultValue = { true },
|
|
||||||
isFinished = false,
|
|
||||||
),
|
|
||||||
RoomDirectorySearch(
|
RoomDirectorySearch(
|
||||||
key = "feature.roomdirectorysearch",
|
key = "feature.roomdirectorysearch",
|
||||||
title = "Room directory search",
|
title = "Room directory search",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue