Skip to content

Commit

Permalink
Revert "Reduce colors contrast, layers on home page. More infomative …
Browse files Browse the repository at this point in the history
…convos item" (#1718)

Reverts #1715
  • Loading branch information
beastoin authored Jan 21, 2025
2 parents 27df8c8 + a1c92c4 commit ba58b21
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 87 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.shade600;
return Colors.white60;
if (source == ConversationSource.screenpipe) return Colors.deepPurple;
return Colors.white;
}

Color getTagColor() {
Expand Down
84 changes: 14 additions & 70 deletions app/lib/pages/conversations/widgets/conversation_list_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,33 +108,27 @@ class _ConversationListItemState extends State<ConversationListItem> {
padding: const EdgeInsetsDirectional.all(16),
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.stretch,
crossAxisAlignment: CrossAxisAlignment.start,
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: 2,
maxLines: 1,
),
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: 3,
maxLines: 2,
),
widget.conversation.discarded
? Text(
Expand All @@ -145,7 +139,6 @@ class _ConversationListItemState extends State<ConversationListItem> {
.copyWith(color: Colors.grey.shade300, height: 1.3),
)
: const SizedBox(height: 8),
_getConversationFooter(),
],
),
),
Expand All @@ -157,79 +150,30 @@ 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: 0, vertical: 4),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
child: Text(
widget.conversation.getTag(),
style:
Theme.of(context).textTheme.bodySmall!.copyWith(color: widget.conversation.getTagTextColor()),
Theme.of(context).textTheme.bodyMedium!.copyWith(color: widget.conversation.getTagTextColor()),
maxLines: 1,
),
)
Expand All @@ -245,7 +189,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: 12),
style: TextStyle(color: Colors.grey.shade400, fontSize: 14),
maxLines: 1,
textAlign: TextAlign.end,
),
Expand Down
21 changes: 6 additions & 15 deletions app/lib/pages/conversations/widgets/search_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,14 @@ class _SearchWidgetState extends State<SearchWidget> {
style: const TextStyle(color: Colors.white),
),
),
SizedBox(
width: 12,
),
Consumer<ConversationProvider>(
builder: (BuildContext context, ConversationProvider convoProvider, Widget? child) {
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,
),
return IconButton(
onPressed: convoProvider.toggleDiscardConversations,
icon: Icon(
convoProvider.showDiscardedConversations ? Icons.filter_alt_off_sharp : Icons.filter_alt_sharp,
color: Colors.white,
size: 24,
),
);
}),
Expand Down

0 comments on commit ba58b21

Please sign in to comment.