Skip to content

a11y: flatten interactive nesting (restore localized aria-label)#113

Merged
JohnMcLear merged 1 commit intomasterfrom
a11y/flatten-button-pattern
May 10, 2026
Merged

a11y: flatten interactive nesting (restore localized aria-label)#113
JohnMcLear merged 1 commit intomasterfrom
a11y/flatten-button-pattern

Conversation

@JohnMcLear
Copy link
Copy Markdown
Member

Summary

Flattens nested toolbar markup to a single <a role="button" tabindex="0"> carrying the icon classes. With no element children (or with a recognized attribute suffix in data-l10n-id), etherpad's html10n auto-populates aria-label from the localized string per html10n.ts:665-678.

Why this PR exists: the earlier Phase 3a sweep removed hardcoded aria-label="…" on toolbar buttons that have element children (<span>/<button>) and a data-l10n-id without a recognized attribute suffix (.title/.alt/.value/.placeholder). For those elements, html10n skips its auto-population path, so they ended up with no accessible name. Flattening the structure makes the auto-population fire.

Flattens nested <a>/<button>/<span> wrappers to a single <a> carrying
the icon classes plus role="button"/tabindex="0". With no element
children (or with data-l10n-id ending in a recognized attribute
suffix), etherpad's html10n auto-populates aria-label from the
localized translation per html10n.ts:665-678.

Restores screen-reader accessibility lost in the Phase 3a aria-label
sweep, where elements with element children plus a non-suffix
data-l10n-id ended up with no accessible name.
@qodo-code-review
Copy link
Copy Markdown

ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one.

@JohnMcLear JohnMcLear merged commit 784c879 into master May 10, 2026
3 checks passed
@JohnMcLear JohnMcLear deleted the a11y/flatten-button-pattern branch May 10, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant