fix: remove compatible provider consumers

This commit is contained in:
2026-08-24 17:57:41 +08:00
parent 227120bc11
commit 8d5984fb36
5 changed files with 4 additions and 19 deletions
@@ -27,19 +27,15 @@ class ProviderSelectionScreenTest {
ProviderProfile(ProviderProfileId("local"), ProviderType.LOCAL_EXPERIENCE, "Local"), ProviderProfile(ProviderProfileId("local"), ProviderType.LOCAL_EXPERIENCE, "Local"),
Availability.Enabled, Availability.Enabled,
) )
val compatible = ProviderOption( val abox = ProviderOption(
ProviderProfile( ProviderProfile(ProviderProfileId("abox"), ProviderType.ABOX, "ABox"),
ProviderProfileId("compatible"),
ProviderType.COMPATIBLE_BACKEND,
"Compatible",
),
Availability.Disabled(UnavailableReason.PROTOCOL_PENDING), Availability.Disabled(UnavailableReason.PROTOCOL_PENDING),
) )
var selected: ProviderOption? = null var selected: ProviderOption? = null
composeRule.setContent { composeRule.setContent {
ABoxTheme { ABoxTheme {
ProviderSelectionScreen( ProviderSelectionScreen(
state = ProviderSelectionUiState(listOf(local, compatible)), state = ProviderSelectionUiState(listOf(local, abox)),
onSelect = { selected = it }, onSelect = { selected = it },
) )
} }
@@ -47,6 +43,6 @@ class ProviderSelectionScreenTest {
composeRule.onNodeWithText("Local experience").assertIsEnabled().performClick() composeRule.onNodeWithText("Local experience").assertIsEnabled().performClick()
assertEquals(local, selected) assertEquals(local, selected)
composeRule.onNodeWithText("Compatible backend").assertIsNotEnabled() composeRule.onNodeWithText("ABox").assertIsNotEnabled()
} }
} }
@@ -222,7 +222,6 @@ private fun LoginErrorMessage.stringResource(): Int = when (this) {
private fun providerName(type: ProviderType): String = stringResource( private fun providerName(type: ProviderType): String = stringResource(
when (type) { when (type) {
ProviderType.ABOX -> R.string.provider_abox_name ProviderType.ABOX -> R.string.provider_abox_name
ProviderType.COMPATIBLE_BACKEND -> R.string.provider_compatible_name
ProviderType.LOCAL_EXPERIENCE -> R.string.provider_local_name ProviderType.LOCAL_EXPERIENCE -> R.string.provider_local_name
}, },
) )
@@ -231,7 +230,6 @@ private fun providerName(type: ProviderType): String = stringResource(
private fun providerDescription(type: ProviderType): String = stringResource( private fun providerDescription(type: ProviderType): String = stringResource(
when (type) { when (type) {
ProviderType.ABOX -> R.string.provider_abox_description ProviderType.ABOX -> R.string.provider_abox_description
ProviderType.COMPATIBLE_BACKEND -> R.string.provider_compatible_description
ProviderType.LOCAL_EXPERIENCE -> R.string.provider_local_description ProviderType.LOCAL_EXPERIENCE -> R.string.provider_local_description
}, },
) )
@@ -9,7 +9,6 @@ data class ProviderAvailability(
) { ) {
fun forType(type: ProviderType): Availability = when (type) { fun forType(type: ProviderType): Availability = when (type) {
ProviderType.ABOX -> abox ProviderType.ABOX -> abox
ProviderType.COMPATIBLE_BACKEND -> compatible
ProviderType.LOCAL_EXPERIENCE -> local ProviderType.LOCAL_EXPERIENCE -> local
} }
} }
@@ -185,7 +185,6 @@ private fun ProviderOptionCard(
private fun providerName(type: ProviderType): String = stringResource( private fun providerName(type: ProviderType): String = stringResource(
when (type) { when (type) {
ProviderType.ABOX -> R.string.provider_abox_name ProviderType.ABOX -> R.string.provider_abox_name
ProviderType.COMPATIBLE_BACKEND -> R.string.provider_compatible_name
ProviderType.LOCAL_EXPERIENCE -> R.string.provider_local_name ProviderType.LOCAL_EXPERIENCE -> R.string.provider_local_name
}, },
) )
@@ -194,14 +193,12 @@ private fun providerName(type: ProviderType): String = stringResource(
private fun providerDescription(type: ProviderType): String = stringResource( private fun providerDescription(type: ProviderType): String = stringResource(
when (type) { when (type) {
ProviderType.ABOX -> R.string.provider_abox_description ProviderType.ABOX -> R.string.provider_abox_description
ProviderType.COMPATIBLE_BACKEND -> R.string.provider_compatible_description
ProviderType.LOCAL_EXPERIENCE -> R.string.provider_local_description ProviderType.LOCAL_EXPERIENCE -> R.string.provider_local_description
}, },
) )
private fun providerMark(type: ProviderType): String = when (type) { private fun providerMark(type: ProviderType): String = when (type) {
ProviderType.ABOX -> "A" ProviderType.ABOX -> "A"
ProviderType.COMPATIBLE_BACKEND -> "C"
ProviderType.LOCAL_EXPERIENCE -> "L" ProviderType.LOCAL_EXPERIENCE -> "L"
} }
@@ -43,11 +43,6 @@ class ProviderSelectionViewModel @Inject constructor(
companion object { companion object {
private val PROFILES = listOf( private val PROFILES = listOf(
ProviderProfile(ProviderProfileId("abox-default"), ProviderType.ABOX, "ABox"), ProviderProfile(ProviderProfileId("abox-default"), ProviderType.ABOX, "ABox"),
ProviderProfile(
ProviderProfileId("compatible-default"),
ProviderType.COMPATIBLE_BACKEND,
"Compatible backend",
),
ProviderProfile( ProviderProfile(
ProviderProfileId("local-experience"), ProviderProfileId("local-experience"),
ProviderType.LOCAL_EXPERIENCE, ProviderType.LOCAL_EXPERIENCE,