Skip to content

[material_ui] Migrate M3 ActionChip template to use new gen_defaults#12219

Open
elliette wants to merge 6 commits into
flutter:m3e_migrationfrom
elliette:action-chip-migration
Open

[material_ui] Migrate M3 ActionChip template to use new gen_defaults#12219
elliette wants to merge 6 commits into
flutter:m3e_migrationfrom
elliette:action-chip-migration

Conversation

@elliette

@elliette elliette commented Jul 16, 2026

Copy link
Copy Markdown
Member

Work towards flutter/flutter#187899
Fixes flutter/flutter#188396

Pre-Review Checklist

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

[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

  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

@github-actions github-actions Bot added triage-framework Should be looked at in framework triage p: material_ui labels Jul 16, 2026
@elliette
elliette marked this pull request as ready for review July 16, 2026 18:57
@elliette
elliette requested a review from QuncCccccc July 16, 2026 18:57

@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 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)},

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.

high

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.

Suggested change
: ${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)},

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.

high

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.

Suggested change
: ${color(TokenAssistChip.withIconDisabledIconColor, colorSchemePrefix)},
: ${colorWithOpacity(TokenAssistChip.withIconDisabledIconColor, TokenAssistChip.withIconDisabledIconOpacity, colorSchemePrefix)},

@QuncCccccc QuncCccccc 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.

LGTM! Thanks!

nit: Maybe we can add a test to verify something like class name has suffix "M3".

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants