fix: Dispatch keyboard events with the workspace they occurred on. by gonfunko · Pull Request #9137 · RaspberryPiFoundation/blockly
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be able to move the entire globalShortcutHandler function to a different file, and then update the internal usages (it is @internal) to use the new location instead of common.js. There shouldn't be any circular dependencies within just that function.
I think that is a pretty straightforward fix and then we can avoid putting this for loop check in, and we can make the shortcuts work correctly for the toolbox case as well. common.js is already a mess with the opportunity to easily add circular dependencies, so I really don't want to create this very easy opportunity to add one in a future refactoring pass. If this approach doesn't work or isn't as straightforward as I think it is though, then we can live with what you have now and file an issue to clean it up. Does that work for you?