Skip to content

feat: add accessibility labels to torch and cancel buttons#55

Merged
alexgerardojacinto merged 8 commits into
mainfrom
feat/RMET-5194/alternate-text
Jul 3, 2026
Merged

feat: add accessibility labels to torch and cancel buttons#55
alexgerardojacinto merged 8 commits into
mainfrom
feat/RMET-5194/alternate-text

Conversation

@alexgerardojacinto

@alexgerardojacinto alexgerardojacinto commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

⚠️ This PR was done with the help of Claude

Description

The Torch and Cancel buttons are icon-only with no alternative text, so screen readers can't announce them. This PR adds the ability to set that alternative text.

  • Adds three optional scan parameters that set the content description (alternative text) read by screen readers:
    • cancelButtonAccessibilityLabel
    • torchButtonOnAccessibilityLabel (torch on)
    • torchButtonOffAccessibilityLabel (torch off)
  • The torch label is state-aware (on vs off).
  • When a label is not provided (null/blank), no content description is set — behavior is identical to before this change. The labels are therefore fully opt-in and backward compatible; the consumer (e.g. the OutSystems plugin layer) supplies them, already localized.

Context

An accessibility audit flagged that the Torch and Cancel buttons have no alternative text, so they are announced incorrectly by screen readers. This exposes the labels as inputs so consumers can provide localized alternative text.

Closes #54

Type of changes

  • Fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Refactor (cosmetic changes)
  • Breaking change (change that would cause existing functionality to not work as expected)

Platforms affected

  • Android
  • iOS
  • JavaScript

Tests

  • Verified on device (Pixel) with TalkBack: provided labels are announced; with no labels the buttons behave as before (no label).
  • Tested Cordova plugin with MABS builds:
  • Tested Capacitor plugin with Capacitor sample app available in the Capacitor plugin's repo.

Screenshots (if appropriate)

N/A

Checklist

  • Pull request title follows the format `RNMT-XXXX <title>`
  • Code follows code style of this project
  • CHANGELOG.md file is correctly updated
  • Changes require an update to the documentation
    • Documentation has been updated accordingly

The torch and cancel buttons were icon-only with no alternative text,
so screen readers could not announce them.

Add default English content descriptions and expose optional
cancelButtonAccessibilityLabel, torchButtonOnAccessibilityLabel and
torchButtonOffAccessibilityLabel scan parameters so consumers can
customize/localize them.

Closes #54
When a label is not provided (null/blank), no content description is set,
keeping the previous behavior unchanged. The English default labels are
removed; consumers supply the (localized) labels via the scan parameters.
@alexgerardojacinto
alexgerardojacinto marked this pull request as ready for review June 17, 2026 14:42
@alexgerardojacinto
alexgerardojacinto requested a review from a team as a code owner June 17, 2026 14:42
@OS-pedrogustavobilro OS-pedrogustavobilro self-assigned this Jun 23, 2026
Not being used these days, might as well comment to see if CI passes
OS-pedrogustavobilro added a commit that referenced this pull request Jun 26, 2026
* fix: prevent Expanded Dark Theme inversion on scanner activity

Adds an AppCompat DayNight theme to `OSBARCScannerActivity` so Android does not treat it as a legacy light-themed app and invert its colors when Expanded Dark Theme is enabled.

References: https://outsystemsrd.atlassian.net/browse/RMET-5280

* chore(release): prepare for version 2.0.2

Might be 2.1.0 instead if we bundle with #55; depends on merge order / time.

* ci: comment failing Sonarcloud step

Not being used these days, might as well comment to see if CI passes

* docs: Remove unnecessary section from PR template

* refactor: Change AppCompat to Material3 theme

Following PR comment #56 (comment)

* chore: revert to AppCompat due to apk size increase

#56 (comment)
@alexgerardojacinto
alexgerardojacinto merged commit 37c714e into main Jul 3, 2026
8 checks passed
@alexgerardojacinto
alexgerardojacinto deleted the feat/RMET-5194/alternate-text branch July 3, 2026 11:48
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.

Missing alternative text on Cancel and Torch buttons

2 participants