Skip to content

Hide inputs when custom block middle clicked - #3961

Merged
apple502j merged 4 commits into
ScratchAddons:masterfrom
TheColaber:devtools-bugfix-4
Jan 22, 2022
Merged

Hide inputs when custom block middle clicked#3961
apple502j merged 4 commits into
ScratchAddons:masterfrom
TheColaber:devtools-bugfix-4

Conversation

@TheColaber

Copy link
Copy Markdown
Member

Resolves TurboWarp/scratch-gui#390

Changes

Blockly.hideChaff(), which scratch also uses for gestures: https://github.com/LLK/scratch-blocks/blob/893c7e7ad5bfb416eaed75d9a1c93bdce84e36ab/core/gesture.js#L483

I also import the devtools code to the debugger addon since they use the exact same code for going to a block and blinking it.

@TheColaber TheColaber mentioned this pull request Dec 21, 2021
@lisa-wolfgang lisa-wolfgang added priority: 3 Medium priority. Includes bugs and useful features scope: addon Related to one or multiple addons type: bug A bug in the addon loader, or in a specific addon labels Dec 23, 2021
Comment thread addons/editor-devtools/blockly/Utils.js
@WorldLanguages

Copy link
Copy Markdown
Member

Using the block flasher from devtools in debugger makes code cleaner but I want to double check whether we introduced some different logic for debugger and forgot

@WorldLanguages

Copy link
Copy Markdown
Member

Devtools' scrollBlockIntoView was there since before the debugger addon existed, so that makes me wonder, why didn't we import the module from the beginning?
Also, I thought the whole block flasher script was an entire chunk of code found as-is on devtools, but at the time the debugger
addon was developed, it was already split into smaller methods in devtools!
Here's the commit: 6164eeb

@TheColaber

Copy link
Copy Markdown
Member Author

why didn't we import the module from the beginning?

the state of the devtools addon code at that time could not be a simple import. The best way was to copy the code and leave a comment.

@WorldLanguages

Copy link
Copy Markdown
Member

the state of the devtools addon code at that time could not be a simple import.

That's what I thought, but it looks like that's not the case? Go to the commit I linked to, browse files, addons→editor-devtools→blockly and there it is, BlockFlasher.js!

@apple502j apple502j left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but has one question. (note to future self: reusing DevtoolsUtils could have issue on re-entering, so this code is correct)

}

_flash();
const { scrollBlockIntoView } = new DevtoolsUtils(addon);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheColaber Why assign?

@TheColaber

Copy link
Copy Markdown
Member Author

That's what I thought, but it looks like that's not the case? Go to the commit I linked to, browse files, addons→editor-devtools→blockly and there it is, BlockFlasher.js!

Well, I guess we didn't realize it.

@apple502j
apple502j merged commit 8175864 into ScratchAddons:master Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: 3 Medium priority. Includes bugs and useful features scope: addon Related to one or multiple addons type: bug A bug in the addon loader, or in a specific addon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug - Text areas

4 participants