Skip to content

[material_ui] Check DataTable cell semantics as a composed rect - #13498

Open
ashu3699 wants to merge 1 commit into
flutter:mainfrom
ashu3699:fix/data-table-semantics-world-rect
Open

ashu3699 wants to merge 1 commit into
flutter:mainfrom
ashu3699:fix/data-table-semantics-world-rect

Conversation

@ashu3699

Copy link
Copy Markdown

Ports the Material-side test change of flutter/flutter#195288, following the porting instructions in flutter/flutter#188444 (Material is frozen in flutter/flutter; its tests now live here).

What this PR changes

The DataTable cell has correct semantics rect regression test (flutter/flutter#171264) asserted the internal transform distribution of the table's synthesized semantics nodes: that the labeled cell node carries transform = null with an origin-based rect. That shape is an implementation detail — the same assistive-technology-visible box can be produced with the transform living on the cell's own node instead of on a synthesized ancestor.

The assertion now composes the transform chain from the root of the semantics tree and checks the laid-out cell box (0, 56) → (302, 126) directly. That holds regardless of how the table distributes transforms between its synthesized row/cell nodes and the cell's own node, while still catching the #171264 bug class (a wrong cell box).

Verified against both the current Flutter framework and the pending framework change in flutter/flutter#195288: the test passes on either, so this PR can land independently of that one.

Issues fixed

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

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the DataTable cell semantics regression test to assert the cell's composed rect from the root of the semantics tree, introducing a helper method _semanticsWorldRect to traverse the semantics tree. The review feedback suggests adding explicit checks and descriptive error messages in this helper method to handle cases where semantics are not enabled or the target node is not found, preventing generic null check errors.

Comment thread packages/material_ui/test/data_table_test.dart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: material_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant