Repository navigation
Conversation
🎨 Storybook: 🚧 Building...🎭 Playwright: ⏳ Running... |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a Vue node rendering service with suppression, retention, lifecycle, snapshot, and policy APIs. Integrates runtime filtering into ChangesVue node rendering service and public API
Runtime rendering integration
Suppressed slot layout retention
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/renderer/extensions/vueNodes/composables/useSlotElementTracking.ts`:
- Around line 261-270: In updateNodeSlotsFromCache, guard the
scheduleSlotLayoutSync(nodeId) call in the !entry.cachedOffset branch with
isVueNodeRenderSuppressed(nodeId), matching the existing guard in
subscribeToNodeLayoutChanges. Continue deleting the slot layout, but do not
schedule DOM synchronization for suppressed nodes.
In `@src/renderer/extensions/vueNodes/composables/useVueNodeRendering.ts`:
- Around line 196-198: Update the runtime tracking around useRafFn and
frameStateChanged to avoid unconditional per-frame work: run the tracker only
while the canvas is dirty or an interaction is active, and compare the
inexpensive numeric frame-state fields before invoking focusedNodeId(). Preserve
refreshRuntime() when a meaningful frame-state change is detected, while
avoiding getFrameState’s DOM query and array allocation during idle frames.
In `@src/renderer/extensions/vueNodes/services/vueNodeRenderingService.ts`:
- Around line 133-165: Coalesce lifecycle-triggered recompute calls from
nodeMounted into one microtask or animation-frame flush instead of executing
once per mounted node. Update recompute/notification scheduling so multiple
events share a pending flush and createSnapshot runs only once for the batch,
while preserving the latest state and existing notification behavior.
- Around line 44-47: Replace the shared EMPTY_CONTRIBUTION constant with an
emptyContribution() factory that returns a fresh object containing new suppress
and retain Sets on every call. Update all reset sites currently assigning
EMPTY_CONTRIBUTION to invoke emptyContribution(), including the paths around the
identified reset locations, while preserving the existing empty contribution
shape.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: db67b094-be1b-4d5c-862d-261e882a24ed
📒 Files selected for processing (14)
browser_tests/tests/vueNodes/renderingControlApi.spec.tssrc/components/graph/GraphCanvas.vuesrc/composables/graph/useGraphNodeManager.test.tssrc/composables/graph/useGraphNodeManager.tssrc/renderer/extensions/vueNodes/components/LGraphNode.vuesrc/renderer/extensions/vueNodes/composables/useSlotElementTracking.test.tssrc/renderer/extensions/vueNodes/composables/useSlotElementTracking.tssrc/renderer/extensions/vueNodes/composables/useVueNodeRendering.tssrc/renderer/extensions/vueNodes/services/vueNodeRenderingService.test.tssrc/renderer/extensions/vueNodes/services/vueNodeRenderingService.tssrc/renderer/extensions/vueNodes/stores/nodeSlotRegistryStore.tssrc/stores/workspaceStore.tssrc/types/extensionTypes.tssrc/types/vueNodeRendering.ts
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/extensions/vueNodes/services/vueNodeRenderingService.ts (1)
335-338: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winCoalesce
nodeUnmountedthe same way asnodeMounted.
nodeUnmountedstill callsrecompute()synchronously for every call.nodeMountednow defers toscheduleMountRecompute()specifically to avoid one fullpruneState/createSnapshot/notifycycle per node during bursts. Node unmounts happen in bursts too: bulk deletion, undo of multi-node operations, and virtualization churn as nodes scroll out of view all fire multiplenodeUnmountedcalls in the same tick. Each call still pays the sameO(n)pruneState/createSnapshotcost that the mount-side fix was designed to avoid.Reuse the same scheduling mechanism for both lifecycle events.
♻️ Proposed fix
- let mountRecomputeScheduled = false + let recomputeScheduled = false @@ - function scheduleMountRecompute(): void { - if (mountRecomputeScheduled) return - mountRecomputeScheduled = true + function scheduleRecompute(): void { + if (recomputeScheduled) return + recomputeScheduled = true queueMicrotask(() => { - if (!mountRecomputeScheduled) return + if (!recomputeScheduled) return recompute() }) } @@ function recompute(): void { - mountRecomputeScheduled = false + recomputeScheduled = false pruneState() @@ function nodeMounted(id: string): void { if (!knownNodeIds().has(id)) return const changed = !mountedNodeIds.has(id) || !initializedNodeIds.has(id) mountedNodeIds.add(id) initializedNodeIds.add(id) - if (changed) scheduleMountRecompute() + if (changed) scheduleRecompute() } function nodeUnmounted(id: string): void { if (!mountedNodeIds.delete(id)) return - recompute() + scheduleRecompute() }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/extensions/vueNodes/services/vueNodeRenderingService.ts` around lines 335 - 338, Update nodeUnmounted to use the same deferred recomputation mechanism as nodeMounted: after successfully deleting the ID from mountedNodeIds, call scheduleMountRecompute() instead of recompute(). Preserve the early return for IDs that were not mounted and reuse the existing scheduler.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/renderer/extensions/vueNodes/services/vueNodeRenderingService.ts`:
- Around line 335-338: Update nodeUnmounted to use the same deferred
recomputation mechanism as nodeMounted: after successfully deleting the ID from
mountedNodeIds, call scheduleMountRecompute() instead of recompute(). Preserve
the early return for IDs that were not mounted and reuse the existing scheduler.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: ef41b1d9-cd8d-41a3-99c4-33ef223e4b8e
📒 Files selected for processing (6)
src/renderer/extensions/vueNodes/composables/useSlotElementTracking.test.tssrc/renderer/extensions/vueNodes/composables/useSlotElementTracking.tssrc/renderer/extensions/vueNodes/composables/useVueNodeRendering.test.tssrc/renderer/extensions/vueNodes/composables/useVueNodeRendering.tssrc/renderer/extensions/vueNodes/services/vueNodeRenderingService.test.tssrc/renderer/extensions/vueNodes/services/vueNodeRenderingService.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/renderer/extensions/vueNodes/services/vueNodeRenderingService.test.ts`:
- Around line 221-224: Update the subscription test around the listener callback
and service snapshot so it asserts the snapshot payload received by listener
contains mountedNodeIds equal to ['3']; retain the existing call-count and
timing assertions, but do not rely solely on service.getSnapshot() after the
microtask.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 3308ee10-330b-4a6a-93c7-2cb55ed47deb
📒 Files selected for processing (2)
src/renderer/extensions/vueNodes/services/vueNodeRenderingService.test.tssrc/renderer/extensions/vueNodes/services/vueNodeRenderingService.ts
c672d3b to
21ba26f
Compare
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 8
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@browser_tests/tests/vueNodes/renderingControlApi.spec.ts`:
- Around line 96-104: Wrap the remounted slot geometry read and x/y comparisons
in a Playwright retrying assertion, such as an expect.poll-style callback, so
layout synchronization can complete before validation. Keep the existing
visibility wait and targetSlot reference, but perform boundingBox() inside the
retry and preserve the unavailable-geometry failure behavior.
In `@src/components/graph/GraphCanvas.vue`:
- Around line 327-330: Gate useVueNodeRendering behind shouldRenderVueNodes so
runtime tracking and synchronization do not run in legacy canvas mode. Extend
useVueNodeRendering with an enabled MaybeRefOrGetter option, pass
shouldRenderVueNodes from GraphCanvas.vue, and return early from both its
useRafFn callback and refreshRuntime when disabled.
In `@src/renderer/extensions/vueNodes/composables/useSlotElementTracking.ts`:
- Around line 182-185: Update the mismatched-node cleanup branch in the slot
tracking logic to remove the stale slot entry from node.slots in addition to
calling layoutStore.deleteSlotLayout(slotKey). Keep this cleanup consistent with
the disconnected-element branch so reparented or unresolved entries are pruned
from the registry.
In `@src/renderer/extensions/vueNodes/composables/useVueNodeRendering.test.ts`:
- Around line 138-162: Extend the tests around useVueNodeRendering to cover
lifecycle and filtering behavior: after scope.stop(), assert
renderingService.unsubscribe is called and renderingService.updateRuntime
receives an empty graph; verify renderedNodes contains only allNodes whose IDs
appear in snapshot.renderedNodeIds; and verify onNodeMounted and onNodeUnmounted
forward stringified node IDs to the corresponding renderingService methods.
- Around line 24-28: Update the layoutState factory in
useVueNodeRendering.test.ts to create isDraggingVueNodes, isResizingVueNodes,
and version with real Vue ref instances obtained inside vi.hoisted, replacing
the manually constructed __v_isRef/value objects while preserving their initial
values.
In `@src/renderer/extensions/vueNodes/composables/useVueNodeRendering.ts`:
- Around line 135-176: Refactor getFrameState to return a named viewport object
containing scale, offset coordinates, canvas dimensions, and a separate
variable-length rest array for the remaining state. Update frameStateChanged to
compare viewport fields by name and compare only the rest array positionally,
removing all reliance on lastFrameState[0] through lastFrameState[4] while
preserving change detection behavior.
In `@src/renderer/extensions/vueNodes/services/vueNodeRenderingService.test.ts`:
- Around line 154-177: Update the test callback for “publishes copied, deeply
frozen snapshots and supports unsubscribe” to be async, await one microtask
after service.nodeMounted('1'), then assert listener was still called only
twice. This must exercise the scheduled notification path through
scheduleMountRecompute so the unsubscribe behavior is validated after pending
reactivity runs.
In `@src/renderer/extensions/vueNodes/services/vueNodeRenderingService.ts`:
- Around line 392-424: Cache the known-node ID set in the rendering service
state instead of rebuilding it in each query. Update the cached set immediately
after assigning nextNodes to nodes in updateRuntime, then change knownNodeIds
and the getNodeRenderState/isVueNodeRenderSuppressed query paths to read that
cached state while preserving existing node-ID normalization and render-state
behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 2ff8904b-0bc7-4e49-9055-6b73649f7f5e
📒 Files selected for processing (13)
browser_tests/tests/vueNodes/renderingControlApi.spec.tssrc/components/graph/GraphCanvas.vuesrc/renderer/extensions/vueNodes/components/LGraphNode.vuesrc/renderer/extensions/vueNodes/composables/useSlotElementTracking.test.tssrc/renderer/extensions/vueNodes/composables/useSlotElementTracking.tssrc/renderer/extensions/vueNodes/composables/useVueNodeRendering.test.tssrc/renderer/extensions/vueNodes/composables/useVueNodeRendering.tssrc/renderer/extensions/vueNodes/services/vueNodeRenderingService.test.tssrc/renderer/extensions/vueNodes/services/vueNodeRenderingService.tssrc/renderer/extensions/vueNodes/stores/nodeSlotRegistryStore.tssrc/stores/workspaceStore.tssrc/types/extensionTypes.tssrc/types/vueNodeRendering.ts
21ba26f to
c672d3b
Compare
|
@coderabbitai full review |
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 16 minutes. |
|
@coderabbitai rate limt |
|
Tip For best results, initiate chat on the files or code changes.
Retry after the indicated wait period. The previous response reported 16 minutes. Usage-based billing can also allow the review to proceed when eligible. 🐇 You are interacting with an AI system. |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 5
♻️ Duplicate comments (6)
src/components/graph/GraphCanvas.vue (1)
299-303: 🚀 Performance & Scalability | 🟠 Major | ⚡ Quick winGate the rendering runtime on
shouldRenderVueNodes.
useVueNodeRenderingruns unconditionally. ItsuseRafFntracker and itsflush: 'sync'watcher therefore stay active for the whole session, including whenshouldRenderVueNodesis false and the legacy canvas renderer draws the graph.shouldTrackRuntimereturns true wheneverdirty_canvasordirty_bgcanvasis set, which is the normal state during legacy canvas interaction. In legacy mode nothing consumesrenderedNodes, so the work produces no output.♻️ Suggested approach
Accept an
enabled: MaybeRefOrGetter<boolean>option inuseVueNodeRendering, then return early from theuseRafFncallback and fromrefreshRuntimewhen it is false.const { onNodeMounted, onNodeUnmounted, renderedNodes } = useVueNodeRendering({ allNodes, canvas: () => canvasStore.canvas, - nodeManager: () => vueNodeLifecycle.nodeManager.value + nodeManager: () => vueNodeLifecycle.nodeManager.value, + enabled: shouldRenderVueNodes })🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/graph/GraphCanvas.vue` around lines 299 - 303, Gate useVueNodeRendering behind shouldRenderVueNodes by adding an enabled MaybeRefOrGetter option and passing the existing flag from GraphCanvas. In the composable, check enabled in both the useRafFn callback and refreshRuntime, returning without tracking or flushing when disabled; preserve current behavior when enabled.src/renderer/extensions/vueNodes/composables/useVueNodeRendering.ts (1)
140-181: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the positional index contract between
getFrameStateandframeStateChanged.
frameStateChangedreadslastFrameState[0]throughlastFrameState[4]and assumes those slots hold scale, offset x, offset y, canvas width, and canvas height.getFrameStatedefines that order implicitly. If a future change inserts an entry at the front ofgetFrameState, the fast path compares the wrong fields and the tracker stops detecting pan and zoom. No test guards the alignment.Return a named viewport object for the cheap fields and keep only the variable-length tail as an array, then compare the viewport fields by name.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/extensions/vueNodes/composables/useVueNodeRendering.ts` around lines 140 - 181, Update getFrameState to return named viewport fields for scale, offset coordinates, canvas dimensions, and the existing variable-length state tail separately, rather than relying on positional indexes. Update frameStateChanged to compare those viewport fields by name while preserving the existing tail comparison and change-detection behavior.browser_tests/tests/vueNodes/renderingControlApi.spec.ts (1)
99-104: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winRetry the slot geometry comparison to prevent flake.
Line 96 waits for the node element to be visible. It does not wait for the slot connection dot to be measured and positioned. Slot layout is restored through a layout sync pass after remount, so
boundingBox()at Line 99 can read a position from before that pass completes.boundingBox()is a one-shot read, andtoBeCloseTodoes not retry.♻️ Proposed fix
- const remountedSlotBox = await targetSlot.boundingBox() - if (!remountedSlotBox) { - throw new Error('Remounted target slot geometry unavailable') - } - expect(remountedSlotBox.x).toBeCloseTo(initialSlotBox.x, 0) - expect(remountedSlotBox.y).toBeCloseTo(initialSlotBox.y, 0) + await expect(async () => { + const remountedSlotBox = await targetSlot.boundingBox() + if (!remountedSlotBox) { + throw new Error('Remounted target slot geometry unavailable') + } + expect(remountedSlotBox.x).toBeCloseTo(initialSlotBox.x, 0) + expect(remountedSlotBox.y).toBeCloseTo(initialSlotBox.y, 0) + }).toPass()As per coding guidelines, Playwright tests must prefer locator actions and retrying assertions.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@browser_tests/tests/vueNodes/renderingControlApi.spec.ts` around lines 99 - 104, Update the remounted slot geometry checks around remountedSlotBox to use Playwright’s retrying locator assertion rather than a one-shot boundingBox read, waiting until the slot connection dot’s x and y coordinates match initialSlotBox after layout synchronization. Preserve the existing geometry tolerance and failure behavior while ensuring the assertion targets the slot locator that becomes positioned after remount.Source: Coding guidelines
src/renderer/extensions/vueNodes/composables/useVueNodeRendering.test.ts (2)
26-30: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCreate real Vue refs in the mocked layout store.
layoutStatehand-builds{ __v_isRef: true, value: ... }.__v_isRefis an internal Vue marker, sotoValue,watch, andlayoutStore.getVersion()depend on an implementation detail. Create the refs inside thevi.hoistedfactory instead.♻️ Proposed fix
const layoutState = vi.hoisted(() => { - isDraggingVueNodes: { __v_isRef: true, value: false }, - isResizingVueNodes: { __v_isRef: true, value: false }, - version: { __v_isRef: true, value: 0 } -}) + const { ref } = require('vue') + return { + isDraggingVueNodes: ref(false), + isResizingVueNodes: ref(false), + version: ref(0) + } +})Based on learnings,
vi.hoistedfactories run before static ESM imports initialize, so load Vue withrequire('vue')inside the factory.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/extensions/vueNodes/composables/useVueNodeRendering.test.ts` around lines 26 - 30, Update the layoutState factory used by the mocked layout store to create isDraggingVueNodes, isResizingVueNodes, and version with real Vue refs rather than manually setting __v_isRef. Load Vue via require('vue') inside the vi.hoisted factory, then initialize each ref with its existing value so toValue, watch, and layoutStore.getVersion() use authentic ref behavior.Source: Learnings
148-180: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for scope disposal and rendered-node filtering.
This file tests only the idle-frame optimization. Three observable behaviors of the composable remain untested:
onScopeDisposemust callunsubscribeand must reset the service runtime to an empty graph.renderedNodesmust filterallNodesdown tosnapshot.renderedNodeIds.onNodeMountedandonNodeUnmountedmust forward stringified IDs to the service.The
renderingService.unsubscribeandrenderingService.updateRuntimespies already exist, so the disposal test needs onlyscope.stop()plus assertions. To assert the forwarding, movenodeMountedandnodeUnmountedinto the hoistedrenderingServiceobject so the test can reference them.Do you want me to generate these tests?
As per path instructions,
.agents/checks/test-quality.mdrequires coverage of controller ownership and disposal and of lifecycle cleanup.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/extensions/vueNodes/composables/useVueNodeRendering.test.ts` around lines 148 - 180, Expand the tests around useVueNodeRendering to cover disposal, rendered-node filtering, and lifecycle forwarding. Add nodeMounted and nodeUnmounted spies to the hoisted renderingService mock, verify onNodeMounted/onNodeUnmounted pass stringified IDs, and assert renderedNodes contains only IDs listed by snapshot.renderedNodeIds. Stop the effect scope and verify unsubscribe is called and updateRuntime resets the service to an empty graph.Source: Path instructions
src/renderer/extensions/vueNodes/services/vueNodeRenderingService.test.ts (1)
154-177: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winThe unsubscribe assertion cannot fail.
nodeMounteddefers notification throughscheduleMountRecompute, which usesqueueMicrotask. Line 176 runs in the same tick, so no notification has been delivered yet. A brokenunsubscribe()would still pass.Await one microtask before the final assertion, and make the test callback
async.💚 Proposed fix
- it('publishes copied, deeply frozen snapshots and supports unsubscribe', () => { + it('publishes copied, deeply frozen snapshots and supports unsubscribe', async () => {unsubscribe() service.nodeMounted('1') + await Promise.resolve() expect(listener).toHaveBeenCalledTimes(2)As per path instructions,
docs/guidance/vitest.mdrequires awaiting reactivity before asserting.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/extensions/vueNodes/services/vueNodeRenderingService.test.ts` around lines 154 - 177, Make the test callback for “publishes copied, deeply frozen snapshots and supports unsubscribe” async, then await one microtask after service.nodeMounted('1') before asserting the listener call count. This must allow scheduleMountRecompute’s queued notification to run so the unsubscribe behavior is actually verified.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/renderer/extensions/vueNodes/composables/useVueNodeRendering.test.ts`:
- Around line 132-146: Guard the cleanup in afterEach so scope.stop() is called
only when scope was successfully assigned by the test. Update the scope handling
around the existing beforeEach/afterEach setup without changing normal cleanup
behavior.
In `@src/renderer/extensions/vueNodes/composables/useVueNodeRendering.ts`:
- Around line 105-138: Update refreshRuntime so it does not rebuild the nodes
render-area mapping while renderFrozen is true during dragging or resizing;
continue passing the frozen state and frontendRequiredNodeIds, while preserving
the existing node mapping for unfrozen updates.
- Around line 215-231: Update the node-ID source in the watch call so it returns
a stable scalar, such as the joined node IDs, instead of allocating a new array
on every evaluation. Preserve refreshes when node identity or ordering changes,
while preventing the sync watcher from treating every invalidation as a change;
leave refreshRuntime and the other watch sources unchanged.
In `@src/renderer/extensions/vueNodes/services/vueNodeRenderingService.ts`:
- Around line 128-130: Cache known node IDs in service state instead of
rebuilding them in knownNodeIds(). Add or reuse a nodeIdSet state value, refresh
it immediately after nodes = nextNodes in updateRuntime, and have knownNodeIds()
return the cached set so getNodeRenderState and isVueNodeRenderSuppressed avoid
repeated O(N) allocation.
- Around line 255-262: Update recompute to call createSnapshot only when owners
contains at least one policy owner, using a hasPolicyOwner() helper that scans
owners.values() for kind === 'policy'; otherwise skip the pre-policy snapshot
while preserving the existing policy evaluation and notification flow.
---
Duplicate comments:
In `@browser_tests/tests/vueNodes/renderingControlApi.spec.ts`:
- Around line 99-104: Update the remounted slot geometry checks around
remountedSlotBox to use Playwright’s retrying locator assertion rather than a
one-shot boundingBox read, waiting until the slot connection dot’s x and y
coordinates match initialSlotBox after layout synchronization. Preserve the
existing geometry tolerance and failure behavior while ensuring the assertion
targets the slot locator that becomes positioned after remount.
In `@src/components/graph/GraphCanvas.vue`:
- Around line 299-303: Gate useVueNodeRendering behind shouldRenderVueNodes by
adding an enabled MaybeRefOrGetter option and passing the existing flag from
GraphCanvas. In the composable, check enabled in both the useRafFn callback and
refreshRuntime, returning without tracking or flushing when disabled; preserve
current behavior when enabled.
In `@src/renderer/extensions/vueNodes/composables/useVueNodeRendering.test.ts`:
- Around line 26-30: Update the layoutState factory used by the mocked layout
store to create isDraggingVueNodes, isResizingVueNodes, and version with real
Vue refs rather than manually setting __v_isRef. Load Vue via require('vue')
inside the vi.hoisted factory, then initialize each ref with its existing value
so toValue, watch, and layoutStore.getVersion() use authentic ref behavior.
- Around line 148-180: Expand the tests around useVueNodeRendering to cover
disposal, rendered-node filtering, and lifecycle forwarding. Add nodeMounted and
nodeUnmounted spies to the hoisted renderingService mock, verify
onNodeMounted/onNodeUnmounted pass stringified IDs, and assert renderedNodes
contains only IDs listed by snapshot.renderedNodeIds. Stop the effect scope and
verify unsubscribe is called and updateRuntime resets the service to an empty
graph.
In `@src/renderer/extensions/vueNodes/composables/useVueNodeRendering.ts`:
- Around line 140-181: Update getFrameState to return named viewport fields for
scale, offset coordinates, canvas dimensions, and the existing variable-length
state tail separately, rather than relying on positional indexes. Update
frameStateChanged to compare those viewport fields by name while preserving the
existing tail comparison and change-detection behavior.
In `@src/renderer/extensions/vueNodes/services/vueNodeRenderingService.test.ts`:
- Around line 154-177: Make the test callback for “publishes copied, deeply
frozen snapshots and supports unsubscribe” async, then await one microtask after
service.nodeMounted('1') before asserting the listener call count. This must
allow scheduleMountRecompute’s queued notification to run so the unsubscribe
behavior is actually verified.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 1957fb11-1966-44f3-bc53-3e355a518c8e
📒 Files selected for processing (15)
browser_tests/tests/vueNodes/renderingControlApi.spec.tssrc/components/graph/GraphCanvas.vuesrc/composables/graph/useGraphNodeManager.test.tssrc/composables/graph/useGraphNodeManager.tssrc/renderer/extensions/vueNodes/components/LGraphNode.vuesrc/renderer/extensions/vueNodes/composables/useSlotElementTracking.test.tssrc/renderer/extensions/vueNodes/composables/useSlotElementTracking.tssrc/renderer/extensions/vueNodes/composables/useVueNodeRendering.test.tssrc/renderer/extensions/vueNodes/composables/useVueNodeRendering.tssrc/renderer/extensions/vueNodes/services/vueNodeRenderingService.test.tssrc/renderer/extensions/vueNodes/services/vueNodeRenderingService.tssrc/renderer/extensions/vueNodes/stores/nodeSlotRegistryStore.tssrc/stores/workspaceStore.tssrc/types/extensionTypes.tssrc/types/vueNodeRendering.ts
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@browser_tests/tests/vueNodes/renderingControlApi.spec.ts`:
- Around line 57-62: Update the baseline geometry setup around targetSlot and
initialSlotBox to wait for the target connection dot to become visible using the
browser test’s retrying assertion pattern before calling boundingBox(). Preserve
the existing missing-geometry error handling and use the established
visibility-wait helper or assertion from the test framework.
In `@src/renderer/extensions/vueNodes/composables/useVueNodeRendering.test.ts`:
- Line 31: Extend the rendering test around nodeOptions and the RAF callback to
cover the open-node tail-change path: set nodeOptions.open = true and
canvas.dirty_canvas = true, invoke raf.callback?.(), then assert updateRuntime
was called and updateViewport was not. Ensure the test exercises the behavioral
branch in getFrameStateChange rather than only configuring mocks.
In `@src/renderer/extensions/vueNodes/composables/useVueNodeRendering.ts`:
- Around line 311-322: Protect the onScopeDispose runtime reset in
useVueNodeRendering with module-level ownership tracking via an activeInstance
variable. Assign the current composable instance as active and only perform the
pause, unsubscribe, and vueNodeRenderingService.updateRuntime reset when the
disposing instance still owns that active slot; ensure newer instances are not
cleared by older teardown.
In `@src/renderer/extensions/vueNodes/services/vueNodeRenderingService.test.ts`:
- Around line 12-42: The test suite lacks coverage for the empty-graph teardown
state produced by runtime(null). Add a test using the real useVueNodeRendering
service that first applies a populated runtime, registers a push controller,
then applies runtime(null); assert nodeIds, renderedNodeIds, and mountedNodeIds
are empty and getNodeRenderState('1') returns 'unknown'.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 6516a4f1-1d1f-455a-bd1e-e9b83cc53aa1
📒 Files selected for processing (15)
browser_tests/tests/vueNodes/renderingControlApi.spec.tssrc/components/graph/GraphCanvas.vuesrc/composables/graph/useGraphNodeManager.test.tssrc/composables/graph/useGraphNodeManager.tssrc/renderer/extensions/vueNodes/components/LGraphNode.vuesrc/renderer/extensions/vueNodes/composables/useSlotElementTracking.test.tssrc/renderer/extensions/vueNodes/composables/useSlotElementTracking.tssrc/renderer/extensions/vueNodes/composables/useVueNodeRendering.test.tssrc/renderer/extensions/vueNodes/composables/useVueNodeRendering.tssrc/renderer/extensions/vueNodes/services/vueNodeRenderingService.test.tssrc/renderer/extensions/vueNodes/services/vueNodeRenderingService.tssrc/renderer/extensions/vueNodes/stores/nodeSlotRegistryStore.tssrc/stores/workspaceStore.tssrc/types/extensionTypes.tssrc/types/vueNodeRendering.ts
Summary
Expose a stable
app.extensionManager.vueNodes.renderingAPI so extensions can coordinate Vue node render suppression without mutating graph state or depending on frontend internals.Changes
Review Focus
VueNodeData.Testing
pnpm test:unit src/renderer/extensions/vueNodes/services/vueNodeRenderingService.test.ts src/renderer/extensions/vueNodes/composables/useSlotElementTracking.test.ts src/composables/graph/useGraphNodeManager.test.ts src/renderer/extensions/vueNodes/components/LGraphNode.test.ts(65 passed)pnpm test:browser:local browser_tests/tests/vueNodes/renderingControlApi.spec.ts --project=chromium --workers=1(1 passed)pnpm typecheckpnpm typecheck:browserpnpm lint(0 errors; 59 pre-existing warnings)pnpm format:checkpnpm knipScreenshots (if applicable)
Not applicable. This change adds an extension API and rendering infrastructure with no visual UI changes.