Skip to content

i18n_audit: trace val-backed accessibility copy (#571) - #739

Merged
ryanbr merged 1 commit into
ryanbr:mainfrom
kavemang:fix/i18n-a11y-val-flow-571
Jul 23, 2026
Merged

ryanbr merged 1 commit into
ryanbr:mainfrom
kavemang:fix/i18n-a11y-val-flow-571

Conversation

@kavemang

Copy link
Copy Markdown

Closes #571.

What changed

  • Follow a bare contentDescription = name reference to the nearest lexically visible val name = ... initializer.
  • Bound initializer scanning across balanced expressions and explicit Kotlin line continuations without sweeping later statements or unrelated Compose lambdas.
  • Add regression coverage for the reported CoupledScreen shape, parameters, sibling scopes, local shadowing, statement bounds, and multiline concatenation.
  • Refresh the audit baseline with 24 newly visible accessibility literals across eight Android files, including the three reported in CoupledScreen.kt.

Why

#581 taught the Android audit to see literals assigned directly inside a semantics {} lambda, but it still saw no literal when a local variable carried the copy:

val a11y = when { ... }
Modifier.semantics { contentDescription = a11y }

This adds deliberately narrow lexical flow for that remaining #571 case. Pass-through parameters, arbitrary expressions, declarations in sibling scopes, and shadowed outer values are not followed.

Validation

  • cd Tools && python3 -m unittest test_i18n_audit -v — 34/34 passed
  • python3 Tools/i18n_audit.py --ci origin/main — passed; Android baseline 213, Apple baseline 64
  • git diff --check — passed

@kavemang
kavemang marked this pull request as ready for review July 23, 2026 06:03
@ryanbr
ryanbr merged commit fed0b53 into ryanbr:main Jul 23, 2026
1 check passed
simoncad7 pushed a commit to simoncad7/noop that referenced this pull request Aug 17, 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.

i18n audit: contentDescription set inside a semantics {} lambda is still invisible (a11y copy stays English)

2 participants