Skip to content

[Maintainer] Leave vertical routing after a riser drawn from a collar - #1242

Merged
Aymericr merged 5 commits into
mainfrom
cursor/mep-collar-draw-followups-14a6
Nov 9, 2026
Merged

Aymericr merged 5 commits into
mainfrom
cursor/mep-collar-draw-followups-14a6

Conversation

@Aymericr

@Aymericr Aymericr commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Follow-up to #1236, which @Aymericr merged as 3a972b68 from head bbe4b501. #1236 ported @sudhir9297's connected duct and pipe editing from #1115, and #1237, #1238 and #1240 followed it. This PR fixes the one Bugbot finding still open on #1236's merged head. It also adds a test for the collar-start behaviour behind two other Bugbot threads there.

  • A riser drawn from a collar no longer blocks the next section (f0977ddd; Bugbot Medium "Vertical collar draw blocks next segment").
    • "Draw from collar" on a collar that points up or down sets Route to Vertical, along with the collar's size and system. A vertical route rises to the panel's target elevation. After the riser reached it, the next vertical section ran from the riser's top to that same height.
    • On main, the cursor then reads "Target elevation: … · click or Enter to place" next to "Run must be at least 0.05 m" (0.08 m for ducts), and clicks place nothing until Route or the target changes.
    • Now a riser placed from a fixed collar switches the pipe tool to "Plan route" and the duct tool to "Horizontal". The next click draws across from the riser's top at the same height. A vertical route chosen while drawing from a pipe or duct end is left as it was (5a20e28c tests this).
    • "Fixed collar" follows each tool's existing rule. For pipes, that is any port not on a pipe segment, including pipe fittings and traps; the pipe collar inspector is offered on both. For ducts, it is terminals and equipment, not duct fittings.
  • The "Draw from collar" handlers sit next to the continuation starters (466f46f8). activatePipeCollarContinuation and activateDuctCollarContinuation, in each kind's continuation.ts, hold the inspector buttons' code unchanged. Tests can now start a collar draw without rendering the inspector.
  • A test pins how a pipe run leaves a fixed collar (d8c5cb2d, 1a250ac0). This behaviour is what Bugbot's High "Fixture start clears chosen waste grade" and Medium "Snapped grade connect fails with wrong message" describe. Both are answered on [Maintainer] Connected duct and pipe editing, ported from #1115 #1236 with no code change:
    • The first section follows the collar's axis.
    • A grade that cannot meet the collar is refused with the grade message.
    • The next section takes the chosen grade and joins without a bend.

The collar draw these changes touch is @sudhir9297's work from #1115. Next owner: Maintainer.

How to test

  1. Place a P-trap and select it. Under "Connect pipe", click the Inlet's "Draw from collar"; the inlet points up. Click once: a riser rises to "Target elevation above level", and Route now reads "Plan route". Move the pointer: the preview runs across from the riser's top at the same height, and a click places it. On main, Route stays Vertical and clicks place nothing.
  2. Do the same with a ceiling diffuser's "Draw from collar" under "Connect duct". After the riser, Route reads "Horizontal" and the next click draws across.
  3. Choose Vertical yourself and draw a riser from the free end of a pipe. Route stays Vertical after the riser.
  4. Start a waste pipe on a trap's Outlet, which points sideways, with Fall set to Graded at 2%. The start click sets Fall to Level. Set Graded at 2% again and click away from the outlet. Nothing is placed, and the cursor reads "The connection elevation conflicts with the chosen grade. Adjust the grade or target elevation." Set Level and click: the pipe leaves straight along the outlet. Set Graded at 2% and click further on: the next pipe falls at 2% from that pipe's end, with no bend fitting.

Automated checks:

  • bun run ci passed locally on f0977ddd (exit 0). The two commits after it, up to this head (5a20e28c), only add assertions to the new test file. Biome and the whole nodes suite (5,340 pass, 0 fail) were run again on this head.
    • Biome, the i18n and skills checks and the production-server smoke test always run outside Turbo, so they ran fresh.
    • Turbo ran the nodes build and tests, the editor package's type-check and tests, the viewer tests, and both apps' type-checks, builds and tests fresh.
    • Turbo replayed core, MCP, CLI, the IFC converter and geometry-script from its cache. Turbo caches only tasks that succeed, and their inputs are unchanged since earlier passing runs.
    • Test counts were core 7,073, nodes 5,340, editor 2,867, viewer 1,352, MCP 1,523, CLI 139, IFC converter 106, geometry-script 64 and app 78, with 0 failures.
  • On GitHub at 5a20e28c, CI's Changed paths, quality and cli-smoke jobs passed. mcp-ci doesn't run because no MCP paths changed. Cursor Bugbot passed, and Codex's code review completed; neither reported findings.
  • New tests are in nodes shared/collar-draw.test.tsx. They mount the real pipe and duct tools and drive them with plan-view pointer events.
    • "a riser drawn from a vertical pipe collar continues on the plan route" and its duct counterpart, "… continues on the horizontal route", fail when the route switch is removed from their tool. They also fail when the switch applies after every riser, because a riser drawn from the new run's end with Vertical chosen again must keep the vertical route.
    • "a pipe run from a fixed collar leaves along its axis, then takes the chosen grade" passes on main's tools. It fails if the free end stops following the collar axis, or if the start keeps the chosen grade. It also fails if the refusal shows the fitting-clearance message instead of the grade message, or if the graded section gets a bend.

