Skip to content

fix: Keep workspace stack count fresh instead of hiding it on Mac/VoiceOver#10033

Open
microbit-matt-hillsdon wants to merge 1 commit into
RaspberryPiFoundation:mainfrom
microbit-matt-hillsdon:fix-stale-stack-counts
Open

fix: Keep workspace stack count fresh instead of hiding it on Mac/VoiceOver#10033
microbit-matt-hillsdon wants to merge 1 commit into
RaspberryPiFoundation:mainfrom
microbit-matt-hillsdon:fix-stale-stack-counts

Conversation

@microbit-matt-hillsdon

Copy link
Copy Markdown
Collaborator

Screen readers read the workspace's region label when its contents are focused, but updateAriaLabel only ran on the workspace node's own focus. When a child block took focus on first entry the label was never refreshed, so a stale stack count (e.g. "0 stacks") was announced. The previous workaround dropped the count entirely on Apple.

Refresh the label in onTreeFocus, which fires whenever focus enters the workspace tree (including via a child), before the element is focused, so the announced count is current. This lets us restore the informative stack count on all platforms.

The basics

The details

Resolves

This fixes only part 1 of this issue as described in this comment #9885 (comment)

Proposed Changes

Refresh the label in onTreeFocus, which fires whenever focus enters the workspace tree (including via a child), before the element is focused, so the announced count is current. This lets us restore the informative stack count on all platforms.

Reason for Changes

This isn't Mac specific, other screen readers also output region context when focusing nodes in the region.

Test Coverage

Documentation

Additional Information

…aspberryPiFoundation#9885)

Screen readers read the workspace's region label when its contents are
focused, but updateAriaLabel only ran on the workspace node's own focus.
When a child block took focus on first entry the label was never
refreshed, so a stale stack count (e.g. "0 stacks") was announced. The
previous workaround dropped the count entirely on Apple.

Refresh the label in onTreeFocus, which fires whenever focus enters the
workspace tree (including via a child), before the element is focused, so
the announced count is current. This lets us restore the informative
stack count on all platforms.
@microbit-matt-hillsdon

Copy link
Copy Markdown
Collaborator Author

This orphans WORKSPACE_LABEL_PLAIN but it seems prudent to keep it around.

@microbit-matt-hillsdon microbit-matt-hillsdon changed the title fix: Keep workspace stack count fresh instead of hiding it on Apple fix: Keep workspace stack count fresh instead of hiding it on Mac/VoiceOver Jun 18, 2026
@github-actions github-actions Bot added PR: fix Fixes a bug and removed PR: fix Fixes a bug labels Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants