Skip to content

Conversation

pedromassango
Copy link
Member

Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.

Continuation of #9815

Fixes flutter/flutter#157689

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request fixes an accessibility issue in url_launcher_web where the Link widget created duplicate semantic nodes. The change wraps the existing Semantics widget in _buildChild with a MergeSemantics widget to combine the semantic information of the link and its child. A new integration test has been added to verify that a MergeSemantics widget is present in the widget tree for a WebLinkDelegate. The package version has been bumped to 2.4.2 and the CHANGELOG.md has been updated to reflect this fix. My review includes a suggestion to align the new changelog entry with the repository's style guide.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@pedromassango pedromassango marked this pull request as draft September 16, 2025 20:29
@pedromassango pedromassango marked this pull request as ready for review September 16, 2025 23:45
hasEnabledState: true,
hasFocusAction: true,
isEnabled: true,
isButton: true,
Copy link
Member Author

Choose a reason for hiding this comment

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

@chunhtai I was expecting this test to fail as the engine fix landed already 🤔

I mean now that the engine prioritize link, then ideally this test don't need isButton: true right? Are the tests not being ran against the master branch of the flutter?

Comment on lines +120 to +128
return MergeSemantics(
child: Semantics(
link: true,
identifier: _semanticsIdentifier,
linkUrl: widget.link.uri,
child: widget.link.builder(
context,
widget.link.isDisabled ? null : _followLink,
),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think tests run against master AND stable (@stuartmorgan-g to confirm).

If this code is expected to work with master but not with stable, then you need to wait until your flutter fix makes it to stable.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Most tests (including web integration tests) are run against master and stable, yes.

Copy link
Member Author

Choose a reason for hiding this comment

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

@mdebbar I believe it should be fine now since all tests are passing (had to update some existing ones to align with the new behavior)

My comment above (here) is really just a curiosity, as per my understanding after my engine fix, then ideally no isButton should be expeted

Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe it should be fine now since all tests are passing

If a test that you expected to fail is passing, that doesn't sound fine; it sounds like there's a potential test issue here that should be investigated. Am I misunderstanding?

Copy link
Contributor

Choose a reason for hiding this comment

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

Reading the previous (reverted) PR:

With MergeSemantics, the semantics tree was not generated properly, e.g linkUrl value gets removed from the final semantics tree. This is being fixed in the engine, see flutter/flutter#174473

That sounds like we need to wait until the engine fix lands in stable.

Copy link
Member Author

Choose a reason for hiding this comment

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

Am I misunderstanding?

I would say no, but, I'm only 50% sure about my statement and that is why I am looking for @chunhtai 's feedback as he has way more knowledge on this.

But yes, from my understanding, that test should fail as my engine fix now prioritize the link flag over the button one, meaning isButton: true should make it fail.

Anyway, will wait for the fix to land on stable and then, expectt the test to fail

Copy link
Collaborator

Choose a reason for hiding this comment

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

Anyway, will wait for the fix to land on stable and then, expectt the test to fail

The test passed CI on master, pinned to 8d0b31d81a02d13ee37d17c9387d7bbcd1c2baba (which is yesterday), so it's not clear to me what reason there would be to expect different results when the current master reaches stable.

@stuartmorgan-g stuartmorgan-g added the waiting for stable update Can't be landed until functionality reaches the stable channel label Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: url_launcher platform-web waiting for stable update Can't be landed until functionality reaches the stable channel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[url_launcher] Link widget messes up TAB traversal on web
3 participants