Screenshots / screen recording

Both images start the same way: select the P-trap, click the Inlet's "Draw from collar", click once to place the riser, then move the pointer to the right. They were captured in the local editor (bun run dev in apps/editor, with the nodes package built from this branch). For the before image, the four lines this PR adds to the pipe tool were removed from that build, which leaves main's pipe tool. The duct tool's change isn't pictured; its test covers it.

Before (main): Route is still Vertical after the riser, and the preview stays on the riser's top. The run readout falls outside this camera view; it reads "L 0m … Target elevation: 1.58 m · click or Enter to place · Run must be at least 0.05 m".

Before: Route stays Vertical after a riser drawn from the trap inlet

After: Route reads "Plan route", and the preview runs across from the riser's top to the pointer.

After: Route switches to Plan route and the next section follows the pointer

The before image's target field shows 1.5800100000000001 because main displays the collar height plus 1 m unrounded. This PR doesn't change that.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

Note

Low Risk
Localized editor tool-default and continuation UX changes in pipe/duct drawing, with new integration tests and no auth or data-layer impact.

Reviewed by Cursor Bugbot for commit 5a20e28. Bugbot is set up for automated code reviews on this repo. Configure here.

The collar inspectors' "Draw from" handlers move next to the existing
continuation starters, so the collar start can be exercised without
rendering the inspector.
The first section follows the collar's axis and takes its grade; a
chosen grade that cannot meet the collar is refused with the grade
message, not the fitting-clearance one, and later sections take the
chosen grade.
Drawing from a collar that points up or down sets Route to Vertical.
After the riser reached the target elevation, the next vertical section
aimed at the riser's own top, so every click was refused until the
route or target changed. A committed riser out of a fixed collar now
switches the pipe and duct tools to the plan route; a vertical route
chosen from a pipe or duct end is left alone.

Reported by Cursor Bugbot on #1236 ("Vertical collar draw blocks next
segment").
The level first section and the 2% section after it meet directly; the
only fitting is the end cap on the open end.
The switch to the plan route applies only to risers out of a fixed
collar; a vertical route chosen while drawing from a pipe or duct end
stays on for the next riser.
@Aymericr Aymericr added the bot:maintainer label Nov 9, 2026 — with Cursor
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T17:46:34.654532Z 5a20e28 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cursor

cursor Bot commented Nov 9, 2026

Copy link
Copy Markdown

[Maintainer] Tooling re-review requested (@Aymericr) at 5a20e28cd53f118f606f42a2b3efb1597e288ade.

Your static LGTM on #1236 (review) covered bbe4b501, which was merged as 3a972b68. This PR is the only code change made for #1236's final pass. It fixes Bugbot's Medium "Vertical collar draw blocks next segment": a riser drawn from a fixed collar now leaves the pipe tool on "Plan route" and the duct tool on "Horizontal". It also moves the two "Draw from collar" handlers into continuation.ts unchanged and adds shared/collar-draw.test.tsx.

At this SHA, CI's Changed paths, quality and cli-smoke jobs passed, and Cursor Bugbot and Codex's code review reported no findings. bun run ci passed locally on f0977ddd; the two later commits only add test assertions.

@Aymericr Aymericr left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM at 5a20e28

Maintainer — reviewed the full seven-file diff, all three new integration tests, the surrounding routing/commit code, and all returned review/conversation comments. No blocking findings.

  • #1236 Bugbot Medium (vertical collar draw blocks the next segment): fixed. Only after a successful fixed-collar riser commit does the pipe tool switch to Plan route and the duct tool to Horizontal; the next section starts at the new run end rather than targeting the riser's existing height. Pipe preview-only calls and refused commits do not switch modes.
  • Normal vertical routing is preserved: pipe-segment starts do not satisfy startCollar, and duct-segment/duct-fitting starts are explicitly excluded (as are promoted-fitting starts). Both riser tests assert the horizontal continuation and then explicitly select Vertical at the new run end, place another riser, and assert the mode remains Vertical.
  • Inspector-handler extraction preserves the original defaults/selection/tool activation behavior. The third test pins fixed-collar axis alignment, grade-conflict refusal wording, and subsequent graded continuation without a bend.
  • Codex reports no findings at this exact head; Cursor Bugbot succeeded. No inline review threads or prior reviews were returned for #1242.
  • No auth, payments, or secrets changes.

Exact-head CI: Changed paths, quality, cli-smoke and Cursor Bugbot all completed successfully. No legacy commit statuses are published (the legacy API's empty rollup says pending, not an actual pending check). GitHub reports mergeable=true, mergeable_state=clean. Head rechecked immediately before posting and unchanged.

Static review only: tests read, not rerun.

@Aymericr
Aymericr merged commit 55f7d51 into main Nov 9, 2026
4 checks passed
@Aymericr
Aymericr deleted the cursor/mep-collar-draw-followups-14a6 branch November 9, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants