Skip to content

Conversation

@chunhtai
Copy link
Contributor

…… (#174365)"

This reverts commit 5e146d4.

straight reland, previous pr was reverted because g3fix is outdated

Pre-launch 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.

@github-actions github-actions bot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine related. See also e: labels. f: material design flutter/packages/flutter/material repository. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) platform-windows Building on or for Windows specifically a: desktop Running on desktop labels Sep 26, 2025
Copy link
Contributor

@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 updates the accessibility announcement API to support multiple views by passing a viewId. The changes are applied across the framework, engine, and tests, replacing SemanticsService.announce with the new SemanticsService.sendAnnouncement. My review found a critical issue in the C++ implementation where it doesn't correctly handle different integer sizes for viewId, which could lead to failures. I've also suggested a minor improvement in a test for better robustness.

Comment on lines +71 to +78
const auto* view_id_val = std::get_if<FlutterViewId>(&view_itr->second);
if (!view_id_val) {
FML_LOG(ERROR)
<< "Announce message 'viewId' property must be a FlutterViewId.";
return;
}

plugin->Announce(*view_id_val, *message);
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The viewId from Dart is an int, which is 64-bit. The StandardMessageCodec will encode it as a 32-bit integer if it fits, otherwise as a 64-bit integer. The current code only checks for int64_t (FlutterViewId), which will fail for small viewIds that are encoded as int32_t. This will likely cause the feature to fail in most cases, as viewIds are often small integers.

To fix this, you should handle both int32_t and int64_t when decoding the viewId.

Suggested change
const auto* view_id_val = std::get_if<FlutterViewId>(&view_itr->second);
if (!view_id_val) {
FML_LOG(ERROR)
<< "Announce message 'viewId' property must be a FlutterViewId.";
return;
}
plugin->Announce(*view_id_val, *message);
FlutterViewId view_id;
if (const auto* id32 = std::get_if<int32_t>(&view_itr->second)) {
view_id = *id32;
} else if (const auto* id64 = std::get_if<int64_t>(&view_itr->second)) {
view_id = *id64;
} else {
FML_LOG(ERROR)
<< "Announce message 'viewId' property must be an integer.";
return;
}
plugin->Announce(view_id, *message);

<String, dynamic>{
'type': 'announce',
'data': <String, dynamic>{
'viewId': 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better test robustness, it's recommended to use tester.view.viewId instead of hardcoding 0. This ensures the test remains valid even if the test environment changes and the default view ID is not 0.

Suggested change
'viewId': 0,
'viewId': tester.view.viewId,

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 26, 2025
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 26, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Sep 26, 2025

autosubmit label was removed for flutter/flutter/176107, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@chunhtai chunhtai force-pushed the announce-reland branch 2 times, most recently from 5884336 to 8d9dc21 Compare September 29, 2025 20:24
@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 29, 2025
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 29, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Sep 29, 2025

autosubmit label was removed for flutter/flutter/176107, because - The status or check suite Linux android_preview_tool_integration_tests has failed. Please fix the issues identified (or deflake) before re-applying this label.

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 29, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Sep 30, 2025

autosubmit label was removed for flutter/flutter/176107, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 30, 2025
@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 1, 2025
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 1, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Oct 1, 2025

autosubmit label was removed for flutter/flutter/176107, because - The status or check suite Windows windows_unopt has failed. Please fix the issues identified (or deflake) before re-applying this label.

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 1, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Oct 1, 2025
Merged via the queue into flutter:master with commit a3eba8e Oct 1, 2025
190 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 1, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 2, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Oct 2, 2025
flutter/flutter@7811e89...65aca36

2025-10-02 [email protected] Roll Skia from 257c1f94afaa to 05c1f5803415 (4 revisions) (flutter/flutter#176402)
2025-10-02 [email protected] [ Widget Preview ] Fix resolution for workspace "hosted" dependencies (flutter/flutter#176358)
2025-10-02 [email protected] Roll Skia from b5d8ae8d3410 to 257c1f94afaa (6 revisions) (flutter/flutter#176389)
2025-10-02 [email protected] Delete Skia-specific performance overlay implementation (flutter/flutter#176364)
2025-10-02 [email protected] Roll Fuchsia Linux SDK from 1Ai6VL4vb_GdGnWhg... to Vnoygds8HtDUvGLCK... (flutter/flutter#176381)
2025-10-01 [email protected] [ Widget Preview ] Persist "Filter by Selected File" toggle (flutter/flutter#176289)
2025-10-01 [email protected] Roll Skia from c44a36470d07 to b5d8ae8d3410 (5 revisions) (flutter/flutter#176367)
2025-10-01 [email protected] Reapply "Update the AccessibilityPlugin::Announce method to account f… (flutter/flutter#176107)
2025-10-01 [email protected] Roll Dart SDK from 8ffec1435cf3 to 4f90a06328cb (3 revisions) (flutter/flutter#176369)
2025-10-01 [email protected] [ Tool / l10n ] Fix issue where localization generator assumed current directory was the target project (flutter/flutter#175881)
2025-10-01 [email protected] Make sure that a DateRangePickerDialog doesn't crash in 0x0 environments (flutter/flutter#173754)
2025-10-01 [email protected] Make sure that a DrawerButton doesn't crash in 0x0 environment (flutter/flutter#172948)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
mboetger pushed a commit to mboetger/flutter that referenced this pull request Oct 7, 2025
flutter#176107)

…… (flutter#174365)"

This reverts commit 5e146d4.

<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

straight reland, previous pr was reverted because g3fix is outdated

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

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](https://developers.google.com/gemini-code-assist/docs/review-github-code).
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.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
okorohelijah pushed a commit to okorohelijah/flutter that referenced this pull request Oct 7, 2025
flutter#176107)

…… (flutter#174365)"

This reverts commit 5e146d4.

<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

straight reland, previous pr was reverted because g3fix is outdated

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

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](https://developers.google.com/gemini-code-assist/docs/review-github-code).
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.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
const auto* view_id_val = std::get_if<FlutterViewId>(&view_itr->second);
if (!view_id_val) {
FML_LOG(ERROR)
<< "Announce message 'viewId' property must be a FlutterViewId.";
Copy link

Choose a reason for hiding this comment

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

I am getting this error when using ExpansionTile.

[ERROR:flutter/shell/platform/windows/accessibility_plugin.cc(73)] Announce message 'viewId' property must be a FlutterViewId.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can you file an issue instead?

reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
flutter#176107)

…… (flutter#174365)"

This reverts commit 5e146d4.

<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

straight reland, previous pr was reverted because g3fix is outdated

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

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](https://developers.google.com/gemini-code-assist/docs/review-github-code).
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.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) a: desktop Running on desktop a: tests "flutter test", flutter_test, or one of our tests engine flutter/engine related. See also e: labels. f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. platform-windows Building on or for Windows specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants