fix: dont show workspace count on apple devices (#9939)

* fix: dont show workspace count on apple devices

* chore: format msg
This commit is contained in:
Maribeth Moffatt
2026-05-26 18:12:17 -04:00
committed by GitHub
parent 5d1097e58a
commit 46ac410723
4 changed files with 632 additions and 616 deletions
+11
View File
@@ -745,6 +745,17 @@ export class WorkspaceSvg
* Updates the label on the workspace to reflect the number of top-level stacks in the workspace.
*/
private updateAriaLabel() {
if (userAgent.APPLE) {
// VoiceOver is reading this label inappropriately, so don't show the
// stack count because it might be inaccurate.
// https://github.com/RaspberryPiFoundation/blockly/issues/9885
aria.setState(
this.svgGroup_,
aria.State.LABEL,
Msg['WORKSPACE_LABEL_PLAIN'],
);
return;
}
const numStacks = this.getTopBlocks(false).length;
if (numStacks == 1) {
aria.setState(
File diff suppressed because it is too large Load Diff
+1
View File
@@ -486,6 +486,7 @@
"KEYBOARD_NAV_CONSTRAINED_MOVE_HINT": "Message shown to inform users how to move blocks with the keyboard.",
"KEYBOARD_NAV_COPIED_HINT": "Message shown when an item is copied in keyboard navigation mode.",
"KEYBOARD_NAV_CUT_HINT": "Message shown when an item is cut in keyboard navigation mode.",
"WORKSPACE_LABEL_PLAIN": "Aria label for a workspace. Avoid using the name 'Blockly' as this could appear in branded products.",
"WORKSPACE_LABEL_1_STACK": "Aria label for a workspace with one stack of blocks.",
"WORKSPACE_LABEL_MANY_STACKS": "Aria label for a workspace with 0 or >1 stacks of blocks. \n\nParameters:\n* %1 - the number of stacks of blocks. A stack of blocks is a group of connected blocks that are not connected to any other blocks. 0 stacks means there are no blocks on the workspace.",
"WORKSPACE_LABEL_MUTATOR_WORKSPACE": "Aria label for a mutator workspace, which is a secondary workspace used for editing a block's structure. This type of workspace appears when a user clicks on the gear icon of a block that has a mutator, and allows the user to add, remove, or rearrange inputs to that block.",
+3
View File
@@ -1912,6 +1912,9 @@ Blockly.Msg.KEYBOARD_NAV_COPIED_HINT = 'Copied. Press %1 to paste.';
/// Message shown when an item is cut in keyboard navigation mode.
Blockly.Msg.KEYBOARD_NAV_CUT_HINT = 'Cut. Press %1 to paste.';
/** @type {string} */
/// Aria label for a workspace. Avoid using the name "Blockly" as this could appear in branded products.
Blockly.Msg.WORKSPACE_LABEL_PLAIN = 'Blocks workspace.';
/** @type {string} */
/// Aria label for a workspace with one stack of blocks.
Blockly.Msg.WORKSPACE_LABEL_1_STACK = 'Blocks workspace. 1 stack of blocks';
/** @type {string} */