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:
Vitor Pamplona
2026-06-05 18:57:41 -04:00
co-authored by Claude Opus 4.8
parent 6223617179
commit b37f1a6e56
2 changed files with 8 additions and 2 deletions
@@ -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)
}