[BrushGraph 4/7] Add Node UI core and simple fields#63
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
4ebcb7e to
282d91d
Compare
1c38d5a to
565c757
Compare
282d91d to
881a338
Compare
3bf90fa to
8499524
Compare
881a338 to
e62dda8
Compare
8499524 to
951b378
Compare
e62dda8 to
8e16658
Compare
8e16658 to
db2b224
Compare
921d3d3 to
4c05d79
Compare
db2b224 to
ca83e1f
Compare
4c05d79 to
e7af8fd
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