mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Add Labs screen for beta testing of public features (#5465)
* Add Labs screen: - Make `Feature` have an `isInLabs` boolean to distinguish private feature flags from public ones. - Have `FeatureFlagsService` provide the list of available flags. - Display the labs item in the settings screen only if there are available public features. - Remove public feature toggles from developer options. - Implement the labs screen with the public features. - Add a clear cache step to the threads feature toggle - Update screenshots --------- Co-authored-by: ElementBot <android@element.io>
This commit is contained in:
committed by
GitHub
parent
a497703a90
commit
9714abe032
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2025 New Vector Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.libraries.featureflag.test
|
||||
|
||||
import io.element.android.libraries.core.meta.BuildMeta
|
||||
import io.element.android.libraries.featureflag.api.Feature
|
||||
|
||||
data class FakeFeature(
|
||||
override val key: String,
|
||||
override val title: String,
|
||||
override val description: String? = null,
|
||||
override val defaultValue: (BuildMeta) -> Boolean = { false },
|
||||
override val isFinished: Boolean = false,
|
||||
override val isInLabs: Boolean = false,
|
||||
) : Feature
|
||||
+5
@@ -17,6 +17,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
||||
class FakeFeatureFlagService(
|
||||
initialState: Map<String, Boolean> = emptyMap(),
|
||||
private val buildMeta: BuildMeta = aBuildMeta(),
|
||||
var providedAvailableFeatures: List<Feature> = emptyList(),
|
||||
) : FeatureFlagService {
|
||||
private val enabledFeatures = initialState
|
||||
.mapValues { MutableStateFlow(it.value) }
|
||||
@@ -31,4 +32,8 @@ class FakeFeatureFlagService(
|
||||
override fun isFeatureEnabledFlow(feature: Feature): Flow<Boolean> {
|
||||
return enabledFeatures.getOrPut(feature.key) { MutableStateFlow(feature.defaultValue(buildMeta)) }
|
||||
}
|
||||
|
||||
override fun getAvailableFeatures(): List<Feature> {
|
||||
return providedAvailableFeatures
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user