Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: shadows in insertion markers being displayed as shadows #7609

Merged

Conversation

BeksOmega
Copy link
Collaborator

@BeksOmega BeksOmega commented Oct 23, 2023

The basics

The details

Resolves

Fixes #7466

Proposed Changes

Makes it so that children of insertion markers are also set as insertion markers

Reason for Changes

You can set shadow blocks programmatically, but they weren't previously being set as insertion markers.

Test Coverage

Tested with the following two block definitions. The first sets the shadow in the init method, the second sets the shadow in the loadExtraState method.

      Blockly.Blocks['test'] = {
        init: function () {
          this.appendValueInput('test').connection.setShadowState({
            'type': 'math_number',
          });
          this.setPreviousStatement(true);
        },
      };

      Blockly.Blocks['test2'] = {
        init: function () {
          this.appendValueInput('test');
          this.setPreviousStatement(true);
        },

        loadExtraState: function () {
          this.getInput('test').connection.setShadowState({
            'type': 'math_number',
          });
        },

        saveExtraState: function () {
          return true;
        },
      };
Screen.recording.2023-10-23.3.06.57.PM.webm

Added unit tests.

Documentation

N/A

Additional Information

N/A

@github-actions github-actions bot added the PR: fix Fixes a bug label Oct 23, 2023
@BeksOmega BeksOmega marked this pull request as ready for review October 24, 2023 16:22
@BeksOmega BeksOmega requested a review from a team as a code owner October 24, 2023 16:22
@github-actions github-actions bot added PR: fix Fixes a bug and removed PR: fix Fixes a bug labels Oct 24, 2023
@BeksOmega BeksOmega requested review from cpcallen and removed request for rachel-fenichel October 24, 2023 16:37
@BeksOmega BeksOmega merged commit 0ad57f4 into google:develop Nov 3, 2023
6 checks passed
@BeksOmega BeksOmega deleted the fix/shadows-in-insertion-markers branch May 14, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shadow blocks inside statements with mutator input get rendered in insertion marker
3 participants