Skip to content

chore: add accessibility guidelines to AGENTS.md - WPB-26264#4830

Open
David-Henner wants to merge 2 commits into
developfrom
chore/accessibility-instructions-WPB-26264
Open

chore: add accessibility guidelines to AGENTS.md - WPB-26264#4830
David-Henner wants to merge 2 commits into
developfrom
chore/accessibility-instructions-WPB-26264

Conversation

@David-Henner

@David-Henner David-Henner commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
TaskWPB-26264 [iOS] Add accessibility instructions to AGENTS.md

This PR expands AGENTS.md with a dedicated Accessibility section, consolidating the checklist from the internal development guide so it is discoverable alongside the rest of the project conventions.

Testing

Review the AGENTS.md diff — no functional code changes.


Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Make sure you use the API for UI elements that support large fonts.
  • All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
  • New UI elements have Accessibility strings for VoiceOver.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit b4c1d43.

♻️ This comment has been updated with latest results.

Summary: workflow run #27215479855

Comment thread AGENTS.md
- New UI elements require `accessibilityLabel` for VoiceOver / `accessibilityIdentifier` for UI tests
- Push notifications only work with the App Store-signed build (Apple security restriction)

## Accessibility

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought: I wonder if this section can be pulled into context on demand so we don't stuff too much info in the context. Not sure how big should be this file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pasting Claude's opinion on this


With a 1M context window, AGENTS.md is essentially free — even at 100× its current size (600 KB) it would only consume ~150K tokens. The context window is not the binding constraint here.

The practical limits are different:

Human readability — AGENTS.md is read by engineers, not just the AI. Once it exceeds ~300–400 lines it becomes hard to scan and maintain. That's probably the real ceiling (~15–20 KB).

Signal dilution — the longer it gets, the more the AI has to weight competing instructions. Dense, specific rules work better than long explanations. The accessibility section we just added is already on the edge of this — it's detailed because the topic is complex, but adding many more sections like it would start to dilute the more critical conventions at the top.

What to watch for — if you find yourself adding large "how-to" or tutorial content to AGENTS.md, that's a sign it belongs in a separate skill or referenced doc instead. AGENTS.md should stay as a checklist/ruleset, not a guide.

At the current growth rate, you have plenty of room — but keep sections tight.

@netbe netbe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM;) left some comment

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md
- Back buttons must describe the destination (e.g. "Go back to Settings", not just "Back")

### Dynamic content
- When content changes dynamically (list updates, search results, state transitions), post a UIAccessibility notification:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: I would advise caution with these examples. I understand that these were generated by AI using our code, but UIAccessibility notifications are very legacy code, and we've never properly tested them. We should also pay attention to AI-generated suggestions.
We don't have a process for testing accessibility features, and placing UIAccessibility notifications everywhere could reduce the usability of the app with VoiceOver. We currently have a working scenario that announces a new message if the user is in conversation view.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did use AI to generate this but I've tried to be as close to our guidelines as possible by leaning heavily on this document https://wearezeta.atlassian.net/wiki/spaces/IOS/pages/654475313/Development+guide.

If you're saying UIAccessibility notifications aren't reliable, I'll happily remove this section

Comment thread AGENTS.md
- When a container element expresses the full meaning, hide its children and set the label/trait/hint on the container (use `.accessibilityElement(children: .ignore)` in SwiftUI)

### Navigation bar
- All navigation bar buttons must have alternative text

@KaterinaWire KaterinaWire Jun 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: I wouldn't use "All navigation bar buttons", because some of them as "Next", "Start", etc. maybe don't need it. When defining them, we should always collaborate with the product team.

Comment thread AGENTS.md
- Combine traits when needed (e.g. `.button` + `.selected` for a selected toggleable button)

### Hiding elements
- Hide purely decorative elements with `accessibilityHidden(true)` / `isAccessibilityElement = false`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: "purely decorative elements" is a very subjective definition. Perhaps examples or an explanation of how this phrase might be used in a real-life situation are needed.

Comment thread AGENTS.md
### Dynamic type
- UI elements that display text must use the API that supports dynamic type / large fonts
- Push notifications only work with the App Store-signed build (Apple security restriction) No newline at end of file
- Test with the largest accessibility font size (Settings → Accessibility → Larger Text) No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: We also have snapshot tests for dynamic text. You can mention them here.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md
- Set `accessibilityHint` to describe the result of an action (e.g. "Double tap to open profile"); omit it when the label already makes the outcome obvious
- Set `accessibilityValue` for elements with dynamic state (e.g. a text field's current content)
- VoiceOver reads in order: **label → value → trait → hint**
- Put all VoiceOver strings in `Accessibility.strings`, not `Localizable.strings`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: The Accessibility.strings files also have a naming structure, you can specify it here.

Comment thread AGENTS.md
Every new screen or UI element must pass the following checklist before merging:

### Identifiers and labels
- Set `accessibilityIdentifier` on every new element — **never remove existing ones** (QA automation depends on them)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Do we have a separate file for accessibilityIdentifier? If so, we can add it here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what you mean

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WireUI -> ... -> Locators
I think @findms created this file for accessibilityIdentifier which are used for automation tests.

Comment thread AGENTS.md Outdated
Co-authored-by: François Benaiteau <netbe@users.noreply.github.com>
Co-authored-by: David-Henner <david.henner@wire.com>
@sonarqubecloud

sonarqubecloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

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.

3 participants