[material_ui] Migrate M3 ActionChip template to use new gen_defaults#12219
[material_ui] Migrate M3 ActionChip template to use new gen_defaults#12219elliette wants to merge 6 commits into
ActionChip template to use new gen_defaults#12219Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Action Chip defaults generation logic by migrating to a new template structure and utilizing specific token constants from 'assist_chip.dart'. It includes a new 'border' helper method in 'TokenTemplate' and updates the 'gen_defaults.dart' script to include the 'ActionChipTemplateM3'. Feedback identified two missing opacity applications for disabled states in the label and icon colors, which require updates to ensure consistency with the token data.
| ? ${color("$tokenGroup.label-text.color")} | ||
| : ${color("$tokenGroup.disabled.label-text.color")}, | ||
| ? ${color(TokenAssistChip.labelTextColor, colorSchemePrefix)} | ||
| : ${color(TokenAssistChip.disabledLabelTextColor, colorSchemePrefix)}, |
There was a problem hiding this comment.
The disabled label color is missing its opacity. According to the token data in assist_chip.dart, disabledLabelTextOpacity should be applied to the color for the disabled state.
| : ${color(TokenAssistChip.disabledLabelTextColor, colorSchemePrefix)}, | |
| : ${colorWithOpacity(TokenAssistChip.disabledLabelTextColor, TokenAssistChip.disabledLabelTextOpacity, colorSchemePrefix)}, |
| : ${color("$tokenGroup.with-icon.disabled.icon.color")}, | ||
| size: ${getToken("$tokenGroup.with-icon.icon.size")}, | ||
| ? ${color(TokenAssistChip.withIconIconColor, colorSchemePrefix)} | ||
| : ${color(TokenAssistChip.withIconDisabledIconColor, colorSchemePrefix)}, |
There was a problem hiding this comment.
The disabled icon color is missing its opacity. According to the token data in assist_chip.dart, withIconDisabledIconOpacity should be applied to the color for the disabled state.
| : ${color(TokenAssistChip.withIconDisabledIconColor, colorSchemePrefix)}, | |
| : ${colorWithOpacity(TokenAssistChip.withIconDisabledIconColor, TokenAssistChip.withIconDisabledIconOpacity, colorSchemePrefix)}, |
QuncCccccc
left a comment
There was a problem hiding this comment.
LGTM! Thanks!
nit: Maybe we can add a test to verify something like class name has suffix "M3".
Work towards flutter/flutter#187899
Fixes flutter/flutter#188396
Pre-Review Checklist
[shared_preferences]///).Test exemption: Template migration PR.
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-assistbot 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.[test exemption]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.*
Footnotes
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