Skip to content

Canvas: "Connect to…" cross-scope connection gesture #66

@CuriouslyCory

Description

@CuriouslyCory

Parent

#2

What to build

The headline user-facing slice — the gesture that resolves the original problem (you couldn't wire a component to one in another subtree). You never need both endpoints on screen at once: you search.

  • A project-wide component-tree read powers a "Connect to…" search surface (cmdk-style, reusing the existing kind-palette pattern): select a Component, invoke connect, search any Component at any depth by title/kind, pick the target. The connection is created as ASSOCIATION by default; the interaction can be set in the same flow or after.
  • A Connections section in the Component-detail panel lists a component's connections and lets the owner add one by the same search (viewer-readable, owner-editable).
  • Secondary gesture: dragging from a component to an already-rendered boundary proxy still works; same-canvas port-to-port drag still works.
  • Optimistic updates across scope: a cross-scope connection inserts the far-end boundary proxy optimistically (if not already present) and reconciles like any edge; the canvas mirror stays consistent on the scope-keyed remount.

The "Connect to…" gesture and the Connections-section UX may warrant a short design grill at build time — open one if the affordance feels unresolved while implementing.

Acceptance criteria

  • A project-wide component search lets the user connect a selected Component to any other Component at any scope; connection defaults to ASSOCIATION.
  • The Component-detail panel has a Connections section (list + add-by-search), read-only for viewers.
  • Drawing a cross-scope connection optimistically shows the far-end proxy and reconciles on success; rollback on failure.
  • End-to-end dev-browser check: connect a deep component to one in another subtree; confirm it renders on both home canvases (real + proxy) and on a common-ancestor canvas (abstract view).
  • pnpm check green.

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an agent to implement AFK

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions