fix: dedup node lists to prevent LazyColumn duplicate-key crash (#6193)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
James Rich
2026-07-10 08:31:54 -05:00
committed by GitHub
parent f6a3f091ed
commit 228fa8a368
2 changed files with 9 additions and 2 deletions

View File

@@ -48,7 +48,9 @@ fun ClusterItemsListDialog(
text = {
// Use a LazyColumn for potentially long lists of items
LazyColumn(contentPadding = PaddingValues(vertical = 8.dp)) {
items(items, key = { it.node.num }) { item ->
// Dedup by node.num: it's the LazyColumn key and must be unique, but filteredNodes can
// contain the same node from two sources (or a num=0 placeholder). See NodeListScreen.
items(items.distinctBy { it.node.num }, key = { it.node.num }) { item ->
ClusterDialogListItem(item = item, onClick = { onItemClick(item) })
}
}