Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.material3.TextField
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateListOf
Expand All @@ -39,12 +40,14 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.unit.dp

@Immutable
data class ChatWorkspaceState(
val modelName: String,
val inputPlaceholder: String,
val welcomeMessage: String,
)

@Immutable
data class AgentGatewayConfig(
val baseUrl: String,
val pairingCode: String,
Expand All @@ -64,7 +67,7 @@ object ChatWorkspaceDefaults {
)
}

private data class ChatMessage(val id: Int, val role: ChatRole, val content: String)
@Immutable private data class ChatMessage(val id: Int, val role: ChatRole, val content: String)

private enum class ChatRole {
User,
Expand Down Expand Up @@ -286,9 +289,14 @@ private fun ConfigPanel(
onWebhookSecretChange: (String) -> Unit,
modifier: Modifier = Modifier,
) {
val healthUrl = endpointUrl(gatewayConfig.baseUrl, "/health")
val pairUrl = endpointUrl(gatewayConfig.baseUrl, "/pair")
val webhookUrl = endpointUrl(gatewayConfig.baseUrl, "/webhook")
val (healthUrl, pairUrl, webhookUrl) =
remember(gatewayConfig.baseUrl) {
Triple(
endpointUrl(gatewayConfig.baseUrl, "/health"),
endpointUrl(gatewayConfig.baseUrl, "/pair"),
endpointUrl(gatewayConfig.baseUrl, "/webhook"),
)
}

Surface(
modifier = modifier.fillMaxWidth(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
Expand All @@ -37,6 +38,7 @@ import com.profiletailors.composeapp.generated.resources.onboarding_title_welcom
import org.jetbrains.compose.resources.StringResource
import org.jetbrains.compose.resources.stringResource

@Immutable
data class OnboardingStep(val titleRes: StringResource, val descriptionRes: StringResource)

object OnboardingDefaults {
Expand Down
Loading