-
Notifications
You must be signed in to change notification settings - Fork 594
Upgrade to latest Blockly keyboard navigation plugin #10512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to latest Blockly keyboard navigation plugin #10512
Conversation
Temporarily based on a micro:bit team upgrade-blockly-12 branch. - Remove toolbox tab stops; use arrow keys for toolbox nav - Add skip link for the workspace when keyboard nav is enabled - Keyboard navigation plugin is using a tar file for now but we'll ask Blockly for a release soon and update - Remove second step to enable keyboard nav after enabling the experiment, the objective is always enabled keyboard nav. - Blockers: - [ ] MakeCode copy/paste modifications are disabled to prevent conflict, next step needs discussion - [ ] Caching flyout is used, sidestepping caching, to avoid breaking Blockly assumptions that the flyout / flyout workspace doesn't change over time. Caching is valuable though, need to explore reinstating perhaps at a different level. - [ ] Focus outlines for the workspace need discussion and are currently incorrectly showing for some mouse interactions. Maybe OK for the experiment but not for enabled by default.
The connection lines are rendered incorrectly when moving blocks via keyboard, which use underlying drag methods. Easier to disable them than to try and get the right coords.
b8bf9fe
to
4a542e9
Compare
webapp/src/blocks.tsx
Outdated
const injectionDiv = document.getElementById('blocksEditor'); | ||
injectionDiv.classList.add("accessibleBlocks"); | ||
const focusRingDiv = injectionDiv.appendChild(document.createElement("div")) | ||
focusRingDiv.className = "blocklyWorkspaceFocusRingLayer"; | ||
this.editor.getSvgGroup().addEventListener("focus", () => { | ||
focusRingDiv.dataset.focused = "true"; | ||
}) | ||
this.editor.getSvgGroup().addEventListener("blur", () => { | ||
delete focusRingDiv.dataset.focused; | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gives a more reasonable focus ring for the workspace, one that isn't occluded on the left hand side by the toolbox. We should discuss this with Blockly and potentially move the behaviour to the plugin (maybe with options for a better implementation).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are continuing to have discussions regarding the focus indicators, but we propose moving forward with this change for this initial PR.
Agreed to restructure this around a setting rather than an experiment. Setting can reload the page. |
re: copy/paste, i assume this means the blockly plugin is also broken? seems like this should be something tackled by the blockly team. for now, your suggestion of disabling it when the experiment is active seems like an acceptable temporary solution i'll look into a plan for the flyout |
This copies over some internals from the Blockly keyboard experimentation plugin and modifies them to suite our needs. We would welcome suggestions from Blockly regarding a more concrete solution.
Stop gap for cut/copy/paste conflicts with MakeCode
Yes, we think it has the same issue. We've now disabled the custom copy/paste overrides in MakeCode if the keyboard nav plugin is enabled as a temporary work around. We explored whether the copy/paste behaviour in the keyboard nav plugin could be implemented in MakeCode, but it requires access to internals. We will raise this with the Blockly team to get their view on the best solution @rachel-fenichel. |
This replaces 'c' to clean up workspace
This PR is now in a state where it can be reviewed. Blockers have been addressed and the related follow-up issues will be tackled in follow-up PRs. |
Just highlighting that the keyboard navigation plugin is at a somewhat arbitrary point in its development. Blocks inserted from the flyout are currently inserted in 'move mode', but this is not clear in this version. A move icon has been added since, but is not in this released version. You will need to hit "Enter" to confirm the block position before doing anything else. I've added some information about the keyboard controls below, but expect this PR to be more about the integration, than the plugin behaviour itself as this will change with updates going forward. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks pretty good! just some minor comments
@microbit-matt-hillsdon here is an uploaded build with the changes from this PR: https://makecode.microbit.org/app/5b64f555bd29c0c75350023549b02a28cb03c1b0-74c00c13f3 |
We are opening this PR in draft mainly for visibility at this point. This PR has now been rebased on master after the upgrade to Blockly v12.0.0-beta.4, on which the new keyboard navigation plugin depends.
Link to demo. Please note that 'accessible blocks' need to be set to 'on' in the settings menu.
A summary of changes and blockers to the plugin upgrade are listed below:
Resolved blockers
Follow-up issues:
@riknoll @microbit-matt-hillsdon
Closes #10464