@@ -208,8 +208,8 @@ private fun DrawTree(
208
208
/* *
209
209
* Draws the group of unaffected children, which can be open and closed to expand/collapse them.
210
210
*
211
- * If an unaffected children also has other children, it cannot be opened, since the this group
212
- * treats all nodes as one entity, so the onClick for the whole group overrides the onClick for the
211
+ * If an unaffected children also has other children, it cannot be opened since the this group
212
+ * treats all nodes as one entity. The onClick for the whole group overrides the onClick for the
213
213
* individual nodes.
214
214
*/
215
215
@OptIn(ExperimentalComposeUiApi ::class )
@@ -266,6 +266,7 @@ private fun UnaffectedChildrenGroup(
266
266
previousFrameNode = previousFrameNode,
267
267
affectedNodes = affectedNodes,
268
268
expandedNodes = expandedNodes,
269
+ unaffected = true ,
269
270
onNodeSelect = onNodeSelect
270
271
)
271
272
}
@@ -297,17 +298,27 @@ private fun AffectedChildrenGroup(
297
298
298
299
/* *
299
300
* Draws the children in a grid manner, to avoid horizontal clutter and make better use of space.
301
+ *
302
+ * Unaffected children group would call this with `unaffected = true`, which means that simple/nested
303
+ * nodes don't matter since we can't open nested ones, so we just simply group in 5's
300
304
*/
301
305
@Composable
302
306
private fun DrawChildrenInGroups (
303
307
children : List <Node >,
304
308
previousFrameNode : Node ? ,
305
309
affectedNodes : Set <Node >,
306
310
expandedNodes : MutableMap <String , Boolean >,
311
+ unaffected : Boolean = false,
307
312
onNodeSelect : (NodeUpdate ) -> Unit
308
313
) {
309
314
// Split children into those with children (nested) and those without
310
- val (nestedChildren, simpleChildren) = children.partition { it.children.isNotEmpty() }
315
+ var (nestedChildren, simpleChildren) = children.partition { it.children.isNotEmpty() }
316
+
317
+ // Just reset the lists so we chunk everything in the unaffected group
318
+ if (unaffected) {
319
+ nestedChildren = emptyList()
320
+ simpleChildren = children
321
+ }
311
322
312
323
Column (
313
324
verticalArrangement = Arrangement .spacedBy(16 .dp), // Increased spacing between sections
0 commit comments