Repository navigation
[Maintainer] Snap and cancel MEP handle drags in Select mode - #1238
Merged
Merged
Conversation
The duct and pipe fitting, run and refrigerant line handles read the snap modes, but in Select mode nothing claimed a scope, so every mode read as off. Each drag now claims a handle-drag scope (shared/handle-drag-scope.ts): fitting moves and resizes resolve the item context, run point and segment drags the polygon context, and rotate and roll arcs the rotation context. Escape and a mid-drag undo cancel the drag through tool:cancel instead of leaving it live. The plan view's run point and segment drags claim the same scopes. Fitting sizes step in either snapping mode, since a size has no alignment lines to pull to; held Alt turns and sizes freely, and no longer cycles the fitting's rotation axis mid-drag. The HUD names the MEP gesture and keeps "Alt: Detach the joint" on screen during a run point drag.
pipe_grade gained the pipe_connection_split refusal, so hosts that pin a contract revision for long turns see a new one.
editDuct refuses with duct_offset_angle and writes nothing when planElbowAtPort has no plan for one of the four corners, where it used to dereference the missing plan.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 9, 2026
4 tasks done
4 tasks done
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.
What does this PR do?
Follow-up to #1237 (merged as
cad92aacfrom head113206bc), which finished #1236's port of @sudhir9297's community PR #1115. The final independent review of113206bcasked for changes: one P2 (also the Codex bot's P2 on #1237), two P3s and two nits. These three commits fix the P2, one P3 and the docs nit. They also add the regression test that #1236's duct offset hardening was missing.366bbea0, review P2, E-004 and E-005). The snap helpers resolve through the interaction scope. In Select mode no MEP handle claimed a scope, so every snapping mode read as off. The pipe fitting and refrigerant line drags stopped snapping when [Maintainer] Keep connected MEP edits from splitting joints #1237 moved them from the Shift bypass to the snap modes. The duct fitting, duct run and pipe run handles onmaindid not snap in Select mode either.handle-dragscope for its node (shared/handle-drag-scope.ts), and the mode follows the kind's snap profile, as in the build tools. Fitting moves and resizes use the item modes, which default to Lines. Run and lineset point and arrow drags use the polygon modes, which default to Grid. Turn and roll arcs use the rotation modes, which default to 45° steps. Shift cycles the mode during the drag.tool:cancel. The scene is left unchanged, the selection stays, and the trailing pointer-up does nothing. Before, nothing consumed the cancel, so either key cleared the selection mid-drag instead.floorplanAffordanceReshapeScope).wiki/architecture/interaction-scope.mddocuments the handle-drag claim. It also lists the Shift bypasses that remain outside MEP: the polygon-centroid drag, the building and elevator move tools, and nine roof-accessory move tools.85e96a6b, review P3).pipe_gradegained thepipe_connection_splitrefusal in [Maintainer] Keep connected MEP edits from splitting joints #1237.fea76bc6). After the Tooling review on [Maintainer] Connected duct and pipe editing, ported from #1115 #1236,eccac50ereplaced the non-null assertion onplanElbowAtPortinduct-segment/edit-operation.tswith aduct_offset_anglerefusal, but added no test. The new test stubs a missing bend plan:editDuctrefuses and leaves the scene unchanged.A correction to #1237's description, which the review caught: when a connected edit cannot stay welded, the move tools and handles hold the last welded frame, and releasing places that frame. Nothing is placed only when no welded frame was ever shown, as in #1237's How-to-test step 2.
Still open, not changed here
duct-segment/selection.tsx) holds at the last welded frame even where release could reroute throughplanRunTranslationOffsets. The pipe arrow move and the duct ghost move try the reroute first. This affects few cases.tool:cancel. They are not registered with the editor's gesture owner (lib/gesture-lifecycle.ts), whichuseHandleDraguses but which@pascal-app/editordoes not export.The connected editing these drags belong to is @sudhir9297's work from #1115. Next owner: Maintainer.
How to test
Automated checks on
fea76bc6:bun run cipassed locally on the same tree (00358792), before the commits were moved onto currentmain, whose tree equals [Maintainer] Keep connected MEP edits from splitting joints #1237's head. That covers lint, i18n, skills, type-check, all package tests, the production build and the production-server smoke test. Test counts were core 7,073, nodes 5,319, editor 2,867, viewer 1,350, MCP 1,523, CLI 139, IFC converter 106, geometry-script 64 and app 78, with 0 failures.pipe-fitting/selection.test.tsxmounts the real selection handles and drives them with pointer events:duct-segment/edit-operation.test.ts: theduct_offset_anglerefusal when a bend cannot be planned.helper-manager.test.tsx: which handle drags get the MEP HUD, its hints with "Alt: Detach the joint" lit while Alt is held, and the snap context per handle.floorplan-registry-layer.test.ts: the plan view'smove-path-pointandmove-segmentscopes.Screenshots / screen recording
Not added yet.
Checklist
bun devbun checkto verify)mainbranchNote
Medium Risk
Touches core editor interaction scope, snapping, and MEP drag commit/cancel paths across many selection affordances; behavior changes are user-visible but covered by new tests.
Reviewed by Cursor Bugbot for commit fea76bc. Bugbot is set up for automated code reviews on this repo. Configure here.