Cannot create any link: the ghost cable follows the cursor and swallows the click on the destination port #1
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
You cannot cabling a second port, because the ghost cable that follows your mouse sits on top of the socket you are aiming at and swallows the click.
The connecting state arms correctly, then clicking the destination port does nothing at all: no request is made, no media picker appears, no link is created, and the status bar drops silently from "Now click the destination port (Esc to cancel)" to "Ready". The connecting state stays armed, so the next click also does nothing.
Evidence
The ghost line is on top of the port
With port A armed, put the pointer on the destination port dot and ask the browser what is topmost there:
The
circle.portis not the topmost element at its own centre —line.link-ghostis.web/canvas.js:161-166puts the ghost in theoverlaylayer, which is painted aboveworld(#canvas > defs, g#world, g#packets, g#overlay):and
web/style.css:157never disables hit-testing on it:Computed style confirms:
pointer-events: auto.The click produces no traffic at all
With
window.fetchinstrumented (observation only), arming port A and then clicking the destination port dot produced zero network calls:So
PFCanvas.on.portClick(web/app.js:460) was never invoked — the click never reached the port. The status change toReadyis the background click path, not any of the connect-flow branches.Why it is intermittent, and why it looks like "sometimes cabling works"
The ghost line's far end is the pointer position (
canvas.jsupdatesx2,y2on pointermove). At the instant ofmousedownthe ghost therefore terminates exactly under the cursor — i.e. exactly on the socket you are clicking. Aim dead-centre and you hit the ghost every time. Aim a few pixels off and you may hit thecircle.port, which is why this can appear to work occasionally. The socket is ~6 px across at zoom 0.6 and ~10 px at zoom 1, so the "off" window is a couple of pixels.Reproduction
adtran/SDX611lan1andasus/RT-AX89Xwan).Reproduced repeatedly, at zoom 0.6 and at zoom 0.88, on a topology with no other links.
Fix
pointer-events: noneon the decorative overlay layer, at minimum on.link-ghost:Worth auditing the rest of the overlay in the same pass, because the same mistake is likely repeated:
.link-ghost— confirmed broken (this issue).packet(.packet { fill: var(--amber); filter: url(#glow); }) — animated packet dots sit above the world and will intercept clicks on anything they pass over#overlayThe layer exists for things you must see but must never click. Setting
pointer-events: noneon#overlayitself is the one-line version, withpointer-eventsre-enabled on any genuinely interactive child.Impact
This is the primary way to build a topology. Without it, cabling is a coin flip that depends on sub-pixel aim, and the failure is completely silent — no error, no toast, nothing in the console. It presents as "the app is broken and won't tell me why", and it is the most likely explanation for the earlier reports in this project that link creation "does nothing".
Notes
mousePressedwithout a precedingmouseMoved, so the ghost's last position is not under the cursor. That is not something a person can do with a mouse — which is the point.Fixed in
web/canvas.js. The ghost cable is created withpointer-events: noneand an explicitdata-ghost="connecting"marker, andhitTest()has no case for it — so it can follow the cursor without ever becoming a shield in front of the socket you are aiming at.The comment that guards it is in the source: "pointer-events is off here and in style.css, and hitTest() has no case for it".
test/link-mode-ui.test.js(20 checks) covers the arm → select → complete path.Closing because the code already does what the issue asks for. Reopen if you can still reproduce it — that would mean a specific browser or pointer-capture path, and it is worth knowing about.