google / blockly

The web-based visual programming editor.
https://developers.google.com/blockly/
Apache License 2.0
12.52k stars 3.72k forks source link

refactor(shortcuts): Improve shortcut registry documentation & style #8598

Closed cpcallen closed 1 month ago

cpcallen commented 2 months ago

The basics

The details

Proposed Changes

Make some minor refactorings of shortcut_registry.ts to improve readability and style, and add documentation for the KeyboardShortcut interface type.

Reason for Changes

It was a bit harder than necessary to grok how this worked (ideally one should not need to read the source code!), so trying to make it easier for others / future self.

Test Coverage

Passes npm test + quick manual verification that shortcuts still work.

Documentation

Improved, hopefully.

cpcallen commented 1 month ago

@rachel-fenichel: You are a spelling-error-detecting machine—and evidently I need to figure out how to get emacs to give me wavy red underlines…