Improve bookmarks navigation, scoping, search, and bulk actions
Add Bookmarks to the Contacts overflow menu, open the dedicated BookmarksScreen from direct and channel chat menus with a split scope pill (All vs current chat), add in-screen bookmark search with scroll-and-highlight jump, support bulk bookmarking from channel selection mode and bulk removal in BookmarksScreen, and prompt with a confirmation dialog before removing single or selected bookmarks.
This commit is contained in:
1 parent
d4a6839413
commit
32977bdd50
32 files changed
+1817
-230
No files matched your search
@@ -219,3 +219,42 @@ Future<bool> confirmClearChat(
|
||||
);
|
||||
return confirmed == true;
|
||||
}
|
||||
|
||||
/// Asks before removing [count] bookmarked messages.
|
||||
Future<bool> confirmRemoveBookmarks(
|
||||
BuildContext context, {
|
||||
int count = 1,
|
||||
}) async {
|
||||
final confirmed = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (dialogContext) {
|
||||
final l10n = dialogContext.l10n;
|
||||
return AlertDialog(
|
||||
title: Text(
|
||||
count == 1
|
||||
? l10n.bookmarks_removeConfirmTitle
|
||||
: l10n.bookmarks_removeSelectedConfirmTitle,
|
||||
),
|
||||
content: Text(
|
||||
count == 1
|
||||
? l10n.bookmarks_removeConfirmMessage
|
||||
: l10n.bookmarks_removeSelectedConfirmMessage(count),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(dialogContext, false),
|
||||
child: Text(l10n.common_cancel),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(dialogContext, true),
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: Theme.of(dialogContext).colorScheme.error,
|
||||
),
|
||||
child: Text(l10n.common_remove),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
return confirmed == true;
|
||||
}
|
||||
@@ -10,6 +10,7 @@ class TranslatedMessageContent extends StatelessWidget {
|
||||
final Color? backgroundColor;
|
||||
final bool showOriginalFirst;
|
||||
final VoidCallback? onSecondaryTap;
|
||||
final bool selectable;
|
||||
|
||||
const TranslatedMessageContent({
|
||||
super.key,
|
||||
@@ -20,6 +21,7 @@ class TranslatedMessageContent extends StatelessWidget {
|
||||
this.backgroundColor,
|
||||
this.showOriginalFirst = true,
|
||||
this.onSecondaryTap,
|
||||
this.selectable = true,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -42,6 +44,7 @@ class TranslatedMessageContent extends StatelessWidget {
|
||||
),
|
||||
backgroundColor: backgroundColor,
|
||||
onSecondaryTap: onSecondaryTap,
|
||||
selectable: selectable,
|
||||
)
|
||||
: null;
|
||||
final translatedWidget = LinkHandler.buildLinkifyText(
|
||||
@@ -50,6 +53,7 @@ class TranslatedMessageContent extends StatelessWidget {
|
||||
style: style,
|
||||
backgroundColor: backgroundColor,
|
||||
onSecondaryTap: onSecondaryTap,
|
||||
selectable: selectable,
|
||||
);
|
||||
|
||||
if (!shouldShowOriginal) {
|
||||
|
||||
Reference in new issue
Block a user