Skip to content

fix(block-dynamic-connection): recache connection pairs after dynamically adding inputs#2751

Open
mikeharv wants to merge 1 commit into
mainfrom
recache-connections
Open

fix(block-dynamic-connection): recache connection pairs after dynamically adding inputs#2751
mikeharv wants to merge 1 commit into
mainfrom
recache-connections

Conversation

@mikeharv

Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #2708
Depends upon:

Proposed Changes

After onPendingConnection(), if the dynamic block has new inputs, re-cache the compatible connection pairs for the currently dragging block.

Reason for Changes

As stated in the issue:

When using block-dynamic-connection with Blockly v13, and moving blocks via the keyboard, new connections are correctly added to blocks, but because move mode pre-caches the list of available connections at the start of a keyboard-driven move, they are not offered as connection points in constrained move mode.

This fixes this issue.

Test Coverage

No plugin-level tests were added for this change. A headless test would only verify mocked interactions and would not meaningfully exercise constrained movement. Testing the complete behavior with rendered blocks would require substantial browser, rendering, and drag-state setup disproportionate to the small plugin change.

Instead, Blockly core tests cover the important behavioral contract: after cacheAllConnectionPairs() is called during a move, newly added connections are included in the cache and can be visited in the expected traversal order.

Documentation

Additional Information

This depends upon BlockDragStrategy.cacheAllConnectionPairs being made public, so this should only be merged after RaspberryPiFoundation/blockly#10149 is merged and, ideally, released.

@mikeharv
mikeharv requested a review from a team as a code owner July 16, 2026 20:21
@mikeharv
mikeharv requested review from maribethb and removed request for a team July 16, 2026 20:21
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.

Connections added by block-dynamic-connection are not available in keyboard move mode

2 participants