Remove RoomDirectorySearch feature flag — always enable the feature (#6736)

* Remove RoomDirectorySearch feature flag, always enable the feature

Co-authored-by: stefanceriu <637564+stefanceriu@users.noreply.github.com>

* Apply ktlint formatting

Co-authored-by: jmartinesp <480955+jmartinesp@users.noreply.github.com>

* Update screenshots

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stefanceriu <637564+stefanceriu@users.noreply.github.com>
Co-authored-by: jmartinesp <480955+jmartinesp@users.noreply.github.com>
Co-authored-by: ElementBot <android@element.io>
This commit is contained in:
Copilot 2026-05-06 16:05:19 +02:00 committed by GitHub
parent 9b91fabbd6
commit 6ef9315468
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 18 additions and 100 deletions

View file

@ -10,8 +10,6 @@ package io.element.android.features.startchat.impl.root
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
@ -24,8 +22,6 @@ import io.element.android.features.startchat.impl.userlist.UserListPresenterArgs
import io.element.android.libraries.architecture.AsyncAction
import io.element.android.libraries.architecture.Presenter
import io.element.android.libraries.core.meta.BuildMeta
import io.element.android.libraries.featureflag.api.FeatureFlagService
import io.element.android.libraries.featureflag.api.FeatureFlags
import io.element.android.libraries.matrix.api.core.RoomId
import io.element.android.libraries.usersearch.api.UserRepository
import kotlinx.coroutines.launch
@ -37,7 +33,6 @@ class StartChatPresenter(
userListDataStore: UserListDataStore,
private val startDMAction: StartDMAction,
private val buildMeta: BuildMeta,
private val featureFlagService: FeatureFlagService,
) : Presenter<StartChatState> {
private val presenter = presenterFactory.create(
UserListPresenterArgs(
@ -54,10 +49,6 @@ class StartChatPresenter(
val localCoroutineScope = rememberCoroutineScope()
val startDmActionState: MutableState<AsyncAction<RoomId>> = remember { mutableStateOf(AsyncAction.Uninitialized) }
val isRoomDirectorySearchEnabled by remember {
featureFlagService.isFeatureEnabledFlow(FeatureFlags.RoomDirectorySearch)
}.collectAsState(initial = false)
fun handleEvent(event: StartChatEvents) {
when (event) {
is StartChatEvents.StartDM -> localCoroutineScope.launch {
@ -75,7 +66,6 @@ class StartChatPresenter(
applicationName = buildMeta.applicationName,
userListState = userListState,
startDmAction = startDmActionState.value,
isRoomDirectorySearchEnabled = isRoomDirectorySearchEnabled,
eventSink = ::handleEvent,
)
}

View file

@ -16,6 +16,5 @@ data class StartChatState(
val applicationName: String,
val userListState: UserListState,
val startDmAction: AsyncAction<RoomId>,
val isRoomDirectorySearchEnabled: Boolean,
val eventSink: (StartChatEvents) -> Unit,
)

View file

@ -55,9 +55,6 @@ open class StartChatStateProvider : PreviewParameterProvider<StartChatState> {
aCreateRoomRootState(
startDmAction = aConfirmingStartDmWithMatrixUser()
),
aCreateRoomRootState(
isRoomDirectorySearchEnabled = true,
),
)
}
@ -75,12 +72,10 @@ fun aCreateRoomRootState(
applicationName: String = "Element X Preview",
userListState: UserListState = aUserListState(),
startDmAction: AsyncAction<RoomId> = AsyncAction.Uninitialized,
isRoomDirectorySearchEnabled: Boolean = false,
eventSink: (StartChatEvents) -> Unit = {},
) = StartChatState(
applicationName = applicationName,
userListState = userListState,
startDmAction = startDmAction,
isRoomDirectorySearchEnabled = isRoomDirectorySearchEnabled,
eventSink = eventSink,
)

View file

@ -176,14 +176,12 @@ private fun CreateRoomActionButtonsList(
onClick = onNewRoomClick,
)
}
if (state.isRoomDirectorySearchEnabled) {
item {
CreateRoomActionButton(
iconRes = CompoundDrawables.ic_compound_list_bulleted,
text = stringResource(id = R.string.screen_room_directory_search_title),
onClick = onRoomDirectorySearchClick,
)
}
item {
CreateRoomActionButton(
iconRes = CompoundDrawables.ic_compound_list_bulleted,
text = stringResource(id = R.string.screen_room_directory_search_title),
onClick = onRoomDirectorySearchClick,
)
}
item {
CreateRoomActionButton(