[BrushGraph 4/7] Add Node UI core and simple fields#63
[BrushGraph 4/7] Add Node UI core and simple fields#63maxmmitchell wants to merge 6 commits intobrush-graph/3-viewmodelfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements the UI layer for a node-based brush behavior editor, introducing specific field editors for various node types (BinaryOp, Constant, Damping, Integral, etc.) and the core visual components for nodes and ports. The feedback focuses on critical performance optimizations within the Jetpack Compose implementation, specifically regarding the use of remember to cache expensive operations like protobuf creation and the pre-calculation of values to avoid O(N^2) complexity during recomposition or high-frequency touch events. Additionally, there are suggestions to improve maintainability by replacing magic numbers with constants and removing unused state variables.
| ProtoBrushBehavior.Node.newBuilder() | ||
| .setToolTypeFilterNode( | ||
| ProtoBrushBehavior.ToolTypeFilterNode.newBuilder() | ||
| .setEnabledToolTypes(1 shl 3) // Stylus |
There was a problem hiding this comment.
I think this is OK, it's just for a default value and is in the proto, so very unlikely to change. We could always have a utility that treats the tooltypes as an enum and then handles the bitshifting under the hood when converting to proto, but maybe overkill. Regardless will be on a different PR since this file was moved to a follow-up PR.
7e7ae14 to
4b2402e
Compare
a4e196f to
e17146a
Compare
4b2402e to
6f34b89
Compare
e17146a to
cc0aecc
Compare
6f34b89 to
db4a7d4
Compare
cka-dev
left a comment
There was a problem hiding this comment.
Main feedback on this one is to make sure all UI composables have a modifier param,
cc0aecc to
8157b89
Compare
3fc5d33 to
7fb1de6
Compare
4f012bf to
4ebcb7e
Compare
8a7a026 to
dbe0562
Compare
dbe0562 to
1c38d5a
Compare
Description
This is the fourth PR in the Brush Graph stack. It introduces the visual infrastructure for nodes on the canvas and the simpler field editors.
Details
NodeWidgetandPortDotNodeRegistrymaintains positons of nodes (useful for "Add node between functionality") and ports (necessary for splines snapping to ports and clean edge connection)DisplayTextat UI layer.Dependencies
brush-graph/3-viewmodel