Repository: thunderbird/thunderbird-android (language: kotlin)

Issue:
Dropdown Drawer - add feature flag to hoist ui changes
Further drawer UI changes should be done on a new module and guarded by a feature flag.

Update: no need to create a new module, the changes could be guarded by a feature flag inside the module.


Discussion hints:
nan

Pull request: feat(drawer): add feature flag for drawer dropdown ui
Enabled for `debug` and `daily`, disabled for `beta` and `release`.

Moves shared code to a dedicated class.

Resolves #9188 

Test command: ./gradlew :feature:navigation:drawer:dropdown:testDebugUnitTest --tests "net.thunderbird.feature.navigation.drawer.dropdown.ui.DrawerViewKtTest"

Fix patch:
diff --git a/app-k9mail/src/debug/kotlin/app/k9mail/featureflag/K9FeatureFlagFactory.kt b/app-k9mail/src/debug/kotlin/app/k9mail/featureflag/K9FeatureFlagFactory.kt
index 00fe9f58f7a..c7d99ec832e 100644
--- a/app-k9mail/src/debug/kotlin/app/k9mail/featureflag/K9FeatureFlagFactory.kt
+++ b/app-k9mail/src/debug/kotlin/app/k9mail/featureflag/K9FeatureFlagFactory.kt
@@ -12,6 +12,7 @@ class K9FeatureFlagFactory : FeatureFlagFactory {
             FeatureFlag("disable_font_size_config".toFeatureFlagKey(), enabled = true),
             FeatureFlag("email_notification_default".toFeatureFlagKey(), enabled = true),
             FeatureFlag("enable_dropdown_drawer".toFeatureFlagKey(), enabled = true),
+            FeatureFlag("enable_dropdown_drawer_ui".toFeatureFlagKey(), enabled = true),
         )
     }
 }
diff --git a/app-k9mail/src/release/kotlin/app/k9mail/featureflag/K9FeatureFlagFactory.kt b/app-k9mail/src/release/kotlin/app/k9mail/featureflag/K9FeatureFlagFactory.kt
index 9a8c47673b7..645b9764142 100644
--- a/app-k9mail/src/release/kotlin/app/k9mail/featureflag/K9FeatureFlagFactory.kt
+++ b/app-k9mail/src/release/kotlin/app/k9mail/featureflag/K9FeatureFlagFactory.kt
@@ -12,6 +12,7 @@ class K9FeatureFlagFactory : FeatureFlagFactory {
             FeatureFlag("disable_font_size_config".toFeatureFlagKey(), enabled = false),
             FeatureFlag("email_notification_default".toFeatureFlagKey(), enabled = false),
             FeatureFlag("enable_dropdown_drawer".toFeatureFlagKey(), enabled = false),
+            FeatureFlag("enable_dropdown_drawer_ui".toFeatureFlagKey(), enabled = false),
         )
     }
 }
diff --git a/app-thunderbird/src/beta/kotlin/net/thunderbird/android/featureflag/TbFeatureFlagFactory.kt b/app-thunderbird/src/beta/kotlin/net/thunderbird/android/featureflag/TbFeatureFlagFactory.kt
index 8d9d37a180b..3ac7c4ed113 100644
--- a/app-thunderbird/src/beta/kotlin/net/thunderbird/android/featureflag/TbFeatureFlagFactory.kt
+++ b/app-thunderbird/src/beta/kotlin/net/thunderbird/android/featureflag/TbFeatureFlagFactory.kt
@@ -15,6 +15,7 @@ class TbFeatureFlagFactory : FeatureFlagFactory {
             FeatureFlag("disable_font_size_config".toFeatureFlagKey(), enabled = true),
             FeatureFlag("email_notification_default".toFeatureFlagKey(), enabled = true),
             FeatureFlag("enable_dropdown_drawer".toFeatureFlagKey(), enabled = true),
+            FeatureFlag("enable_dropdown_drawer_ui".toFeatureFlagKey(), enabled = false),
         )
     }
 }
diff --git a/app-thunderbird/src/daily/kotlin/net/thunderbird/android/featureflag/TbFeatureFlagFactory.kt b/app-thunderbird/src/daily/kotlin/net/thunderbird/android/featureflag/TbFeatureFlagFactory.kt
index f648fd51604..692add1003e 100644
--- a/app-thunderbird/src/daily/kotlin/net/thunderbird/android/featureflag/TbFeatureFlagFactory.kt
+++ b/app-thunderbird/src/daily/kotlin/net/thunderbird/android/featureflag/TbFeatureFlagFactory.kt
@@ -15,6 +15,7 @@ class TbFeatureFlagFactory : FeatureFlagFactory {
             FeatureFlag("disable_font_size_config".toFeatureFlagKey(), enabled = true),
             FeatureFlag("email_notification_default".toFeatureFlagKey(), enabled = true),
             FeatureFlag("enable_dropdown_drawer".toFeatureFlagKey(), enabled = true),
+            FeatureFlag("enable_dropdown_drawer_ui".toFeatureFlagKey(), enabled = true),
         )
     }
 }
diff --git a/app-thunderbird/src/debug/kotlin/net/thunderbird/android/featureflag/TbFeatureFlagFactory.kt b/app-thunderbird/src/debug/kotlin/net/thunderbird/android/featureflag/TbFeatureFlagFactory.kt
index 4bd162712e8..1521fdf83ef 100644
--- a/app-thunderbird/src/debug/kotlin/net/thunderbird/android/featureflag/TbFeatureFlagFactory.kt
+++ b/app-thunderbird/src/debug/kotlin/net/thunderbird/android/featureflag/TbFeatureFlagFactory.kt
@@ -15,6 +15,7 @@ class TbFeatureFlagFactory : FeatureFlagFactory {
             FeatureFlag("disable_font_size_config".toFeatureFlagKey(), enabled = true),
             FeatureFlag("email_notification_default".toFeatureFlagKey(), enabled = true),
             FeatureFlag("enable_dropdown_drawer".toFeatureFlagKey(), enabled = true),
+            FeatureFlag("enable_dropdown_drawer_ui".toFeatureFlagKey(), enabled = true),
         )
     }
 }
diff --git a/app-thunderbird/src/release/kotlin/net/thunderbird/android/featureflag/TbFeatureFlagFactory.kt b/app-thunderbird/src/release/kotlin/net/thunderbird/android/featureflag/TbFeatureFlagFactory.kt
index f34f32cd962..79b280a9bac 100644
--- a/app-thunderbird/src/release/kotlin/net/thunderbird/android/featureflag/TbFeatureFlagFactory.kt
+++ b/app-thunderbird/src/release/kotlin/net/thunderbird/android/featureflag/TbFeatureFlagFactory.kt
@@ -15,6 +15,7 @@ class TbFeatureFlagFactory : FeatureFlagFactory {
             FeatureFlag("disable_font_size_config".toFeatureFlagKey(), enabled = false),
             FeatureFlag("email_notification_default".toFeatureFlagKey(), enabled = false),
             FeatureFlag("enable_dropdown_drawer".toFeatureFlagKey(), enabled = false),
+            FeatureFlag("enable_dropdown_drawer_ui".toFeatureFlagKey(), enabled = false),
         )
     }
 }
diff --git a/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/DropDownDrawer.kt b/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/DropDownDrawer.kt
index 27747178a8f..d68cf3781c4 100644
--- a/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/DropDownDrawer.kt
+++ b/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/DropDownDrawer.kt
@@ -7,6 +7,7 @@ import androidx.drawerlayout.widget.DrawerLayout
 import androidx.lifecycle.compose.collectAsStateWithLifecycle
 import kotlinx.coroutines.flow.MutableStateFlow
 import kotlinx.coroutines.flow.update
+import net.thunderbird.core.featureflag.FeatureFlagProvider
 import net.thunderbird.core.ui.theme.api.FeatureThemeProvider
 import net.thunderbird.feature.navigation.drawer.api.NavigationDrawer
 import net.thunderbird.feature.navigation.drawer.api.R
@@ -32,6 +33,7 @@ class DropDownDrawer(
 ) : NavigationDrawer, KoinComponent {
 
     private val themeProvider: FeatureThemeProvider by inject()
+    private val featureFlagProvider: FeatureFlagProvider by inject()
 
     private val drawer: DrawerLayout = parent.findViewById(R.id.navigation_drawer_layout)
     private val drawerContent: ComposeView = parent.findViewById(R.id.navigation_drawer_content)
@@ -52,6 +54,7 @@ class DropDownDrawer(
                     openUnifiedFolder = openUnifiedFolder,
                     openManageFolders = openManageFolders,
                     openSettings = openSettings,
+                    featureFlagProvider = featureFlagProvider,
                     closeDrawer = { close() },
                 )
             }
diff --git a/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/DrawerContent.kt b/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/DrawerContent.kt
index 95c6cb886b9..a27ce49850d 100644
--- a/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/DrawerContent.kt
+++ b/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/DrawerContent.kt
@@ -4,7 +4,6 @@ import androidx.compose.animation.AnimatedVisibility
 import androidx.compose.foundation.layout.Column
 import androidx.compose.foundation.layout.Row
 import androidx.compose.foundation.layout.WindowInsets
