mirror of
https://github.com/block/buzz.git
synced 2026-11-27 11:41:21 +00:00
Builds on the merged themes work in #8358 and inherits its appearance and chat-color settings. Polishes mobile conversations with uniform rounded bubbles, desktop-style text-only mentions and agent icon, aligned gallery counts, fading gallery avatars, and standard iOS scrolling. Huddles use rounded cards with attached reaction trays, without duplicate start/end notices; other activity rows stay centered with smaller text. Validation: mobile checks, the full mobile test suite, and the gallery regression test passed. Release build installed on iPhone. Full `just ci` could not finish: desktop compilation exhausted local disk space. ### Snapshots Flutter-rendered light and dark previews using seeded sample messages. | Light | Dark | | --- | --- | |  |  | --------- Signed-off-by: kenny lopez <klopez4212@gmail.com>
62 lines
1.7 KiB
Dart
62 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../shared/widgets/buzz_agent_icon.dart';
|
|
|
|
import '../../shared/theme/theme.dart';
|
|
|
|
/// The inline identity label shared by chat mentions and channel actions.
|
|
class MessageMentionPill extends StatelessWidget {
|
|
/// Visible contextual identity name.
|
|
final String label;
|
|
|
|
/// Full identity label for assistive technologies.
|
|
final String? semanticsLabel;
|
|
|
|
/// Whether to use the desktop robot icon instead of the @ prefix.
|
|
final bool isAgent;
|
|
|
|
/// Typography inherited from the surrounding message.
|
|
final TextStyle? textStyle;
|
|
|
|
/// Creates a chat mention with an agent icon or human @ prefix.
|
|
const MessageMentionPill({
|
|
super.key,
|
|
required this.label,
|
|
this.semanticsLabel,
|
|
required this.isAgent,
|
|
this.textStyle,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final style =
|
|
(textStyle ?? context.textTheme.bodyMedium)?.copyWith(
|
|
color: context.colors.primary,
|
|
fontWeight: FontWeight.w500,
|
|
height: 1,
|
|
) ??
|
|
TextStyle(
|
|
color: context.colors.primary,
|
|
fontWeight: FontWeight.w500,
|
|
height: 1,
|
|
);
|
|
final fontSize = style.fontSize ?? 16;
|
|
|
|
return Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
if (isAgent)
|
|
BuzzAgentIcon(size: fontSize, color: context.colors.primary)
|
|
else
|
|
Transform.translate(
|
|
offset: const Offset(0, -Grid.quarter),
|
|
child: Text('@', style: style),
|
|
),
|
|
Flexible(
|
|
child: Text(label, style: style, semanticsLabel: semanticsLabel),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|