Skip to content

Conversation

@johnnesky
Copy link
Contributor

The basics

The details

Resolves

Fixes #2426

Proposed Changes

The shadow block converter plugin now detects if the shadow block being replaced was selected, and if so, it selects the block that took the place of the shadow block.

Reason for Changes

This maintains apparent continuity of the selection when a selected shadow block is edited by the user and replaced with a real block by the shadow block converter plugin.

Note that prior to RaspberryPiFoundation/blockly#8172 clicking on a shadow block actually selected the parent block, and this selection was maintained even if the shadow block was deleted.

After RaspberryPiFoundation/blockly#8172 clicking on a shadow block selects that shadow block. This means that if the shadow block is deleted, then the selection is cleared, which could be unexpected in the case of the shadow block converter plugin. This PR fixes that.

See also RaspberryPiFoundation/blockly#8533 which addresses the visual glitches described in #2426

Test Coverage

I added a unit test method for the new behavior.

@johnnesky johnnesky requested a review from a team as a code owner September 5, 2024 02:15
@johnnesky johnnesky requested review from gonfunko and removed request for a team September 5, 2024 02:15
@johnnesky johnnesky merged commit b127923 into RaspberryPiFoundation:master Sep 5, 2024
@johnnesky johnnesky deleted the nesky-selected-shadow branch September 5, 2024 22:15
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.

Shadow Block Converter Plugin Parent Block Visual Selection Bug

2 participants