Skip to content

Commit 1dd7701

Browse files
authored
fix: Add a label to the toolbox. (#9378)
1 parent 346716a commit 1dd7701

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

core/toolbox/toolbox.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {isSelectableToolboxItem} from '../interfaces/i_selectable_toolbox_item.j
3535
import type {IStyleable} from '../interfaces/i_styleable.js';
3636
import type {IToolbox} from '../interfaces/i_toolbox.js';
3737
import type {IToolboxItem} from '../interfaces/i_toolbox_item.js';
38+
import {Msg} from '../msg.js';
3839
import * as registry from '../registry.js';
3940
import type {KeyboardShortcut} from '../shortcut_registry.js';
4041
import * as Touch from '../touch.js';
@@ -154,6 +155,7 @@ export class Toolbox
154155
this.flyout.init(workspace);
155156

156157
aria.setRole(this.HtmlDiv, aria.Role.TREE);
158+
aria.setState(this.HtmlDiv, aria.State.LABEL, Msg['TOOLBOX_ARIA_LABEL']);
157159

158160
this.render(this.toolboxDef_);
159161
const themeManager = workspace.getThemeManager();

msg/json/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"@metadata": {
33
"author": "Ellen Spertus <[email protected]>",
4-
"lastupdated": "2025-09-09 09:40:56.729862",
4+
"lastupdated": "2025-09-22 11:22:54.733649",
55
"locale": "en",
66
"messagedocumentation" : "qqq"
77
},
@@ -396,6 +396,7 @@
396396
"PROCEDURES_IFRETURN_WARNING": "Warning: This block may be used only within a function definition.",
397397
"WORKSPACE_COMMENT_DEFAULT_TEXT": "Say something...",
398398
"WORKSPACE_ARIA_LABEL": "Blockly Workspace",
399+
"TOOLBOX_ARIA_LABEL": "Toolbox",
399400
"COLLAPSED_WARNINGS_WARNING": "Collapsed blocks contain warnings.",
400401
"DIALOG_OK": "OK",
401402
"DIALOG_CANCEL": "Cancel",

msg/json/qqq.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@
403403
"PROCEDURES_IFRETURN_WARNING": "warning - This appears if the user tries to use this block outside of a function definition.",
404404
"WORKSPACE_COMMENT_DEFAULT_TEXT": "comment text - This text appears in a new workspace comment, to hint that the user can type here.",
405405
"WORKSPACE_ARIA_LABEL": "workspace - This text is read out when a user navigates to the workspace while using a screen reader.",
406+
"TOOLBOX_ARIA_LABEL": "This text is read out when a user navigates to the toolbox while using a screen reader.",
406407
"COLLAPSED_WARNINGS_WARNING": "warning - This appears if the user collapses a block, and blocks inside that block have warnings attached to them. It should inform the user that the block they collapsed contains blocks that have warnings.",
407408
"DIALOG_OK": "button label - Pressing this button closes help information.\n{{Identical|OK}}",
408409
"DIALOG_CANCEL": "button label - Pressing this button cancels a proposed action.\n{{Identical|Cancel}}",

msg/messages.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1607,6 +1607,11 @@ Blockly.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT = 'Say something...';
16071607
/// using a screen reader.
16081608
Blockly.Msg.WORKSPACE_ARIA_LABEL = 'Blockly Workspace';
16091609

1610+
/** @type {string} */
1611+
/// This text is read out when a user navigates to the toolbox while using a
1612+
/// screen reader.
1613+
Blockly.Msg.TOOLBOX_ARIA_LABEL = 'Toolbox';
1614+
16101615
/** @type {string} */
16111616
/// warning - This appears if the user collapses a block, and blocks inside
16121617
/// that block have warnings attached to them. It should inform the user that the
@@ -1629,7 +1634,7 @@ Blockly.Msg.EDIT_BLOCK_CONTENTS = 'Edit Block contents';
16291634
/// menu label - Contextual menu item that starts a keyboard-driven block move.
16301635
Blockly.Msg.MOVE_BLOCK = 'Move Block';
16311636
/** @type {string} */
1632-
/// Name of the Microsoft Windows operating system displayed in a list of
1637+
/// Name of the Microsoft Windows operating system displayed in a list of
16331638
/// keyboard shortcuts.
16341639
Blockly.Msg.WINDOWS = 'Windows';
16351640
/** @type {string} */

0 commit comments

Comments
 (0)