Skip to content

Conversation

@wenli-cai
Copy link
Contributor

  1. Allow each node to be opened and closed to ignore irrelevant information for each frame. Nodes that were directly affected in the specific render pass, though, are all open by default, and everything else is closed by default.

  2. Allow for using a mouse's vertical scroll to traverse through the row of frames.

@wenli-cai wenli-cai requested review from a team and zach-klippenstein as code owners July 11, 2025 21:00
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

@steve-the-edwards steve-the-edwards left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat.

Comment on lines +107 to +108
val fields = Node::class.memberProperties
for (field in fields) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh nice. Ok i see you moved to reflection here. that's great. I think it makes sense.

This had no visible affect on UI performance
@wenli-cai wenli-cai force-pushed the wenli/visualizer-ux branch from 27f1fc9 to 5ee0c41 Compare July 14, 2025 17:21
Comment on lines 45 to 57
.pointerInput(Unit) {
awaitEachGesture {
val event = awaitPointerEvent()
if (event.type == PointerEventType.Scroll) {
val scrollDeltaY = event.changes.first().scrollDelta.y
coroutineScope.launch {
lazyListState.scroll(MutatePriority.Default) {
scrollBy(scrollDeltaY * 10f)
}
}
}
}
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason you need this animation to outlive the pointerInput modifier's lifetime? It would be slightly cleaner to just wrap this with coroutineScope {}, i.e.

Suggested change
.pointerInput(Unit) {
awaitEachGesture {
val event = awaitPointerEvent()
if (event.type == PointerEventType.Scroll) {
val scrollDeltaY = event.changes.first().scrollDelta.y
coroutineScope.launch {
lazyListState.scroll(MutatePriority.Default) {
scrollBy(scrollDeltaY * 10f)
}
}
}
}
},
.pointerInput(Unit) {
coroutineScope {
awaitEachGesture {
val event = awaitPointerEvent()
if (event.type == PointerEventType.Scroll) {
val scrollDeltaY = event.changes.first().scrollDelta.y
launch {
lazyListState.scroll(MutatePriority.Default) {
scrollBy(scrollDeltaY * 10f)
}
}
}
}
}
},

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

Comment on lines +111 to +113
LaunchedEffect(expandedNodes) {
expandedNodes[node.id] = isAffected
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a weird little bit of backwards data flow. Feels like there should be a presenter or something handling this?

It also looks like affectedNodes and expandedNodes effectively represent the same thing, since this code just synchronizes them, or partially synchronizes them? It's possible I'm misunderstanding the code.

Copy link
Contributor Author

@wenli-cai wenli-cai Jul 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I'm not familiar with using a Presenter as a pattern, if you wouldn't mind explaining a potential solution (or point me to a resource). I can understand that UI should be using callbacks to affect data rather than directly mutating it, but when I experimented hoisting everything out of this Composable and into RenderDiagram, the tree would no longer recompose everytime I open/closed a node.

    But I definitely could've been trying an incorrect way of doing it, leading it to fail.

  2. Any affectedNodes for the specific renderpass will always be the same, but the nodes that are expanded can be changed. So we can open a non-affected node, and we can also close an affected node

Base automatically changed from wenli/visualizer-ui-improvements to main July 18, 2025 17:53
@wenli-cai wenli-cai force-pushed the wenli/visualizer-ux branch from b02a717 to 4f6ad22 Compare July 18, 2025 18:06
@wenli-cai wenli-cai force-pushed the wenli/visualizer-ux branch from 4f6ad22 to e9a03f6 Compare July 18, 2025 18:16
@wenli-cai wenli-cai merged commit f4e1297 into main Jul 18, 2025
64 checks passed
@wenli-cai wenli-cai deleted the wenli/visualizer-ux branch July 18, 2025 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants