Merge main (High contrast) into Glass; Glass snaps live switches

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-04 00:46:54 +00:00
40 changed files with 2732 additions and 103 deletions
@@ -330,9 +330,13 @@ class ChatStackColumnItems extends StatelessWidget {
decoration: ShapeDecoration(
color: tokens.flat || header ? null : scheme.primaryContainer,
shape: chatStackShape(tokens).copyWith(
side: tokens.flat
? BorderSide(color: scheme.primary.withValues(alpha: .55))
: BorderSide.none,
// A design with a contrast floor frames it in the full
// accent at its own stroke.
side: !tokens.flat
? BorderSide.none
: tokens.minContrast != null
? BorderSide(color: scheme.primary, width: tokens.stroke)
: BorderSide(color: scheme.primary.withValues(alpha: .55)),
),
),
child: Icon(
@@ -206,7 +206,10 @@ class ChatStackLabel extends StatelessWidget {
);
final color = this.color;
final dark = theme.brightness == Brightness.dark;
final fill = color == null
// A design with a contrast floor marks the chat's colour with a bold
// outline rather than a tint.
final outlined = color != null && tokens.minContrast != null;
final fill = color == null || outlined
? base
: Color.alphaBlend(color.withValues(alpha: dark ? .22 : .14), base);
final style = (theme.textTheme.labelLarge ?? const TextStyle()).copyWith(
@@ -215,7 +218,10 @@ class ChatStackLabel extends StatelessWidget {
);
final rest = ShapeDecoration(
color: fill,
shape: _labelShape(tokens),
shape: _labelShape(
tokens,
outlined ? BorderSide(color: color, width: 3) : null,
),
shadows: tokens.flat ? null : chatStackShadows(scheme),
);
return chatStackLifted(
@@ -262,8 +268,8 @@ class ChatStackLabel extends StatelessWidget {
);
}
OutlinedBorder _labelShape(AppDesignTokens tokens) {
final side = tokens.frameSide ?? BorderSide.none;
OutlinedBorder _labelShape(AppDesignTokens tokens, [BorderSide? outline]) {
final side = outline ?? tokens.frameSide ?? BorderSide.none;
final r = tokens.radius;
return r == null
? StadiumBorder(side: side)