Skip to content

fix(design): preserve nested pointer parity - #5519

Open
steve8708 wants to merge 6 commits into
mainfrom
fix/design-nested-pointer-parity
Open

steve8708 wants to merge 6 commits into
mainfrom
fix/design-nested-pointer-parity

Conversation

@steve8708

Copy link
Copy Markdown
Contributor

Fixes two Design pointer regressions from the physical matrix:

  • preserve measured in-flow group origins when ungrouping, rebasing released children to their absolute world positions
  • choose the deepest eligible nested flow container and expose the held insertion guide marker on overview drops

Focused proof:

  • code-layer.wrap-nodes.test.ts: 22 passed
  • primitive-drop-target.test.ts: 39 passed
  • git diff --check
  • oxfmt on modified files

Browser E2E was not run in this worktree; the focused bridge/runtime matrix remains the CI proof surface.,

@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Here's a visual recap of what changed:

Visual recap

Open the full interactive recap

builder-io-integration[bot]

This comment was marked as outdated.

builder-io-integration[bot]

This comment was marked as outdated.

builder-io-integration[bot]

This comment was marked as outdated.

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder reviewed your changes — looks good ✅

Review Details

Incremental Code Review — PR #5519 Latest Head

Status: All Prior Issues Resolved ✅

The latest commits comprehensively addressed the previously flagged coordinate-space regression. The PR now correctly measures wrapper positions relative to their containing block (offsetParent), not their DOM parent, ensuring that released absolute children maintain correct positioning when ungrouped inside offset static parents.

What was fixed since last review:

  1. Containing-block coordinate measurement (frame-selection.ts:274): Changed from element.parentElement to element.offsetParent ?? element.parentElement. The comment clarifies the intent: "static wrappers can sit inside an offset ancestor, so using parent-relative values here would shift children when the measured wrapper is removed." This directly solves the regression.

  2. Drop-target selection rewrite (primitive-drop-target.ts): Replaced area-based heuristic with explicit ancestor-relationship checking via isPrimitiveAncestor(). Now prefers deepest nested containers and respects DOM paint order for overlapping siblings (later siblings win). Both regression cases from the prior review are now handled correctly.

  3. Test expansion: Added 5 new tests covering measured flow wrapping/unwrapping, absolute children rebasing, static wrapper edge cases, equal-sized nested containers, and overlapping sibling paint order. All pass.

  4. Unwrap positioning semantics (code-layer.ts:8109-8110): Now handles both absolute and relative positioned wrappers, with a new test confirming static wrappers don't trigger spurious rebasing.

Verification:

  • ✅ Prior comment PRRT_kwDORlS_j86kaer8 resolved (measured parent-relative offsets fix confirmed)
  • ✅ All 5 new unit tests pass (wrap/unwrap, drop target ancestor checking, static wrapper edge case)
  • ✅ No new regressions introduced by latest commits
  • ✅ Coordinate geometry semantics now correctly handle all path cases

🧪 Browser testing: Attempted; all Design flows (group/ungroup, overview drops) remain unverified due to unavailable MCP Chrome browser-control tools.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant