Keyboard help tweaks#11413
Open
microbit-matt-hillsdon wants to merge 4 commits into
Open
Conversation
- Unify the Control modifier label on "Ctrl" (was a mix of "Ctrl" and "Control") with a "Control" aria-label so screen readers don't mangle "Ctrl" (which we've chosen for space). - Format the "Move anywhere" modifier as a key so it gets that label too. - Avoid showing the bare menu key for the context menu shortcut on Windows: prefer the first modifier-bearing shortcut (e.g. Ctrl+Enter) because not every keyboard has a menu key. The menu shortcut was new in v13.
It is a workspace toggle, not a global control, so it belongs there.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refines how keyboard shortcuts are displayed in the keyboard controls help UI, with a focus on accessibility and platform consistency across the PXT webapp.
Changes:
- Standardizes the Control modifier display to a compact
Ctrllabel (with a “Control” screen-reader label in the help UI). - Renders the “Move anywhere” modifier using the
<Key>UI so it gets consistent key styling/ARIA labeling. - Adjusts shortcut selection logic to avoid showing a bare Menu key for the context menu shortcut on Windows when an alternative modified shortcut exists.
Show a summary per file
| File | Description |
|---|---|
webapp/src/shortcut_formatting.ts |
Adds a shared Ctrl label constant and updates shortcut selection to prefer modifier-bearing variants over a bare Menu key. |
webapp/src/components/KeyboardControlsHelp.tsx |
Reuses the shared Ctrl label, renders “Move anywhere” modifier as a <Key>, and updates context menu row labeling/ordering. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unify the Control modifier label on "Ctrl" (was a mix of "Ctrl" and "Control") with a "Control" aria-label so screen readers don't mangle "Ctrl" (which we've chosen for space).
Format the "Move anywhere" modifier as a key so it gets that label too.
Avoid showing the bare menu key for the context menu shortcut on Windows: prefer the first modifier-bearing shortcut (e.g. Ctrl+Enter) because not every keyboard has a menu key. The menu shortcut was new in v13.