added a swipeable media gallery for chat and folder images and videos with server previews, on-demand originals and zoom, and marked document previews in chat so they no longer pass for photos

This commit is contained in:
MineTec committed 2026-10-28 22:15:57 +01:00
1 parent 952f916231
commit aa176c90e3
22 files changed
+1658 -103

No files matched your search

+16 -2
View File
@@ -5,6 +5,7 @@ import '../../../../api/marianumcloud/talk/chat/get_chat_response.dart';
import '../../../../api/marianumcloud/talk/room/get_room_response.dart';
import '../../../../extensions/date_time.dart';
import '../../../../extensions/text.dart';
import '../../../../routing/app_routes.dart';
import '../../../../share_intent/remote_file_ref.dart';
import '../../../../state/app/modules/chat/bloc/chat_bloc.dart';
import '../../../../utils/downloads/download_job.dart';
@@ -14,6 +15,7 @@ import '../../../../widget/demo_restricted.dart';
import '../../../../widget/downloads/download_trigger.dart';
import '../data/chat_bubble_styles.dart';
import '../data/chat_message.dart';
import '../data/talk_gallery_source.dart';
import 'answer_reference.dart';
import 'bubble.dart';
import 'chat_bubble_poll.dart';
@@ -192,9 +194,21 @@ class _ChatBubbleState extends State<ChatBubble>
if (guardDemoAction(context)) return;
if (isDownloading) {
confirmCancelDownload();
} else {
_startFileDownload();
return;
}
final galleryItem = galleryItemFromTalk(widget.bubbleData);
if (galleryItem != null) {
AppRoutes.openMediaGallery(
context,
source: TalkGallerySource(
token: widget.chatData.token,
initial: galleryItem,
),
initialKey: galleryItem.key,
);
return;
}
_startFileDownload();
}
void _updateMessage(BuildContext context) {