-import androidx.compose.foundation.layout.displayCutout
 import androidx.compose.foundation.layout.fillMaxHeight
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.statusBars
@@ -12,25 +11,18 @@ import androidx.compose.foundation.layout.width
 import androidx.compose.foundation.layout.windowInsetsPadding
 import androidx.compose.runtime.Composable
 import androidx.compose.ui.Modifier
-import androidx.compose.ui.platform.LocalDensity
-import androidx.compose.ui.platform.LocalLayoutDirection
 import androidx.compose.ui.platform.testTag
-import androidx.compose.ui.unit.Dp
-import androidx.compose.ui.unit.LayoutDirection
-import androidx.compose.ui.unit.dp
 import app.k9mail.core.ui.compose.designsystem.atom.DividerHorizontal
 import app.k9mail.core.ui.compose.designsystem.atom.Surface
 import net.thunderbird.feature.navigation.drawer.dropdown.ui.DrawerContract.Event
 import net.thunderbird.feature.navigation.drawer.dropdown.ui.DrawerContract.State
 import net.thunderbird.feature.navigation.drawer.dropdown.ui.account.AccountList
 import net.thunderbird.feature.navigation.drawer.dropdown.ui.account.AccountView
+import net.thunderbird.feature.navigation.drawer.dropdown.ui.common.DRAWER_WIDTH
+import net.thunderbird.feature.navigation.drawer.dropdown.ui.common.getAdditionalWidth
 import net.thunderbird.feature.navigation.drawer.dropdown.ui.folder.FolderList
 import net.thunderbird.feature.navigation.drawer.dropdown.ui.setting.SettingList
 
-// As long as we use DrawerLayout, we don't have to worry about screens narrower than DRAWER_WIDTH. DrawerLayout will
-// automatically limit the width of the content view so there's still room for a scrim with minimum tap width.
-private val DRAWER_WIDTH = 360.dp
-
 @Composable
 internal fun DrawerContent(
     state: State,
@@ -94,19 +86,3 @@ internal fun DrawerContent(
         }
     }
 }
-
-@Composable
-fun getAdditionalWidth(): Dp {
-    val density = LocalDensity.current
-    val layoutDirection = LocalLayoutDirection.current
-    val isRtl = LocalLayoutDirection.current == LayoutDirection.Rtl
-
-    return if (isRtl) {
-        WindowInsets.displayCutout.getRight(density = density, layoutDirection = layoutDirection)
-    } else {
-        WindowInsets.displayCutout.getLeft(density = density, layoutDirection = layoutDirection)
-    }.pxToDp()
-}
-
-@Composable
-fun Int.pxToDp() = with(LocalDensity.current) { this@pxToDp.toDp() }
diff --git a/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/DrawerView.kt b/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/DrawerView.kt
index c96220207cf..913dd8c6059 100644
--- a/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/DrawerView.kt
+++ b/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/DrawerView.kt
@@ -2,14 +2,19 @@ package net.thunderbird.feature.navigation.drawer.dropdown.ui
 
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.remember
 import app.k9mail.core.ui.compose.common.mvi.observe
 import app.k9mail.core.ui.compose.designsystem.molecule.PullToRefreshBox
+import net.thunderbird.core.featureflag.FeatureFlagKey
+import net.thunderbird.core.featureflag.FeatureFlagProvider
+import net.thunderbird.core.featureflag.FeatureFlagResult
 import net.thunderbird.feature.navigation.drawer.dropdown.FolderDrawerState
 import net.thunderbird.feature.navigation.drawer.dropdown.ui.DrawerContract.Effect
 import net.thunderbird.feature.navigation.drawer.dropdown.ui.DrawerContract.Event
 import net.thunderbird.feature.navigation.drawer.dropdown.ui.DrawerContract.ViewModel
 import org.koin.androidx.compose.koinViewModel
 
