Skip to content

Origami/ogm 4698 fix accessibility issue for link button - #2846

Open
Ivaylo Dimitrov (EGFireball) wants to merge 4 commits into
mainfrom
origami/OGM-4698-fix-accessibility-issue-for-link-button
Open

Ivaylo Dimitrov (EGFireball) wants to merge 4 commits into
mainfrom
origami/OGM-4698-fix-accessibility-issue-for-link-button

Conversation

@EGFireball

@EGFireball Ivaylo Dimitrov (EGFireball) commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes OGM-4698

What

  • BpkLink (Compose): Replace LinkAnnotation.Clickable with
    LinkAnnotation.Url in BpkLinkImpl. Clickable exposes no role to
    the accessibility tree; Url automatically exposes Role.Link, so
    TalkBack now announces inline links as "Link" rather than as a generic
    operable element with no role.

Why

WCAG 4.1.2 (Name, Role, Value) requires that the role of every UI
component is programmatically determinable. An accessibility audit on the
"We Value Your Privacy" consent screen identified that the Cookie Policy
link had no announced role when using TalkBack.

Testing

  • Manually verified with TalkBack on the Link → Default story in the
    Backpack demo app.
  • Screenshot baselines updated via recordScreenshots.

@EGFireball Ivaylo Dimitrov (EGFireball) added patch A backwards compatible change/fix bpk Label used for backpack dependency updates labels Oct 1, 2026
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor
Warnings
⚠️ One or more component files were updated, but the tests weren't updated. If your change is not covered by existing tests please add snapshot tests.
⚠️

One or more component files were updated, but README.md wasn't updated. If your change contains API changes/additions or a new component please update the relevant component README.

Generated by 🚫 Danger Kotlin against ae53bf1

@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor
Warnings
⚠️ One or more component files were updated, but the tests weren't updated. If your change is not covered by existing tests please add snapshot tests.
⚠️

One or more component files were updated, but README.md wasn't updated. If your change contains API changes/additions or a new component please update the relevant component README.

Generated by 🚫 Danger Kotlin against 780458d

Copilot AI left a comment

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 2 High severity

Open (2)
What changed in this PR

Updates the Compose link implementation to improve accessibility by using URL-based link annotations rather than custom clickable tags.

Changes:

  • Switches from LinkAnnotation.Clickable(tag=...) to LinkAnnotation.Url(url=...) for link spans.
  • Removes per-link index/tag generation in favor of URL annotations.
  • Tightens link creation condition to require both link text and URL.
File Description
backpack-compose/​src/​main/​kotlin/​net/​skyscanner/​backpack/​compose/​link/​internal/​BpkLinkImpl.kt Reworks how markdown links are converted into annotated text to use URL link annotations (accessibility-related).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@EGFireball
Ivaylo Dimitrov (EGFireball) force-pushed the origami/OGM-4698-fix-accessibility-issue-for-link-button branch from 780458d to 5efb21f Compare October 2, 2026 07:04
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor
Warnings
⚠️ One or more component files were updated, but the tests weren't updated. If your change is not covered by existing tests please add snapshot tests.
⚠️

One or more component files were updated, but README.md wasn't updated. If your change contains API changes/additions or a new component please update the relevant component README.

Generated by 🚫 Danger Kotlin against 5efb21f

@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor
Warnings
⚠️ One or more component files were updated, but the tests weren't updated. If your change is not covered by existing tests please add snapshot tests.
⚠️

One or more component files were updated, but README.md wasn't updated. If your change contains API changes/additions or a new component please update the relevant component README.

Generated by 🚫 Danger Kotlin against a6880f0

@EGFireball
Ivaylo Dimitrov (EGFireball) marked this pull request as ready for review October 2, 2026 07:29
}
}
} else {
AppendRawText(textColor, match.value)

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.

This seems to be just adding the () as seen in the screenshot tests.


if (linkText.isNotEmpty() || url.isNotEmpty()) {
val linkAnnotation = LinkAnnotation.Clickable(
tag = "LINK_$linkIndex",

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.

Be good to keep the tag although not sure if its used anywhere.

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.

The tag parameter is specific to LinkAnnotation.Clickable. LinkAnnotation.Url doesn't support it, so it can't be carried over.

val linkAnnotation = LinkAnnotation.Clickable(
tag = "LINK_$linkIndex",
if (linkText.isNotEmpty() && url.isNotEmpty()) {
val linkAnnotation = LinkAnnotation.Url(

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.

From what I can see in the docs this shouldn't make any difference from clickable? I think it just attempts to open the URI directly first rather than call the linkInteraction listener.

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.

The reason for switching is purely for accessibility purposes. The LinkAnnotation.Url exposes Role, while Clickable exposes no role at all. That's the WCAG 4.1.2 violation we're fixing - the Cookie Policy link on the consent screen was being focused by TalkBack with no announced role.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bpk Label used for backpack dependency updates patch A backwards compatible change/fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants