Files
pipelines/app/lib/features/chat/ui/transcript/chat_attachment_frame.dart
T
alan b00dff864c feat(chat): frame attachment thumbnails with a subtle hairline
Sent images and composer thumbnails share ChatAttachmentFrame: rounded
corners plus a faint outline in the host's outline role, so a dark
screenshot no longer melts into a dark page. Adds a web probe that
renders the streaming activity line at several text sizes.
2026-10-31 00:21:22 +00:00

37 lines
1.1 KiB
Dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../sessions/chat_adaptive.dart';
/// Rounds an attachment thumbnail and draws a subtle hairline around it, so a
/// dark screenshot on a dark page (or a light one on a light page) still reads
/// as a separate object. The line sits over the image's edge, in the host's
/// own outline role.
class ChatAttachmentFrame extends StatelessWidget {
const ChatAttachmentFrame({
super.key,
required this.radius,
required this.child,
});
final BorderRadius radius;
final Widget child;
@override
Widget build(BuildContext context) {
final cupertino =
chatControlsStyleOf(context) == ChatControlsStyle.cupertino;
final line = cupertino
? CupertinoColors.separator.resolveFrom(context)
: Theme.of(context).colorScheme.outlineVariant;
return Container(
key: const Key('chat-attachment-frame'),
foregroundDecoration: BoxDecoration(
borderRadius: radius,
border: Border.all(color: line.withValues(alpha: 0.8)),
),
child: ClipRRect(borderRadius: radius, child: child),
);
}
}