fix(ui): action selector hydration race#2557
Merged
daryllimyt merged 2 commits intomainfrom Apr 23, 2026
Merged
Conversation
|
✅ No security or compliance issues detected. Reviewed everything up to 8f65f0f. Security OverviewDetected Code Changes
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root Cause
The action selector is an ephemeral React Flow node that is not persisted in the backend graph. When the first graph hydration/refetch completed after a drag, the canvas replaced local nodes/edges with only the hydrated backend graph, dropping the just-created selector.
Validation
pnpm -C frontend exec biome check --write src/components/builder/canvas/canvas.tsx src/components/builder/canvas/graph-layout.ts tests/graph-layout.test.tspnpm -C frontend test -- graph-layout.test.tspnpm -C frontend exec biome check --write src/components/builder/canvas/selector-node.tsxpnpm -C frontend run typecheckuv run ruff check .git diff --checkSummary by cubic
Fixes a race that removed the action selector after the first graph hydration by preserving ephemeral nodes/edges and updating canvas state handling. Also speeds up selector filtering for a snappier first keystroke.
Bug Fixes
applyNodeChanges/applyEdgeChangesfrom@xyflow/reactwith unified state to avoid stale updates.Refactors
nodesandedgesin a single state object; addmergeHydratedNodes/mergeHydratedEdgeswith optional ephemeral preservation.fuzzysortfor empty queries, and compute results once per input.Written for commit 8f65f0f. Summary will update on new commits.