Skip to content

bug(workflow/frontend): canvas hit-testing hard-codes 240x100 node geometry, so sized container nodes are mis-targeted #14008

Closed

Description

@mrveiss

Found while fixing #13996 M3 (PR #14003), which confined data.width/data.height sizing to org-group container nodes. The canvas still assumes every node is 240x100 everywhere it does geometry.

Evidence (src/components/workflow/WorkflowCanvas.vue)

  • :330 — edge origin: node.position.x + 240, node.position.y + 50
  • :468 — port anchor: node.position.x + (port === 'out' ? 240 : 0)
  • :490 — connection drop hit-test: x <= n.position.x + 240 && y <= n.position.y + 100
  • :522 — the CSS that actually sets the width: .workflow-node { width: 240px; }

Four independent copies of the same number, and a fifth canonical one already exists: components/workflow/canvasNode.ts exports CANVAS_NODE_WIDTH = 240, which the layout builder uses and the renderer does not.

The height literals (50 for the vertical centre, 100 for the box) are pure invention — a node's height is content-driven and a container's comes from data.height (928x482 for a 6-person forest in the org chart). Dropping a connection anywhere below 100px of a tall node's top edge misses it.

Impact today

Latent, not live: connections are an authoring affordance and the org chart mounts the canvas readonly, so the only nodes that are currently sized differently are also the only ones that cannot be connected. It becomes live the moment a sized node appears in an editable canvas.

Fix

Measure or derive the node box instead of assuming it, and route every remaining literal through CANVAS_NODE_WIDTH plus a companion height source. Deliberately not taken in #14003 — it is a refactor of the authoring path, whereas that PR is a post-merge defect fix for #13939.

Related: #13996 · #14003

Activity

  1. modified the milestones: Backlog, v0.13.0 on Sep 12, 2026
  2. added a commit that references this issue on Nov 21, 2026
  3. mrveiss commented on Nov 21, 2026

    @mrveiss
    OwnerAuthor

    Closure check against main after #21930 (merge 8d0c736). check-issue-close-refs.sh 14008 clear. This issue has no checkbox list; its "Fix" section is the criterion and each clause is checked below.

    • "Measure or derive the node box instead of assuming it" - autobot-frontend/src/components/workflow/canvasNode.ts:119 nodeExtent(node) returns data.width/data.height for an org-group, else the default box; :131 nodePortY = extent height / 2.
    • "route every remaining literal through CANVAS_NODE_WIDTH plus a companion height source" - canvasNode.ts:42 CANVAS_NODE_WIDTH, :51 CANVAS_NODE_HEIGHT, :61 CANVAS_NODE_PORT_Y. The four copies listed in the issue now read these:
      • edge origin: WorkflowCanvas.vue:1259-1260 (nodeExtent(node).width, nodePortY);
      • port anchor: WorkflowCanvas.vue:2226-2227;
      • drop hit-test: WorkflowCanvas.vue:2304-2306 (x <= n.position.x + width && y <= n.position.y + height);
      • rendered width: WorkflowCanvas.vue nodeStyle sets width: ${CANVAS_NODE_WIDTH}px, org-group overrides from data; the .workflow-node CSS rule at :2566 no longer carries width: 240px.
      • node centre: WorkflowCanvas.vue:1598-1599.
    • Tests: WorkflowCanvas.sizedGeometry.test.ts - "leaves a sized source at its own trailing edge and mid-line", "keeps the default box for an unsized node", "connects when the drop is below the old 100px box but inside the real height", "does not connect when the drop is below the real height". The PR records that reverting the fixed port height fails these specs; I did not re-run them.

    Every clause is delivered; the issue stays closed.

  4. mrveiss commented on Nov 21, 2026

    @mrveiss
    OwnerAuthor

    Host evidence (install at d8cbd91)

    Checked 2026-11-21 ~21:38 Riga. Deployed commit marker on the install = d8cbd91925a19c7e4bc27696382e8b6a01ef2c0d (= origin/main); backend and SLM backend services active. All checks read-only.

    Commands (generic)

    Results

    Check Result
    PR #21930 files, deployed source vs origin/main 6/6 match
    nodeExtent in the built bundle if(e.type==='org-group'){let t=e.data;return{width:typeof t.width=='number'?t.width:240,height:typeof t.height=='number'?t.height:100}}return{width:240,height:100}, then the port-Y helper returns nodeExtent(e).height/2

    Verdict

    Verified. The served canvas derives a sized container's box from its own data.width/data.height. The 240x100 literals remain only as the fallback for types that carry no size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: workflow-engineWave 1 · cluster AC — Workflow engine & schedulersbackendbugSomething isn't workingfrontendphase:M3.7Company OS, Automation and BI screens

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions