Skip to content

Commit

Permalink
wrap experimental code in conditional to avoid pushing it to users
Browse files Browse the repository at this point in the history
constantly uncommenting it and then commenting it out was annoying and
error-prone
  • Loading branch information
Arian04 committed Dec 20, 2024
1 parent b2493f6 commit 345134f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import me.arianb.usb_hid_client.ui.theme.codeLineHeightScaleFactor
import me.arianb.usb_hid_client.ui.theme.codeStyle
import me.arianb.usb_hid_client.ui.utils.BasicPage
import me.arianb.usb_hid_client.ui.utils.DarkLightModePreviews
import me.arianb.usb_hid_client.ui.utils.Experimental
import me.arianb.usb_hid_client.ui.utils.LabeledCategory
import me.arianb.usb_hid_client.ui.utils.SimpleNavTopBar
import timber.log.Timber
Expand All @@ -66,11 +67,12 @@ fun TroubleshootingPage() {
// - [x] create gadget
// - [x] remove gadget
// - [ ] re-create gadget
//
// TODO: re-enable once this is ready for production
// LabeledCategory("Gadget Actions") {
// GadgetActionButtons()
// }
// TODO: remove Experimental{} once this is ready for production
Experimental {
LabeledCategory("Gadget Actions") {
GadgetActionButtons()
}
}

LabeledCategory("Debugging Information") {
DebuggingInfoList()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package me.arianb.usb_hid_client.ui.utils

import androidx.compose.runtime.Composable
import me.arianb.usb_hid_client.BuildConfig

@Composable
fun Experimental(
content: @Composable () -> Unit
) {
// TODO: add/implement user setting, maybe add red tint or something to differentiate experimental stuff
if (BuildConfig.DEBUG) {
content()
}
}

0 comments on commit 345134f

Please sign in to comment.