Skip to content

perf(design): coalesce drag target resolution - #5550

Open
steve8708 wants to merge 4 commits into
mainfrom
steve8708/design-drag-performance-20260921
Open

steve8708 wants to merge 4 commits into
mainfrom
steve8708/design-drag-performance-20260921

Conversation

@steve8708

Copy link
Copy Markdown
Contributor

Problem

Design auto-layout drags performed live target hit testing and overlay refresh on every pointer event. Pointer-follow style writes were followed by synchronous geometry reads, which could force layout repeatedly on large lists, grids, and group drags.

Change

  • Coalesce auto-layout target resolution to one animation frame using the latest pointer coordinates.
  • Coalesce overlay refresh through the existing animation-frame scheduler.
  • Cancel pending target work when a drag exits or is canceled.
  • Preserve synchronous final target resolution on pointerup, including modifier semantics and final drop coordinates.
  • Add a bridge guard that protects the hot-loop and final-resolution boundary.

Validation

  • selection-performance.bridge.spec.ts - 21/21 passed
  • grid-track-reorder.bridge.spec.ts and screen-root-flow-drag.bridge.spec.ts - 11/11 passed
  • Static drag performance guard - passed

The full bridge guard suite was not runnable in the isolated detached worktree because its dependency graph lacked @agent-native/core/client/i18n; no product assertion failed.

@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 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 and found 2 potential issues 🟡

Review Details

Code Review Summary

The latest commit fixes both previously reported issues: the Space-held branch now hides the insertion guide, and deferred flow-target resolution now attempts to suppress snap, size, and constraint chrome. Source and generated bridge logic remain synchronized, and the added guard assertions cover the new cleanup and suppression paths. However, the new RAF chrome handling still has two state-transition bugs that can leave drag feedback incorrect.

Key Findings

  • 🟡 MEDIUM — The flow-target RAF path sets dragChromeSuppressed before hideSnapGuides(), but that helper clears the flag, allowing the scheduled overlay refresh to restore chrome that should remain hidden.
  • 🟡 MEDIUM — Transitioning from a flow target to an absolute-container target does not restore snap, size, and constraint chrome or clear suppression.

Both prior review threads were resolved after confirming their fixes. Browser verification was attempted, but no Chrome automation tools were available in the executor session.

🧪 Browser testing: Attempted — skipped because browser automation tools were unavailable in the executor session.

Comment thread templates/design/app/components/design/bridge/editor-chrome.bridge.ts Outdated
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