Implement client ConnectionState, satirical idle sayings, response cycling, and complete MVVM/Compose multiplatform scaffolding

This commit is contained in:
2026-07-02 13:11:59 -06:00
parent c0e8d4fa0a
commit 0f834078d5
14 changed files with 924 additions and 110 deletions

View File

@@ -319,6 +319,7 @@ object SDUIJson {
ignoreUnknownKeys = true
prettyPrint = true
classDiscriminator = "type"
encodeDefaults = true
}
fun encodeToString(primitive: UiPrimitive): String {
@@ -349,3 +350,16 @@ fun String.toWebSocketPayload(): WebSocketPayload = SDUIJson.json.decodeFromStri
fun ApprovalResponse.toJson(): String = SDUIJson.json.encodeToString(this)
fun String.toApprovalResponse(): ApprovalResponse = SDUIJson.json.decodeFromString(this)
@Serializable
data class UserProfile(
val id: String,
val name: String,
val description: String? = null,
val layout: UiPrimitive
) {
fun toJson(): String = SDUIJson.json.encodeToString(this)
}
fun String.toUserProfile(): UserProfile = SDUIJson.json.decodeFromString(this)