Skip to content

fix: [SDK-4897] add accessible name to subscription bell launcher button#1478

Merged
sherwinski merged 3 commits into
mainfrom
sherwin/sdk-4897
Jul 22, 2026
Merged

fix: [SDK-4897] add accessible name to subscription bell launcher button#1478
sherwinski merged 3 commits into
mainfrom
sherwin/sdk-4897

Conversation

@sherwinski

Copy link
Copy Markdown
Contributor

Description

1 Line Summary

Add a default, configurable aria-label to the Subscription Bell launcher button so it has an accessible name and no longer fails accessibility audits.

Details

The bell launcher is an icon-only <button> with no text content and no aria-label, so automated accessibility audits (Lighthouse/PageSpeed, axe) report "Buttons must have discernible text" on every customer site that enables the bell. Screen-reader users and agentic browsers relying on the accessibility tree cannot identify the control. Reported by an EU public-sector customer subject to the EU Web Accessibility Directive (WCAG 2.1 AA).

Changes:

  • The launcher button now gets aria-label="Manage notifications" by default when the bell is created.
  • The label is configurable and localizable via the existing bell text config: notifyButton: { text: { 'launcher.label': '...' } } (new optional BellText key).
  • The decorative bell SVG inside the button is marked aria-hidden="true" so it doesn't leak into the accessibility tree.
  • Message._getTipForState gained a ?? '' fallback because the new optional key widened the text lookup type.
  • The gzipped page.es6.js size limit was bumped 42.65 kB → 42.7 kB; the limit only had ~10 B of headroom on main and this change adds ~50 B.

Other icon-only controls were audited per the ticket: the dialog's subscribe/unsubscribe buttons already have visible text and the dialog is a light-dismiss popover with no close button, so the launcher was the only control needing a name.

Systems Affected

  • WebSDK
  • Backend
  • Dashboard

Validation

Tests

Info

  • New unit tests in Bell.test.ts cover the default label, a custom localized label via text config, and the SVG being hidden from the accessibility tree.
  • vp check, full test suite (526 tests), and build:prod (size-limit + bundle API validation) all pass.

Checklist

  • All the automated tests pass or I explained why that is not possible
  • I have personally tested this on my machine or explained why that is not possible
  • I have included test coverage for these changes or explained why they are not needed

Programming Checklist
Interfaces:

  • Don't use default export
  • New interfaces are in model files

Functions:

  • Don't use default export
  • All function signatures have return types
  • Helpers should not access any data but rather be given the data to operate on.

Typescript:

  • No Typescript warnings
  • Avoid silencing null/undefined warnings with the exclamation point

Other:

  • Iteration: refrain from using elem of array syntax. Prefer forEach or use map
  • Avoid using global OneSignal accessor for context if possible. Instead, we can pass it to function/constructor so that we don't call OneSignal.context

Screenshots

Info

Not needed — no visual change; the only DOM difference is the aria-label attribute and aria-hidden on the SVG.

Checklist

  • I have included screenshots/recordings of the intended results or explained why they are not needed

Related Tickets

SDK-4897


The bell launcher is an icon-only button with no discernible text, so
customer sites fail accessibility audits ("Buttons must have discernible
text"). Add a default aria-label, configurable and localizable via the
existing bell text config as 'launcher.label', and hide the decorative
bell SVG from the accessibility tree.
@sherwinski

Copy link
Copy Markdown
Contributor Author

@claude review once

@sherwinski
sherwinski requested a review from fadi-george July 22, 2026 19:55
Comment thread src/page/bell/Bell.ts
Comment thread src/page/bell/Bell.ts Outdated
Comment thread src/shared/prompts/types.ts Outdated
Comment thread src/shared/prompts/types.ts Outdated
@fadi-george

Copy link
Copy Markdown
Contributor

Ill guess well also need mintlify docs changes later for new label

The key never renders visible text, unlike other BellText keys, so
name it after the attribute it populates to avoid ambiguity.
@sherwinski
sherwinski requested a review from fadi-george July 22, 2026 21:23
@sherwinski
sherwinski merged commit 36ef591 into main Jul 22, 2026
3 checks passed
@sherwinski
sherwinski deleted the sherwin/sdk-4897 branch July 22, 2026 21:39
@github-actions github-actions Bot mentioned this pull request Jul 22, 2026
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.

2 participants