Skip to content

Function: locateComponents()

locateComponents(rect): LocatedComponent[]

Defined in: aiui-intent-runtime/src/locator.ts:49

The locator pass: rect → the components the user framed.

Earlier versions grid-sampled elementsFromPoint and reported every annotated ancestor the rect touched — which put the app shell in every shot's metadata (a rect anywhere intersects it). What the prompt actually needs is a point of reference, not an inventory, so:

  1. Keep the highest annotated elements fully enclosed by the rect (±ENCLOSE_TOLERANCEpx): of the enclosed elements, drop any contained in another — the survivors are what the drag deliberately framed.
  2. If the rect encloses nothing annotated — a drag inside one big component — fall back to the innermost annotated element containing the rect, marked containment: "within"; one element, the smallest answer to "where is this?".
  3. For each kept element, surface its direct-cell frontier: the topmost data-cell descendants with no other cell between them and the element. One level deep on purpose — cells mirror the dataflow graph, and the frontier names are enough for an agent to enter it; enumerating the whole subtree would bury the reference points it exists to provide.

Parameters

rect

Rect

Returns

LocatedComponent[]