This document describes the current editor drag pipeline for flex parents. Older notes that referenced besideDetector in layoutInference, separate alignment dwell paths, or BesideDropIndicator-only alignment are obsolete.
This document describes the current editor drag pipeline for flex parents. Older notes that referenced besideDetector in layoutInference, separate alignment dwell paths, or BesideDropIndicator-only alignment are obsolete.
findPosition2D (packages/sdk/src/chrome/shell/findPosition2D.ts) runs each pointer move while dragging.syncResolvedIntent writes the latest placement + optional cross-axis snapshot into spatialSession (setLastResolvedIntent) so indicators and drop execution read one source of truth.packages/sdk/src/chrome/shell/spatial/)| Area | File | Role |
|---|---|---|
| Main-axis reorder | reorderMainAxis.ts | Sort children, gap / edge slots, before / after vs main position |
| Beside | detectBeside.ts + besideConstants.ts | Column “split beside sibling” hit testing; shared numeric thresholds |
| Cross-axis align | detectAlignCrossFromDrag.ts | Direction-dominant drag + optional cursor zones |
| Zones only | alignCrossAxisZones.ts | Inner 32px edges + middle third; outer ratio bands on cross-axis; tiny-container guard (MIN_ALIGN_CONTAINER_PX) |
| Session | spatialSession.ts | Drag origin, alignment preview/commit, last resolved SpatialIntent |
| Types | spatialIntent.ts | ReorderMainIntent, BesideIntent, AlignCrossIntent, compounds |
updateAlignCrossFromDrag → setActiveCrossAxisAlign / clearCrossAxisPreviewOnly in spatialSession. There is no second detector or dwell-only alignment hook.inferCrossAxisIntentFromCursorZones may still set intent from cursor position (inner vs outer parent per drag origin).updateAlignCrossFromDrag so alignment updates while the pointer stays in a gap.tryBesideInColumn hits, setActiveCrossAxisAlign(null, null) clears alignment so beside placement does not combine with a stale align preview. onBesideDrop in besideDrop.ts also clears alignment at drop start.DropZoneIndicator reads intent from spatialSession (e.g. getLastResolvedIntent, alignment getters) — not from a parallel alignment store.CustomEventHandlers / executeSpatialDrop consume the same session state when applying moves and alignment on drop.alignmentInference.ts is for drop-time class resolution (applyAlignmentOnDrop, labels, inner vs wrapper). It does not own drag-time intent detection.besideDetector inside layoutInference (removed); beside logic lives under spatial/.AlignmentDropIndicator, useDwellIntent, detectAlignmentIntent (removed).clearAlignmentIntent / setBesideDropInProgress (removed); use spatialSession APIs instead.