This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(app-shell): the flow designer's Remove node takes its edges, and a new node never inherits a removed one's (objectui#11772) - #11825
Merged
objectstack-fleet[bot] merged 3 commits intoOct 7, 2026
Conversation
…nherits a removed one's (objectui#11772) The flow inspector's Remove node wrote null to the node and left every edge naming it; the next node minted the same id and the stale edges re-attached, so a published flow ran one create_record once per stale edge. - One removal for both gestures (inspector Remove, canvas Delete key): `edgesAfterNodeRemoval` drops every edge naming the node in the same patch and splices a single-path node out (the inverse of insert-on-edge). - Node ids are minted over node ids and edge endpoints, plus the editing session's ledger in FlowPreview, so a removed id is never minted again. - The Problems panel flags each extra copy of a repeated connection (`engine.flowProblems.repeatedEdge`); dangling edges were already flagged. Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8 Co-authored-by: Claude <noreply@anthropic.com>
…key they share (objectui#11772) `edgesAfterNodeRemoval` and `freshNodeId` move from FlowCanvas.tsx into the React-free flow-problems module next to `edgeRouteKey`, so the node inspector no longer imports a component module and the canvas file exports components only. Adds the shape pins (inspector Remove and canvas Delete agree on every fixture), the repeated-connection pins, and the patch changeset. Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8 Co-authored-by: Claude <noreply@anthropic.com>
…ys (objectui#11772) The ledger's effect read the memoised `nodes` / `edges`; it now reads the draft's own arrays, per AGENTS.md #10. Recording is idempotent, so behaviour is unchanged. Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8 Co-authored-by: Claude <noreply@anthropic.com>
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
This was referenced Oct 7, 2026
This was referenced Oct 7, 2026
objectstack-fleet
Bot
deleted the
claude/issue-11772-flow-remove-node-edges
branch
October 7, 2026 18:36
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #11772
Clause-②: no
The objectui half of objectstack#22088 (the server half lands independently).
What was wrong, measured on
main(9990f9e)The card's reproduction, driven through the real
FlowPreviewcanvas and the realFlowInspectorover a host that merges each patch the way the Studio Automations pillar does ({ ...d, ...patch }), on the draft Studio creates for a new flow (start → end, edgee1):node_1(e1: start → node_1,edge_1: node_1 → end);[start, end], edges[start → node_1, node_1 → end];startmintednode_1again, so both stale edges re-attached to the new node.On
mainthe new pin file went red on exactly that: 6 failed, 4 passed (the 4 were the controls and the dangling-edge rows, which already worked; see Hypothesis 4).What changed
Remove node removes the node's edges in the same patch. One function,
edgesAfterNodeRemoval, serves both removal gestures: the inspector's "Remove node" and the canvas's Delete key. The inspector can seedraft.edges, and its host applies patches shallowly (MetadataInspectorProps.onPatch: "Apply a shallow patch to the draft"), so the edges go into the same patch as the node.StudioDesignSurface.tsxis not touched.A node on a single path is spliced out: its predecessor is reconnected to its successor. Single path, read off the edge shapes:
default. So X made no routing choice of its own that the splice would drop;edgeRouteKey), so the splice never draws the repeated connection the Problems panel now flags.The reconnected edge is the edge in, retargeted to S, in the edge in's place. Its id, condition, label, default flag and type are P's routing choice, so they stay. A decision branch that led to X now leads to S, at the same position in the declaration order the engine evaluates branches in. This is exactly the inverse of the canvas's insert-on-edge, which splits P to S into the original edge retargeted to X (in place) plus an appended plain X to S. So inserting a node on an edge and removing it gives the draft back byte for byte (pinned). Anything else (a branch node, a join, a node whose edge out is guarded or labelled, the start or the end) loses its edges and is not reconnected.
A new node never takes an id that existed in this editing session. The four node minters (the canvas's add, insert-on-edge and revise loop, and the empty flow's first node) now go through
freshNodeId:uniqueId('node', …)over the node ids, both endpoints of every edge, and the idsFlowPreviewhas seen this session. The session is theFlowPreviewmount; Studio remounts it when another flow is opened. A draft with nothing removed and nothing dangling mints exactly what it minted before (pinned as a control). The shareduniqueIdcontract is unchanged; its widget,kv,ol,sland edge callers are untouched.The Problems panel flags a repeated connection: an edge that joins the same two nodes the same way as an earlier edge (same type, same condition read through
conditionText, same default flag, same label). Each extra copy is its own error row, targeted at that copy's own edge key, so clicking the row selects the copy to remove in the edge inspector. Two edges that join the same nodes differently (two decision branches to one node, an approval'sapproveandrejectto one node) are not flagged. New rowengine.flowProblems.repeatedEdge, en and zh.The PM's mechanism hypotheses, measured
removereaches the draft throughloc.write(null)andonPatch, and the host merges shallowly, so the edges fit in the same patch from the inspector. The canvas's Delete key already pruned edges with its own copy of the filter; it now calls the same function, which adds the single-path splice there too.uniqueId.uniqueIdkeeps its lowest-free-suffix contract. Edge ids keep that plain rule: nothing in a flow refers to an edge by its id (the engine routes by endpoints, condition and label), so a reused edge id cannot re-attach anything. The edge minters inFlowCanvas.tsxare unchanged.validateFlowDraft(engine.flowValidate.edgeSourceMissing/edgeTargetMissing). Measured onmain: the card's second-reproduction draft already shows both rows, in en and zh. No second check was added, which would have reported each edge twice; the existing rows are now pinned through the real panel. The repeated pair was not flagged anywhere, and the card's published flow (three copies ofstart → node_1) read "No problems". That half is new.buildFlowProblemsfeeds only the canvas banner, the badges, the red ring and stroke (deriveInvalidElements), and the Problems panel. Nothing on the Studio save or publish path reads them, and Studio passes no server diagnostics to the flow preview. What an author with a dangling or repeated edge can do: see the error in the banner and the panel, click the row to select that edge, and remove it with the edge inspector's Remove. They can still save the draft and publish, until objectstack#22088 makes the server refuse such a flow. Stored flows are not migrated.Tests
Pins (all through the real components):
previews/FlowPreview.removeNode-11772.test.tsx: the card's reproduction end to end; the insert-then-remove round trip, byte for byte; the control (nothing removed:node_1andedge_1as before); a removed id with no edges is not minted again in the session; a stored dangling edge's id is not minted; the Problems panel rows for the dangling edges and the repeated copies, in en and zh; the skeleton draws no row.inspectors/FlowNodeInspector.removeEdges-11772.test.tsx: nine edge shapes through the real Remove button (single path, decision branch, branch node, guarded edge out, labelled edge out, back-edge in, already-joined ends, join, dangling edge in), plus a draft holding a duplicate node id. For each of the nine, the canvas's Delete key produces the same edges as the inspector.previews/flow-problems.repeatedEdge-11772.test.ts: one error per extra copy with its own edge key, an id-less copy keyed by index, zh, the condition spellings agree, the four "joined differently" shapes stay unflagged, and a control.Ablations, each through
ablation-replace.mjsfrom the committed implementation atd2b3a07, restore proven by blob hash equal to HEAD and an emptygit diff HEAD:removewrites the node only (the old behaviour)freshNodeIdignores edge endpoints and the sessionEach local reading, with the commit it ran at, is in the report comment on the card. The full
@object-ui/app-shellsuite (1,062 test files) was not run locally: two attempts exceeded the container's 10-minute foreground limit on a shared box. Instead the narrowed set ran: every test file that names a changed module or a changed gesture (51 files). The full suite is left to CI.Files
Everything is on the claim's file surface.
FlowCanvas.tsxchanges beyond itsuniqueId('node', …)callers in one place: its Delete key handler calls the shared removal function, so the two removal gestures agree.ProblemsPanel.tsxneeded no change: the new rows render like every other edge problem.Nothing is added to the package entry. The changed modules are not reachable from
dist/index.d.ts, checked by walking its relative imports after a build, withpreview-registry.d.tsas the reachable positive control. Patch changeset on@object-ui/app-shell.Acceptance notes
create_recorddefault type,notifyin the Node Type select) is not addressed here.nodes, and the field commits on every keystroke. Measured with a probe on this branch: the patch carries noedges. After this PR the old id is never minted again and the Problems panel names the dangling edges, but the renamed node is still disconnected. Rewriting the endpoints on every keystroke could join a half-typed id to another node's edges, so this needs its own design.Generated by Claude Code