Skip to content

Commit

Permalink
Merge pull request #12246 from woocommerce/issue/12245-remove-feature…
Browse files Browse the repository at this point in the history
…-flag

Remove feature flag product creation with AI V2 - M3
  • Loading branch information
hichamboushaba authored Aug 7, 2024
2 parents 069fb4b + b251b3a commit 325005d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ import com.woocommerce.android.ui.products.ai.components.ImageAction
import com.woocommerce.android.ui.products.ai.components.SelectImageSection
import com.woocommerce.android.ui.products.ai.productinfo.AiProductPromptViewModel.AiProductPromptState
import com.woocommerce.android.ui.products.ai.productinfo.AiProductPromptViewModel.PromptSuggestionBar
import com.woocommerce.android.util.FeatureFlag
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.wordpress.android.mediapicker.api.MediaPickerSetup.DataSource
Expand Down Expand Up @@ -340,21 +339,16 @@ private fun ProductPromptTextField(
modifier = Modifier
.onFocusChanged { focusState ->
isFocused = focusState.isFocused
if (isFocused && FeatureFlag.PRODUCT_CREATION_WITH_AI_V2_M3.isEnabled()) {
coroutineScope.launch {
@Suppress("MagicNumber")
delay(200) // Delay to ensure advice box is shown before scrolling.
scrollState.animateScrollTo(scrollToPosition.roundToInt())
}
coroutineScope.launch {
@Suppress("MagicNumber")
delay(200) // Delay to ensure advice box is shown before scrolling.
scrollState.animateScrollTo(scrollToPosition.roundToInt())
}
}
)
}
}
AnimatedVisibility(
(isFocused || state.productPrompt.isNotEmpty()) &&
FeatureFlag.PRODUCT_CREATION_WITH_AI_V2_M3.isEnabled()
) {
AnimatedVisibility((isFocused || state.productPrompt.isNotEmpty())) {
PromptSuggestions(
promptSuggestionBarState = state.promptSuggestionBarState,
modifier = Modifier.padding(top = 8.dp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ enum class FeatureFlag {
GOOGLE_ADS_M1,
GOOGLE_ADS_ANALYTICS_HUB_M1,
PRODUCT_CREATION_WITH_AI_V2,
PRODUCT_CREATION_WITH_AI_V2_M3,
SHOW_INBOX_CTA;

fun isEnabled(context: Context? = null): Boolean {
Expand All @@ -39,7 +38,6 @@ enum class FeatureFlag {
INBOX,
GOOGLE_ADS_ANALYTICS_HUB_M1,
SHOW_INBOX_CTA,
PRODUCT_CREATION_WITH_AI_V2_M3,
GOOGLE_ADS_M1 -> true
}
}
Expand Down

0 comments on commit 325005d

Please sign in to comment.