Repository navigation
Conflict with Scratch Tools (in general) and Scratch Addons: "insert blocks by name" #964
Copy link
Copy link
Open
Labels
status: needs reviewWaiting for further review.Waiting for further review.type: bugSomething isn't workingSomething isn't working
Description
Activity
- addedstatus: needs reviewWaiting for further review.Waiting for further review.type: bugSomething isn't workingSomething isn't working
on Sep 10, 2024 BlockTypeInfo.js:509 Uncaught TypeError: Cannot read properties of undefined (reading 'getAllVariableNamesInScopeByType') at BlockTypeInfo._createBlocks (BlockTypeInfo.js:509:48) at BlockTypeInfo.getBlocks (BlockTypeInfo.js:387:26) at openPopup (userscript.js:114:32) at Blockly.Gesture.doWorkspaceClick_ (userscript.js:448:79) at Blockly.Gesture.handleUp (projects.bundle.js:2:11379414) at HTMLDocument.s (projects.bundle.js:2:11997165) _createBlocks @ BlockTypeInfo.js:509 getBlocks @ BlockTypeInfo.js:387 openPopup @ userscript.js:114 Blockly.Gesture.doWorkspaceClick_ @ userscript.js:448 Blockly.Gesture.handleUp @ projects.bundle.js:2 s @ projects.bundle.js:2 projects.bundle.js:2 Trying to cancel a gesture recursively. projects.bundle.js:2 Trying to cancel a gesture recursively.ScratchAddons/ScratchAddons#7794 (comment)
The "Select Self" plugin seems to be the culprit. Please see the above discussion for a fuller explanation and the possible routes to a solution.
More data: "Select self", https://github.com/STForScratch/ScratchTools/blob/main/features/select-self/script.js, it seems, is adding menu items to certain blocks (that seem unrelated to adding self?!), for example,
_mouse_and_random_to theofblock, even though its code (below) appears to be attempting to only add "Stage" to the sensing block. (pure conjecture, I have no clue)let ORIGINAL_DATA = { motion_glideto_menu: [ ["random position", "_random_"], ["mouse-pointer", "_mouse_"], ], motion_goto_menu: [ ["random position", "_random_"], ["mouse-pointer", "_mouse_"], ], motion_pointtowards_menu: [["random position", "_random_"]], sensing_touchingobjectmenu: [ ["mouse-pointer", "_mouse_"], ["edge", "_edge_"], ], sensing_of_object_menu: [["Stage", "_stage_"]], sensing_distancetomenu: [["mouse-pointer", "_mouse_"]], };I have tested these blocks in a project, https://scratch.mit.edu/projects/1067296787/editor/, and I notice that:
- they only appear when "select self" plugin is active.
- things like x position of random or y position of mouse appear to be inoperative https://scratch.mit.edu/projects/1067296787/ at least as far as what my naive expectation of their function would be if intentional. I suspect these are not actually intended to be implemented? Or maybe they are, and somehow got replaced with Stage?
- In a project, starting with the default ~ of Stage and changing it to another value (sprite) makes the Stage value itself disappear and inaccessible.
Metadata
Metadata
Assignees
Labels
status: needs reviewWaiting for further review.Waiting for further review.type: bugSomething isn't workingSomething isn't working
Describe the bug. What is going wrong?
[ this is being crossposted to Scratch Tools.)
(I know compatibility is not supported, but am reporting since this indicates existence of a possible bug in SA as well)
It appears that something in scratchtools is in conflict with the scratchaddons “insert block by name” plugin, causing the mouse to be “locked”, i.e. moving the mouse moves the content of the block editor pane, but one can't click or otherwise get out.
What is causing the bug?
https://discord.com/channels/945340853189247016/1259626053601853460
Screen_Recording_2024-07-08_at_6.41.40_AM.mov
at the start of video, mouse is locked when attempting block insertion, and editor content is moving with mouse. restarting goes back to normal, allowing block suggestion popup, but subsequently locking again.
json:
my ST.json
my sa.json
from another user with same problem:
scratchtools-settings (2).json
scratch-addons-settings (2).json
version: SA 1.39.1 and ST .3.9
Chrome 128.0.6613.120 (Official Build) (x86_64)
Mac Sonoma
Anything else?
this has been crossposted to SA and discord.