+@Suppress("LongParameterList")
 @Composable
 internal fun DrawerView(
     drawerState: FolderDrawerState,
@@ -19,6 +24,7 @@ internal fun DrawerView(
     openManageFolders: () -> Unit,
     openSettings: () -> Unit,
     closeDrawer: () -> Unit,
+    featureFlagProvider: FeatureFlagProvider,
     viewModel: ViewModel = koinViewModel<DrawerViewModel>(),
 ) {
     val (state, dispatch) = viewModel.observe { effect ->
@@ -28,6 +34,7 @@ internal fun DrawerView(
                 effect.accountId,
                 effect.folderId,
             )
+
             Effect.OpenUnifiedFolder -> openUnifiedFolder()
             is Effect.OpenManageFolders -> openManageFolders()
             is Effect.OpenSettings -> openSettings()
@@ -35,6 +42,10 @@ internal fun DrawerView(
         }
     }
 
+    val isDropdownDrawerEnabled = remember {
+        featureFlagProvider.provide(FeatureFlagKey("enable_dropdown_drawer_ui")) == FeatureFlagResult.Enabled
+    }
+
     LaunchedEffect(drawerState.selectedAccountUuid) {
         dispatch(Event.SelectAccount(drawerState.selectedAccountUuid))
     }
@@ -47,9 +58,16 @@ internal fun DrawerView(
         isRefreshing = state.value.isLoading,
         onRefresh = { dispatch(Event.OnSyncAccount) },
     ) {
-        DrawerContent(
-            state = state.value,
-            onEvent = { dispatch(it) },
-        )
+        if (isDropdownDrawerEnabled) {
+            DrawerContent(
+                state = state.value,
+                onEvent = { dispatch(it) },
+            )
+        } else {
+            SideRailDrawerContent(
+                state = state.value,
+                onEvent = { dispatch(it) },
+            )
+        }
     }
 }
diff --git a/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/SideRailDrawerContent.kt b/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/SideRailDrawerContent.kt
new file mode 100644
index 00000000000..a2cb7c35b14
--- /dev/null
+++ b/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/SideRailDrawerContent.kt
@@ -0,0 +1,88 @@
+package net.thunderbird.feature.navigation.drawer.dropdown.ui
+
+import androidx.compose.animation.AnimatedVisibility
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.WindowInsets
+import androidx.compose.foundation.layout.fillMaxHeight
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.statusBars
+import androidx.compose.foundation.layout.width
+import androidx.compose.foundation.layout.windowInsetsPadding
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.platform.testTag
+import app.k9mail.core.ui.compose.designsystem.atom.DividerHorizontal
+import app.k9mail.core.ui.compose.designsystem.atom.Surface
+import net.thunderbird.feature.navigation.drawer.dropdown.ui.DrawerContract.Event
+import net.thunderbird.feature.navigation.drawer.dropdown.ui.DrawerContract.State
+import net.thunderbird.feature.navigation.drawer.dropdown.ui.account.AccountList
+import net.thunderbird.feature.navigation.drawer.dropdown.ui.account.AccountView
+import net.thunderbird.feature.navigation.drawer.dropdown.ui.common.DRAWER_WIDTH
+import net.thunderbird.feature.navigation.drawer.dropdown.ui.common.getAdditionalWidth
+import net.thunderbird.feature.navigation.drawer.dropdown.ui.folder.FolderList
+import net.thunderbird.feature.navigation.drawer.dropdown.ui.setting.SettingList
+
+@Composable
+internal fun SideRailDrawerContent(
+    state: State,
+    onEvent: (Event) -> Unit,
+    modifier: Modifier = Modifier,
+) {
+    val additionalWidth = getAdditionalWidth()
+
+    Surface(
+        modifier = modifier
+            .windowInsetsPadding(WindowInsets.statusBars)
+            .width(DRAWER_WIDTH + additionalWidth)
+            .fillMaxHeight()
+            .testTag("DrawerContent"),
+    ) {
+        val selectedAccount = state.accounts.firstOrNull { it.id == state.selectedAccountId }
+        Column {
+            selectedAccount?.let {
+                AccountView(
+                    account = selectedAccount,
+                    onClick = { onEvent(Event.OnAccountViewClick(selectedAccount)) },
+                    showAvatar = state.config.showAccountSelector,
+                )
+
+                DividerHorizontal()
+            }
+            Row {
+                AnimatedVisibility(
+                    visible = state.config.showAccountSelector,
+                ) {
+                    AccountList(
+                        accounts = state.accounts,
+                        selectedAccount = selectedAccount,
+                        onAccountClick = { onEvent(Event.OnAccountClick(it)) },
+                        onSyncAllAccountsClick = { onEvent(Event.OnSyncAllAccounts) },
+                        onSettingsClick = { onEvent(Event.OnSettingsClick) },
+                    )
+                }
+                Column(
+                    modifier = Modifier
+                        .weight(1f)
+                        .fillMaxSize(),
+                ) {
+                    FolderList(
+                        rootFolder = state.rootFolder,
+                        selectedFolder = state.folders.firstOrNull { it.id == state.selectedFolderId },
+                        onFolderClick = { folder ->
+                            onEvent(Event.OnFolderClick(folder))
+                        },
+                        showStarredCount = state.config.showStarredCount,
+                        modifier = Modifier.weight(1f),
+                    )
+                    DividerHorizontal()
+                    SettingList(
+                        onAccountSelectorClick = { onEvent(Event.OnAccountSelectorClick) },
+                        onManageFoldersClick = { onEvent(Event.OnManageFoldersClick) },
+                        showAccountSelector = state.config.showAccountSelector,
+                    )
+                }
+            }
+        }
+    }
+}
diff --git a/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/common/DrawerUtil.kt b/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/common/DrawerUtil.kt
new file mode 100644
index 00000000000..daf662e07e4
--- /dev/null
+++ b/feature/navigation/drawer/dropdown/src/main/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/common/DrawerUtil.kt
@@ -0,0 +1,30 @@
+package net.thunderbird.feature.navigation.drawer.dropdown.ui.common
+
+import androidx.compose.foundation.layout.WindowInsets
+import androidx.compose.foundation.layout.displayCutout
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.platform.LocalDensity
+import androidx.compose.ui.platform.LocalLayoutDirection
+import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.LayoutDirection
+import androidx.compose.ui.unit.dp
+
+// As long as we use DrawerLayout, we don't have to worry about screens narrower than DRAWER_WIDTH. DrawerLayout will
+// automatically limit the width of the content view so there's still room for a scrim with minimum tap width.
+internal val DRAWER_WIDTH = 360.dp
+
+@Composable
+internal fun getAdditionalWidth(): Dp {
+    val density = LocalDensity.current
+    val layoutDirection = LocalLayoutDirection.current
+    val isRtl = LocalLayoutDirection.current == LayoutDirection.Rtl
+
+    return if (isRtl) {
+        WindowInsets.displayCutout.getRight(density = density, layoutDirection = layoutDirection)
+    } else {
+        WindowInsets.displayCutout.getLeft(density = density, layoutDirection = layoutDirection)
+    }.pxToDp()
+}
+
+@Composable
+private fun Int.pxToDp() = with(LocalDensity.current) { this@pxToDp.toDp() }


Test patch:
diff --git a/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/DrawerViewKtTest.kt b/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/DrawerViewKtTest.kt
index ec9150c67d1..2f31ce54a99 100644
--- a/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/DrawerViewKtTest.kt
+++ b/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/DrawerViewKtTest.kt
@@ -35,6 +35,7 @@ internal class DrawerViewKtTest : ComposeTest() {
                 openManageFolders = { counter.openManageFoldersCount++ },
                 openSettings = { counter.openSettingsCount++ },
                 closeDrawer = { counter.closeDrawerCount++ },
+                featureFlagProvider = FakeFeatureFlagProvider(isEnabled = true),
                 viewModel = viewModel,
             )
         }
