Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ class ZetaButton extends ZetaStatelessWidget {
Widget build(BuildContext context) {
final minConstraints = _minConstraints(context);
final iconSize = _iconSize(context);
final zeta = Zeta.of(context);

// Override to sharp if in AAA contrast mode
final contrastBorderType = zeta.contrast == ZetaContrast.aaa
? ZetaWidgetBorder.sharp
: borderType ?? (context.rounded ? ZetaWidgetBorder.rounded : ZetaWidgetBorder.sharp);
Comment on lines +197 to +199
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

This AAA contrast mode functionality lacks test coverage. The existing accessibility tests in button_test.dart iterate through contrast modes (aa and aaa) but don't specifically verify that sharp borders are enforced in AAA mode. Consider adding a test that verifies the border behavior in AAA contrast mode, especially when borderType is explicitly set to a different value.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fair - will be done if solution is kept


return Semantics(
button: true,
enabled: onPressed != null,
Expand All @@ -203,7 +210,7 @@ class ZetaButton extends ZetaStatelessWidget {
onPressed: onPressed,
style: buttonStyle(
context,
borderType ?? (context.rounded ? ZetaWidgetBorder.rounded : ZetaWidgetBorder.sharp),
contrastBorderType,
type,
),
child: SelectionContainer.disabled(
Expand Down