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:
Jorge Martin Espinosa 2025-10-07 12:02:54 +02:00 committed by GitHub
parent a497703a90
commit 9714abe032
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 684 additions and 17 deletions

View file

@ -36,4 +36,10 @@ interface Feature {
* If true: the feature is finished, it will not appear in the developer options screen.
*/
val isFinished: Boolean
/**
* Whether the feature is only available in Labs (and not in developer options).
* Feature flags that set this to `true` can be enabled by any users, not only those that have enabled developer mode.
*/
val isInLabs: Boolean
}

View file

@ -33,4 +33,9 @@ interface FeatureFlagService {
* is registered
*/
suspend fun setFeatureEnabled(feature: Feature, enabled: Boolean): Boolean
/**
* @return the list of available (not finished) features that can be toggled.
*/
fun getAvailableFeatures(): List<Feature>
}

View file

@ -19,6 +19,7 @@ enum class FeatureFlags(
override val description: String? = null,
override val defaultValue: (BuildMeta) -> Boolean,
override val isFinished: Boolean,
override val isInLabs: Boolean = false,
) : Feature {
RoomDirectorySearch(
key = "feature.roomdirectorysearch",
@ -98,6 +99,7 @@ enum class FeatureFlags(
description = "Renders thread messages as a dedicated timeline. Restarting the app is required for this setting to fully take effect.",
defaultValue = { false },
isFinished = false,
isInLabs = true,
),
MultiAccount(
key = "feature.multi_account",