diff --git a/lib/features/support_chat/presentation/screens/support_chat_screen.dart b/lib/features/support_chat/presentation/screens/support_chat_screen.dart index ba78637..058054c 100644 --- a/lib/features/support_chat/presentation/screens/support_chat_screen.dart +++ b/lib/features/support_chat/presentation/screens/support_chat_screen.dart @@ -480,46 +480,51 @@ class _SupportChatScreenState extends ConsumerState { color: AppColors.primaryDark.withValues(alpha: 0.1), ), ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (!isOwn) - const Padding( - padding: EdgeInsets.only(bottom: 4), + // IntrinsicWidth shrinks the bubble to the widest child (content or + // time), so short messages like "hi" don't stretch to maxWidth. + child: IntrinsicWidth( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + if (!isOwn) + const Padding( + padding: EdgeInsets.only(bottom: 4), + child: Text( + 'Support Team', + style: TextStyle( + fontFamily: 'Fractul', + fontSize: 12, + fontWeight: FontWeight.w600, + color: AppColors.accentOrange, + ), + ), + ), + Text( + msg.content, + style: TextStyle( + fontFamily: 'SourceSerif4', + fontSize: 14, + color: isOwn ? Colors.white : AppColors.primaryDark, + height: 1.4, + ), + ), + const SizedBox(height: 4), + Align( + alignment: Alignment.bottomRight, child: Text( - 'Support Team', + _formatTime(msg.createdAt), style: TextStyle( - fontFamily: 'Fractul', - fontSize: 12, - fontWeight: FontWeight.w600, - color: AppColors.accentOrange, + fontFamily: 'SourceSerif4', + fontSize: 11, + color: isOwn + ? Colors.white.withValues(alpha: 0.5) + : AppColors.primaryDark.withValues(alpha: 0.4), ), ), ), - Text( - msg.content, - style: TextStyle( - fontFamily: 'SourceSerif4', - fontSize: 14, - color: isOwn ? Colors.white : AppColors.primaryDark, - height: 1.4, - ), - ), - const SizedBox(height: 4), - Align( - alignment: Alignment.bottomRight, - child: Text( - _formatTime(msg.createdAt), - style: TextStyle( - fontFamily: 'SourceSerif4', - fontSize: 11, - color: isOwn - ? Colors.white.withValues(alpha: 0.5) - : AppColors.primaryDark.withValues(alpha: 0.4), - ), - ), - ), - ], + ], + ), ), ), );