diff --git a/app/lib/backend/schema/conversation.dart b/app/lib/backend/schema/conversation.dart index 113b41182..50f092942 100644 --- a/app/lib/backend/schema/conversation.dart +++ b/app/lib/backend/schema/conversation.dart @@ -198,8 +198,8 @@ class ServerConversation { } Color getTagTextColor() { - if (source == ConversationSource.screenpipe) return Colors.deepPurple; - return Colors.white; + if (source == ConversationSource.screenpipe) return Colors.deepPurple.shade600; + return Colors.white60; } Color getTagColor() { diff --git a/app/lib/pages/conversations/widgets/conversation_list_item.dart b/app/lib/pages/conversations/widgets/conversation_list_item.dart index 09771d6d4..1066c03ff 100644 --- a/app/lib/pages/conversations/widgets/conversation_list_item.dart +++ b/app/lib/pages/conversations/widgets/conversation_list_item.dart @@ -108,27 +108,33 @@ class _ConversationListItemState extends State { padding: const EdgeInsetsDirectional.all(16), child: Column( mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ _getConversationHeader(), const SizedBox(height: 16), + widget.conversation.discarded + ? const SizedBox.shrink() + : Text(widget.conversation.structured.getEmoji(), + style: const TextStyle(color: Colors.white, fontSize: 28, fontWeight: FontWeight.w600)), + !widget.conversation.discarded ? const SizedBox(height: 8) : const SizedBox.shrink(), widget.conversation.discarded ? const SizedBox.shrink() : Text( structured.title.decodeString, style: Theme.of(context).textTheme.titleLarge, - maxLines: 1, + maxLines: 2, ), widget.conversation.discarded ? const SizedBox.shrink() : const SizedBox(height: 8), widget.conversation.discarded ? const SizedBox.shrink() : Text( structured.overview.decodeString, + overflow: TextOverflow.fade, style: Theme.of(context) .textTheme .bodyMedium! .copyWith(color: Colors.grey.shade300, height: 1.3), - maxLines: 2, + maxLines: 3, ), widget.conversation.discarded ? Text( @@ -139,6 +145,7 @@ class _ConversationListItemState extends State { .copyWith(color: Colors.grey.shade300, height: 1.3), ) : const SizedBox(height: 8), + _getConversationFooter(), ], ), ), @@ -150,30 +157,79 @@ class _ConversationListItemState extends State { }); } + _getConversationFooter() { + var convo = widget.conversation.structured; + if (convo.actionItems.isEmpty && convo.events.isEmpty) { + return const SizedBox.shrink(); + } + return Padding( + padding: const EdgeInsets.only(left: 4.0, right: 12, bottom: 8, top: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + convo.actionItems.isNotEmpty + ? Padding( + padding: const EdgeInsets.only(right: 8.0), + child: Row( + children: [ + const Icon( + Icons.task_alt_outlined, + size: 14, + color: Colors.white60, + ), + const SizedBox( + width: 4, + ), + Text( + "${convo.actionItems.where((act) => act.completed).length}/${convo.actionItems.length}", + style: const TextStyle( + fontSize: 12, + color: Colors.white60, + ), + ), + ], + ), + ) + : const SizedBox.shrink(), + convo.events.isNotEmpty + ? Row( + children: [ + const Icon( + Icons.event_outlined, + size: 14, + color: Colors.white60, + ), + const SizedBox( + width: 4, + ), + Text( + "${convo.events.length}", + style: const TextStyle(fontSize: 12, color: Colors.white60), + ), + ], + ) + : const SizedBox.shrink(), + ], + ), + ); + } + _getConversationHeader() { return Padding( padding: const EdgeInsets.only(left: 4.0, right: 12), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - widget.conversation.discarded - ? const SizedBox.shrink() - : Text(widget.conversation.structured.getEmoji(), - style: const TextStyle(color: Colors.white, fontSize: 22, fontWeight: FontWeight.w600)), - widget.conversation.structured.category.isNotEmpty && !widget.conversation.discarded - ? const SizedBox(width: 12) - : const SizedBox.shrink(), widget.conversation.structured.category.isNotEmpty ? Container( decoration: BoxDecoration( - color: widget.conversation.getTagColor(), borderRadius: BorderRadius.circular(16), ), - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), + padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 4), child: Text( widget.conversation.getTag(), style: - Theme.of(context).textTheme.bodyMedium!.copyWith(color: widget.conversation.getTagTextColor()), + Theme.of(context).textTheme.bodySmall!.copyWith(color: widget.conversation.getTagTextColor()), maxLines: 1, ), ) @@ -189,7 +245,7 @@ class _ConversationListItemState extends State { ) : Text( dateTimeFormat('MMM d, h:mm a', widget.conversation.startedAt ?? widget.conversation.createdAt), - style: TextStyle(color: Colors.grey.shade400, fontSize: 14), + style: TextStyle(color: Colors.grey.shade400, fontSize: 12), maxLines: 1, textAlign: TextAlign.end, ), diff --git a/app/lib/pages/conversations/widgets/search_widget.dart b/app/lib/pages/conversations/widgets/search_widget.dart index c0c0a8b60..6a507ed3e 100644 --- a/app/lib/pages/conversations/widgets/search_widget.dart +++ b/app/lib/pages/conversations/widgets/search_widget.dart @@ -79,14 +79,23 @@ class _SearchWidgetState extends State { style: const TextStyle(color: Colors.white), ), ), + SizedBox( + width: 12, + ), Consumer( builder: (BuildContext context, ConversationProvider convoProvider, Widget? child) { - return IconButton( - onPressed: convoProvider.toggleDiscardConversations, - icon: Icon( - convoProvider.showDiscardedConversations ? Icons.filter_alt_off_sharp : Icons.filter_alt_sharp, - color: Colors.white, - size: 24, + return Container( + decoration: BoxDecoration( + color: Colors.grey.shade900, + borderRadius: BorderRadius.all(Radius.circular(16)), + ), + child: IconButton( + onPressed: convoProvider.toggleDiscardConversations, + icon: Icon( + convoProvider.showDiscardedConversations ? Icons.filter_alt_off_sharp : Icons.filter_alt_sharp, + color: Colors.white, + size: 20, + ), ), ); }),