Skip to content

Commit

Permalink
Reduce colors contrast, layers on home page. More infomative convos item
Browse files Browse the repository at this point in the history
  • Loading branch information
beastoin committed Jan 20, 2025
1 parent a70a58e commit 00fda23
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 22 deletions.
4 changes: 2 additions & 2 deletions app/lib/backend/schema/conversation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
84 changes: 70 additions & 14 deletions app/lib/pages/conversations/widgets/conversation_list_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,33 @@ class _ConversationListItemState extends State<ConversationListItem> {
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(
Expand All @@ -139,6 +145,7 @@ class _ConversationListItemState extends State<ConversationListItem> {
.copyWith(color: Colors.grey.shade300, height: 1.3),
)
: const SizedBox(height: 8),
_getConversationFooter(),
],
),
),
Expand All @@ -150,30 +157,79 @@ class _ConversationListItemState extends State<ConversationListItem> {
});
}

_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,
),
)
Expand All @@ -189,7 +245,7 @@ class _ConversationListItemState extends State<ConversationListItem> {
)
: 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,
),
Expand Down
21 changes: 15 additions & 6 deletions app/lib/pages/conversations/widgets/search_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,23 @@ class _SearchWidgetState extends State<SearchWidget> {
style: const TextStyle(color: Colors.white),
),
),
SizedBox(
width: 12,
),
Consumer<ConversationProvider>(
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,
),
),
);
}),
Expand Down

0 comments on commit 00fda23

Please sign in to comment.