From 7534ecf7d1a656d7f1a2d8df8af43ee8754664e9 Mon Sep 17 00:00:00 2001 From: Welton Moura Date: Fri, 25 Sep 2026 10:27:41 -0300 Subject: [PATCH] fix: simplify chat context menu --- lib/pages/chat_list/chat_list.dart | 55 +++++++++++------------------- 1 file changed, 19 insertions(+), 36 deletions(-) diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index e53db5e..dc6f3db 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -525,7 +525,7 @@ class ChatListController extends State ) .toList(); - var action = await showModalActionPopup( + final action = await showModalActionPopup( context: posContext, cancelLabel: l10n.cancel, actions: [ @@ -564,36 +564,6 @@ class ChatListController extends State room.isFavourite ? Icons.push_pin : Icons.push_pin_outlined, ), ), - ], - AdaptiveModalAction( - value: ChatContextAction.leave, - label: room.membership == Membership.invite - ? l10n.delete - : l10n.leave, - icon: const Icon(Icons.delete_outlined), - isDestructive: true, - ), - if (room.membership == Membership.invite) - AdaptiveModalAction( - value: ChatContextAction.block, - label: l10n.block, - icon: const Icon(Icons.block_outlined), - isDestructive: true, - ), - if (room.membership == Membership.join) - AdaptiveModalAction( - value: ChatContextAction.showMore, - label: l10n.more, - icon: Icon(Icons.adaptive.more_outlined), - ), - ], - ); - if (!posContext.mounted || !mounted) return; - if (action == ChatContextAction.showMore) { - action = await showModalActionPopup( - context: posContext, - cancelLabel: l10n.cancel, - actions: [ if (!room.isFavourite) AdaptiveModalAction( value: ChatContextAction.lowPriority, @@ -625,8 +595,24 @@ class ChatListController extends State icon: const Icon(Icons.group_work_outlined), ), ], - ); - } + AdaptiveModalAction( + value: ChatContextAction.leave, + label: room.membership == Membership.invite + ? l10n.delete + : l10n.leave, + icon: const Icon(Icons.delete_outlined), + isDestructive: true, + ), + if (room.membership == Membership.invite) + AdaptiveModalAction( + value: ChatContextAction.block, + label: l10n.block, + icon: const Icon(Icons.block_outlined), + isDestructive: true, + ), + ], + ); + if (!posContext.mounted || !mounted) return; if (action == null) return; if (!mounted) return; @@ -753,8 +739,6 @@ class ChatListController extends State future: () => room.removeTag(activeTag!), ); return; - case ChatContextAction.showMore: - throw ('Should not be handled!'); } } @@ -1021,5 +1005,4 @@ enum ChatContextAction { leave, addToSpace, block, - showMore, }