Skip to content

fix(graph): admit new members into collapsed groups - #463

Draft
draedful wants to merge 2 commits into
v2from
codex/fix-collapsed-group-membership
Draft

draedful wants to merge 2 commits into
v2from
codex/fix-collapsed-group-membership

Conversation

@draedful

@draedful draedful commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

  • Manually configured collapsed groups now reconcile arrivals and departures when the blocks' group membership changes. An arriving block is hidden and its connections follow the destination's edge. Expanding the group restores the block's own ports.
  • Keep the existing batched handoff between collapsed groups. Reinserted blocks bind to their current state, and an ungrouped block stays separate from a group whose ID is the string "undefined".
  • When a collapsed destination is configured in the same update, retain the old hidden route until its group view binds.
  • Coordinate and status changes within the same group keep the membership index.

Verification

  • Core and E2E TypeScript checks and builds.
  • 2,103 Graph unit tests, including red/green coverage for the two missing transfer cases and same-ID reinsertion.
  • A first-frame Chromium probe using updateEntities and setEntities, plus 18 scene-connection scenarios, including Canvas and WebGL pixels, source anchor position, hit testing and expansion.

Summary by Sourcery

Reconcile dynamic block membership across collapsed groups while preserving connection routing and restoring native block behavior on expansion.

New Features:

  • Reconcile blocks entering or leaving manually configured collapsed groups, including transfers from ungrouped, expanded, or other collapsed groups.
  • Restore member visibility and native connection ports when a destination collapsed group expands.

Bug Fixes:

  • Preserve existing visual edge delegation while a newly configured collapsed destination group is mounting.
  • Correctly handle same-group block reinsertion and distinguish ungrouped blocks from the group ID "undefined".
  • Keep group membership indexes current when block coordinates or status change without changing membership.

Documentation:

  • Document support for blocks joining manually configured collapsed groups and deferred destination-group handoff.

Tests:

  • Expand unit and end-to-end coverage for collapsed-group transfers, reinsertion, deferred handoff, rendering across Canvas and WebGL, hit testing, anchors, and expansion.

@gravity-ui-bot

Copy link
Copy Markdown
Contributor

Preview is ready.

@sourcery-ai

sourcery-ai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Reviewer's Guide

Data structures

Track retained-block group changes and build the membership index from explicit group IDs, keeping membership stable across unrelated block updates.

  • packages/graph/src/store/block/Block.ts L2, L267-276
  • packages/graph/src/store/block/BlocksList.ts L85-87, L309-313
  • packages/graph/src/store/group/GroupsList.ts L2 (removed lines), L7, L27-36

Implementation

Reconcile collapsed-group arrivals and departures, transferring port delegation and preserving the old route until a newly configured destination view is ready.

  • packages/graph/src/components/canvas/groups/CollapsibleGroup.ts L567-628 (+10 small edits)

Documentation

Document how manually configured collapsed groups accept later members and how membership changes behave while a destination group is mounting.

  • packages/graph/docs/blocks/groups.md L136-140

Tests

Cover group rebinding, newly arriving members, reinsertion, string-ID handling, and preservation of the old route during destination mounting.

  • packages/graph/src/components/canvas/groups/test/groupRebind.test.ts L61, L74-75, L441-541

Exercise anchor connections moving into collapsed groups from ungrouped, expanded, and collapsed states in Canvas and WebGL, including expansion and visibility.

  • apps/e2e/tests/connection/scene-connections.spec.ts L756-760, L788-792 (+6 small edits)

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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.

2 participants