Skip to content

Skip dynamic code: fields in multi-field no-label accessibility check#35

Merged
nonprofittechy merged 2 commits intomainfrom
copilot/fix-accessibility-error-dynamic-field
May 1, 2026
Merged

Skip dynamic code: fields in multi-field no-label accessibility check#35
nonprofittechy merged 2 commits intomainfrom
copilot/fix-accessibility-error-dynamic-field

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 1, 2026

A field entry of the form - code: | (dynamic code field) was incorrectly triggering the no-label-on-multi-field-screen accessibility error because it has no static label by design — its fields are generated at runtime.

Changes

  • accessibility.py_check_multifield_no_label_usage now skips any field entry that contains a "code" key, since these entries expand dynamically and cannot have a static label:
    for field in fields:
        if "code" in field:
            continue
  • tests/test_yaml_structure.py — adds a regression test covering a multi-field screen that mixes a - code: entry with normal labeled fields, asserting no accessibility error is raised.

Example that previously errored but should be valid:

fields:
  - code: |
      dynamic_fields()
  - What is the court county?: court_county
    choices:
      - Contra Costa
      - Alameda

Copilot AI changed the title [WIP] Fix accessibility error for dynamic code field without label Skip dynamic code: fields in multi-field no-label accessibility check May 1, 2026
Copilot AI requested a review from nonprofittechy May 1, 2026 19:24
@nonprofittechy nonprofittechy marked this pull request as ready for review May 1, 2026 19:27
@nonprofittechy nonprofittechy merged commit c6a102f into main May 1, 2026
4 checks passed
@nonprofittechy nonprofittechy deleted the copilot/fix-accessibility-error-dynamic-field branch May 1, 2026 19:28
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.

Ensure accessibility doesn't error on a dynamic code field without a label

2 participants