Merge branch 'main' into 726-fix-multiple-empty-chat

This commit is contained in:
ggurdin 2024-10-10 16:45:43 -04:00 committed by GitHub
commit a5508fd1e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 9 deletions

View file

@ -1680,6 +1680,7 @@ class ChatController extends State<ChatPageWithRoom>
MatrixState.pangeaController.subscriptionController.isSubscribed,
position: OverlayPositionEnum.centered,
onDismiss: clearSelectedEvents,
blurBackground: true,
);
// select the message

View file

@ -46,11 +46,16 @@ class ChatEventList extends StatelessWidget {
// after the chat event list mounts, if the user hasn't yet seen this instruction
// card, attach it on top of the first shown message
WidgetsBinding.instance.addPostFrameCallback((_) {
if (events.isEmpty) return;
final msgEvents = events
.where(
(event) => event.type == EventTypes.Message,
)
.toList();
if (msgEvents.isEmpty) return;
controller.pangeaController.instructions.showInstructionsPopup(
context,
InstructionsEnum.clickMessage,
events[0].eventId,
msgEvents[0].eventId,
true,
);
});

View file

@ -69,6 +69,12 @@ class InstructionsController {
String transformTargetKey, [
bool showToggle = true,
]) async {
final bool userLangsSet =
await _pangeaController.userController.areUserLanguagesSet;
if (!userLangsSet) {
return;
}
if (_instructionsShown[key.toString()] ?? false) {
return;
}
@ -85,12 +91,6 @@ class InstructionsController {
return;
}
final bool userLangsSet =
await _pangeaController.userController.areUserLanguagesSet;
if (!userLangsSet) {
return;
}
final botStyle = BotStyle.text(context);
Future.delayed(
const Duration(seconds: 1),

View file

@ -27,6 +27,7 @@ class OverlayUtil {
double? height,
Offset? offset,
backDropToDismiss = true,
blurBackground = false,
Color? borderColor,
Color? backgroundColor,
Alignment? targetAnchor,
@ -50,6 +51,7 @@ class OverlayUtil {
TransparentBackdrop(
backgroundColor: backgroundColor,
onDismiss: onDismiss,
blurBackground: blurBackground,
),
Positioned(
top: (position == OverlayPositionEnum.centered) ? 0 : null,
@ -207,10 +209,13 @@ class OverlayUtil {
class TransparentBackdrop extends StatelessWidget {
final Color? backgroundColor;
final Function? onDismiss;
final bool blurBackground;
const TransparentBackdrop({
super.key,
this.onDismiss,
this.backgroundColor,
this.blurBackground = false,
});
@override
@ -231,7 +236,9 @@ class TransparentBackdrop extends StatelessWidget {
MatrixState.pAnyState.closeOverlay();
},
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 2.5, sigmaY: 2.5),
filter: blurBackground
? ImageFilter.blur(sigmaX: 2.5, sigmaY: 2.5)
: ImageFilter.blur(sigmaX: 0, sigmaY: 0),
child: Container(
height: double.infinity,
width: double.infinity,