mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-11 08:47:33 +00:00
fix(dm): make the commons DM feed UI compile for iOS
The DM history widgets extracted into commons were never compiled for the
commons iOS target, which hid two Kotlin/Native-only breaks:
- RelayReachMarker: `toSortedMap(compareBy { it.ordinal })` + a destructured
`(state, list)` Map.Entry inside an inline @Composable lambda don't type-infer
on Native. Rewrite as `.entries.sortedBy { it.key.ordinal }` with explicit
`entry.key` / `entry.value`.
- DmHistoryLoadingCard referenced RelayPagingProgress, which sat in quartz's
jvmAndroid source set — visible to commonMain only when building JVM/Android,
not iOS. It's a pure data class, so move it to quartz commonMain.
commons:compileKotlinIosArm64 now succeeds; JVM/Android unaffected and the DM
test suite is still green (26/26).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
6223617179
commit
b37f1a6e56
+8
-2
@@ -212,11 +212,17 @@ private fun RelayReachMarker(entries: List<RelayReach>) {
|
||||
fontWeight = FontWeight.Medium,
|
||||
maxLines = 1,
|
||||
)
|
||||
// Present states in enum order. Written with an explicit `sortedBy` + `entry.key`/`entry.value`
|
||||
// (not `toSortedMap(compareBy { it.ordinal })` + a destructured `(state, list)`) because
|
||||
// Kotlin/Native's Compose compiler can't infer those inside this inline @Composable lambda
|
||||
// (commons iOS).
|
||||
entries
|
||||
.groupBy { it.state }
|
||||
.toSortedMap(compareBy { it.ordinal })
|
||||
.entries
|
||||
.forEachIndexed { index, (state, list) ->
|
||||
.sortedBy { it.key.ordinal }
|
||||
.forEachIndexed { index, entry ->
|
||||
val state = entry.key
|
||||
val list = entry.value
|
||||
if (index > 0) {
|
||||
Text("·", color = MaterialTheme.colorScheme.onSurfaceVariant, fontSize = 11.sp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user