@@ -85,6 +86,7 @@ internal class DrawerViewKtTest : ComposeTest() {
                 openManageFolders = { },
                 openSettings = { },
                 closeDrawer = { },
+                featureFlagProvider = FakeFeatureFlagProvider(isEnabled = true),
                 viewModel = viewModel,
             )
         }
@@ -122,6 +124,7 @@ internal class DrawerViewKtTest : ComposeTest() {
                 openManageFolders = {},
                 openSettings = {},
                 closeDrawer = {},
+                featureFlagProvider = FakeFeatureFlagProvider(isEnabled = true),
                 viewModel = viewModel,
             )
         }
diff --git a/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/FakeFeatureFlagProvider.kt b/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/FakeFeatureFlagProvider.kt
new file mode 100644
index 00000000000..258fe4da616
--- /dev/null
+++ b/feature/navigation/drawer/dropdown/src/test/kotlin/net/thunderbird/feature/navigation/drawer/dropdown/ui/FakeFeatureFlagProvider.kt
@@ -0,0 +1,17 @@
+package net.thunderbird.feature.navigation.drawer.dropdown.ui
+
+import net.thunderbird.core.featureflag.FeatureFlagKey
+import net.thunderbird.core.featureflag.FeatureFlagProvider
+import net.thunderbird.core.featureflag.FeatureFlagResult
+
+class FakeFeatureFlagProvider(
+    private val isEnabled: Boolean = false,
+) : FeatureFlagProvider {
+    override fun provide(key: FeatureFlagKey): FeatureFlagResult {
+        return if (isEnabled) {
+            FeatureFlagResult.Enabled
+        } else {
+            FeatureFlagResult.Disabled
+        }
+    }
+}