Skip to content
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

Remove navigation #4593

Merged
merged 24 commits into from
Jan 19, 2021
Merged

Remove navigation #4593

merged 24 commits into from
Jan 19, 2021

Conversation

alschmiedt
Copy link
Contributor

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide

The details

Resolves

Proposed Changes

Removes keyboard navigation from core.

Reason for Changes

We will be offering keyboard navigation as a plugin.

Test Coverage

Tested on:

Documentation

Additional Information

* @type {function(!Blockly.ShortcutRegistry.KeyboardShortcut):boolean}
* @public
*/
Blockly.Toolbox.prototype.onShortcut;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since onShortcut isn't implemented, doesn't that mean that this class isn't properly implementing the IKeyboardAccessible interface?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are correct. I added a function that returns false. This mirrors what I do with Blockly.Field.

@@ -27,7 +25,6 @@ goog.requireType('Blockly.ShortcutRegistry');
* A cursor controls how a user navigates the Blockly AST.
* @constructor
* @extends {Blockly.Marker}
* @implements {Blockly.IBlocklyActionable}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it correct that this class isn't going to implement IKeyboardAccessible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, the main reason we had onAction on the cursor was so someone could easily add a shortcut. The shortcut registry makes this easy without onAction being necessary.


/**
* Handles the given action.
* @param {!Blockly.ShortcutRegistry.KeyboardShortcut} action The action to be handled.
* @return {boolean} True if the action has been handled, false otherwise.
*/
Blockly.IBlocklyActionable.prototype.onBlocklyAction;
Blockly.IKeyboardAccessible.prototype.onShortcut;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me why this was renamed to onShortcut.
Related, it might help to reword the JSDoc since it's not longer called on action.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The keyboard shortcut registry replaced the idea of Blockly.Actions, so it makes more sense now to have these handlers be named onShortcut instead of onAction.

Yup, good catch.

core/marker_manager.js Show resolved Hide resolved
@alschmiedt alschmiedt merged commit a3adc42 into google:develop Jan 19, 2021
@alschmiedt alschmiedt added the breaking change Used to mark a PR or issue that changes our public APIs. label Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Used to mark a PR or issue that changes our public APIs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants