fix(android): accept string widget icons and summary-only help content from current QQQ core
Core serializes QWidgetMetaData.icon as a string and QHelpContent may carry only a summary; the strict models failed loading the whole instance and echoPrint. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e8b6be00e8
commit
778ac58612
3 files changed
+6
-4
No files matched your search
+3
-2
@@ -27,8 +27,9 @@ import kotlinx.serialization.Serializable
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
@Serializable
|
@Serializable
|
||||||
data class QHelpContent(
|
data class QHelpContent(
|
||||||
val content: String,
|
val content: String? = null, // QQQ core now sends summary-only help entries
|
||||||
val format: String,
|
val summary: String? = null,
|
||||||
|
val format: String? = null,
|
||||||
val roles: Set<String> = emptySet(),
|
val roles: Set<String> = emptySet(),
|
||||||
val contentAsText: String? = null
|
val contentAsText: String? = null
|
||||||
) {
|
) {
|
||||||
|
|||||||
+2
-1
@@ -23,6 +23,7 @@
|
|||||||
package com.kingsrook.qqq.frontend.android.core.model.metadata
|
package com.kingsrook.qqq.frontend.android.core.model.metadata
|
||||||
|
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.json.JsonElement
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
@@ -30,7 +31,7 @@ import kotlinx.serialization.Serializable
|
|||||||
data class QWidgetMetaData(
|
data class QWidgetMetaData(
|
||||||
val name: String,
|
val name: String,
|
||||||
val label: String? = null,
|
val label: String? = null,
|
||||||
val icon: QIcon? = null,
|
val icon: JsonElement? = null, // QQQ core serializes a widget icon as a plain string (e.g. "troubleshoot"); tolerate an object too
|
||||||
val type: String,
|
val type: String,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
+1
-1
@@ -128,7 +128,7 @@ fun ProcessComponentEditForm(processViewModel: ProcessViewModel, component: QFro
|
|||||||
OutlinedButton(onClick = { processViewModel.loadRemoteOptions(field) }) { Text("Retry choices") }
|
OutlinedButton(onClick = { processViewModel.loadRemoteOptions(field) }) { Text("Retry choices") }
|
||||||
}
|
}
|
||||||
semanticFieldHint(field)?.let { Text(it) }
|
semanticFieldHint(field)?.let { Text(it) }
|
||||||
field.helpContents.orEmpty().forEach { Text(it.contentAsText ?: plainText(it.content)) }
|
field.helpContents.orEmpty().forEach { Text(it.contentAsText ?: it.content?.let { c -> plainText(c) } ?: it.summary.orEmpty()) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user