Conversation
Co-authored-by: georgi <19498+georgi@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Deploying nodetool with
|
| Latest commit: |
40a4058
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bacb73cd.nodetool.pages.dev |
| Branch Preview URL: | https://bolt-nodeinputs-perf-2389702.nodetool.pages.dev |
Deploying nodetool-staging with
|
| Latest commit: |
40a4058
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2e7280af.nodetool-staging.pages.dev |
| Branch Preview URL: | https://bolt-nodeinputs-perf-2389702.nodetool-staging.pages.dev |
⚡ Bolt: NodeInputs Edge Selection Optimization
💡 What
Refactored
NodeInputs.tsxto use a custom memoized selectoruseConnectedEdgesSelectorinstead of subscribing directly tostate.edgesviauseNodesand filtering inline.🎯 Why
NodeInputspreviously subscribed to the entirestate.edgesarray. Because React Flow updates the node/edge state on every frame during drag operations (60fps),state.edgesconstantly changed reference.This caused all node input components to fully re-render on any graph edge change, even if the new edge was completely unrelated to that node.
By using a dedicated selector that returns a stable array reference when connected edges are identical, we eliminate these O(N*E) re-renders during interactions.
📊 Impact
NodeInputsso it only re-renders when its specific connection state changes, not on any graph edge change.🔬 Measurement
Verified using a performance regression test.
NodeInputswrapper to re-render.NodeInputswrapper to re-render.🧪 Testing
web/src/hooks/nodes/__tests__/useConnectedEdges.test.tsto verify stable references.web/src/components/node/__tests__/NodeInputs.performance.test.tsxto verifyNodeInputsrender counts.cd web && npm run typecheck: Passed.cd web && npm run lint: Passed.make test-web: All tests passed.PR created automatically by Jules for task 2389702828674086179 started by @georgi