Skip to content

feat: Display keyboard shortcuts in context menus#9785

Merged
gonfunko merged 4 commits into
v13from
menu-shortcuts
May 5, 2026
Merged

feat: Display keyboard shortcuts in context menus#9785
gonfunko merged 4 commits into
v13from
menu-shortcuts

Conversation

@gonfunko
Copy link
Copy Markdown
Contributor

@gonfunko gonfunko commented Apr 30, 2026

The basics

The details

Resolves

Fixes #9739

Proposed Changes

This PR displays keyboard shortcuts associated with context menu items in the context menu. Context menu items that perform the same action as a keyboard shortcut should add the name the shortcut is registered under to their associatedKeyboardShortcut field to inform Blockly of the relationship between them.

@gonfunko gonfunko requested a review from a team as a code owner April 30, 2026 21:25
@gonfunko gonfunko requested a review from maribethb April 30, 2026 21:25
@github-actions github-actions Bot added the PR: feature Adds a feature label Apr 30, 2026
@gonfunko
Copy link
Copy Markdown
Contributor Author

gonfunko commented May 1, 2026

Refactored this to use associatedKeyboardShortcut as described in #9739.

Copy link
Copy Markdown
Contributor

@maribethb maribethb left a comment

Choose a reason for hiding this comment

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

can you please also update the PR description to avoid referencing the compatibility table you refactored out, it makes the release notes confusing

Comment thread packages/blockly/core/contextmenu_registry.ts
Comment thread packages/blockly/core/contextmenu.ts Outdated
@github-actions github-actions Bot added PR: feature Adds a feature and removed PR: feature Adds a feature labels May 5, 2026
@gonfunko gonfunko requested a review from maribethb May 5, 2026 15:26
@gonfunko gonfunko merged commit b5a54b9 into v13 May 5, 2026
7 checks passed
@gonfunko gonfunko deleted the menu-shortcuts branch May 5, 2026 19:56
@microbit-robert
Copy link
Copy Markdown
Collaborator

@gonfunko A head's up that this causes aria-labels for context menu items to be '[object HTMLDivElement]' due to this fallback option of using String(this.content) which is now getting passed an HTML element instead of a string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: feature Adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants