Thanks for the questions! Long answer ahead and I'm excited to discuss this topic further.
First-letter/type-ahead navigation: We strongly recommend that you have a search mechanism or category in your toolbox, particularly if you have a lot of different categories or blocks. There should definitely be some mechanism for quickly navigating to a specific block in the toolbox. (Personally, I think search is generally a better pattern than typeahead here.)
The App Inventor folks may also have thoughts.
When you ask about type-ahead are you thinking about jumping between categories or within blocks in the flyout?
Single-letter shortcuts: This one has been controversial!
> We provide text-based coding alongside block-based coding and want the keyboard controls between the two to feel cohesive - single characters to jump to the toolbox/editor don't fit that model.
Can I get a screenshot or gif to see what you mean?
> We also support blocks that embed a Monaco editor instance, which breaks the ability to use "t" to move to the toolbox while focus is inside the block.
This should be okay because the user has to commit their change to the text editor before switching back to moving around the workspace. It should be no different from a normal text input field.
> the real question is whether single-key shortcuts are the long-term direction, or something we should expect to evolve
Single-letter shortcuts are the long-term direction and I strongly encourage you to use the default shortcuts if you are able.
The reasons:
- Cross-platform compatibility: It's incredibly hard to come up with a set of keyboard shortcuts that work across OSes (Mac, Windows, Chromebook) and browsers (Chrome, Edge, Safari, Firefox). Maintaining a matrix of shortcuts for different OS+browser combinations is its own headache from both a technical standpoint and a user education standpoint.
- Manual dexterity: Typing with multi-key shortcuts requires extra manual dexterity, particularly if a child is in the hunt-and-peck stage of typing.
- Consistency across block-based programming environments: If you stick with the default shortcuts your users will be able to transfer knowledge in and out from using other environments.
Blockly's shortcuts meet the
WCAG 2.1.4 requirements because they are only active while the user interface component is focused. But I'm also looking at whether we want to have an option to turn off all single-key shortcuts. Applications may want to let users remap shortcuts, but that probably has to happen outside of the scope of Blockly to make it possible to save to a user's profile and not conflict with application-level shortcuts.
Reflow (WCAG 1.4.10): I invoke the exception for "content requiring two-dimensional layout" at the Blockly level but support experimentation at the application level.
Users definitely use the two-dimensional layout to represent code in ways that are relevant to them, such as in
this Scratch project where the scripts are positioned to be visible at the same time. Forced horizontal or forced vertical layout would make it harder to read the code and require the user to hold more state in their mind when reading or editing. It also means the drag distance required for edits goes up a lot.
However, applications can certainly choose to force vertical stacking (e.g. by automatically reflowing the blocks after every drag). That may be appropriate where the application wants to invoke text-coding norms. An intermediate approach is to point users to the "clean up" or "format" keyboard shortcut and reference it regularly in tutorials. (Personally, I hate formatters that change my code out from underneath me as I type.)
Cheers,
Rachel