Merge branch 'main' into 547-improve-bot-settings-ui

This commit is contained in:
ggurdin 2024-08-06 13:57:45 -04:00 committed by GitHub
commit 7dc8a72f46
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 15 deletions

View file

@ -1108,8 +1108,14 @@ class ChatController extends State<ChatPageWithRoom>
inputFocus.requestFocus();
}
void scrollToEventId(String eventId) async {
final eventIndex = timeline!.events.indexWhere((e) => e.eventId == eventId);
void scrollToEventId(
String eventId, {
bool highlightEvent = true,
}) async {
final eventIndex = timeline!.events
.where((event) => event.isVisibleInGui)
.toList()
.indexWhere((e) => e.eventId == eventId);
if (eventIndex == -1) {
setState(() {
timeline = null;
@ -1125,11 +1131,14 @@ class ChatController extends State<ChatPageWithRoom>
});
return;
}
setState(() {
scrollToEventIdMarker = eventId;
});
if (highlightEvent) {
setState(() {
scrollToEventIdMarker = eventId;
});
}
await scrollController.scrollToIndex(
eventIndex,
eventIndex + 1,
duration: FluffyThemes.animationDuration,
preferPosition: AutoScrollPosition.middle,
);
_updateScrollController();

View file

@ -370,15 +370,17 @@ class UserBottomSheetView extends StatelessWidget {
onTap: () => controller
.participantAction(UserBottomSheetAction.unban),
),
if (user != null && user.id != client.userID)
ListTile(
textColor: Theme.of(context).colorScheme.onErrorContainer,
iconColor: Theme.of(context).colorScheme.onErrorContainer,
title: Text(L10n.of(context)!.reportUser),
leading: const Icon(Icons.report_outlined),
onTap: () => controller
.participantAction(UserBottomSheetAction.report),
),
// #Pangea
// if (user != null && user.id != client.userID)
// ListTile(
// textColor: Theme.of(context).colorScheme.onErrorContainer,
// iconColor: Theme.of(context).colorScheme.onErrorContainer,
// title: Text(L10n.of(context)!.reportUser),
// leading: const Icon(Icons.report_outlined),
// onTap: () => controller
// .participantAction(UserBottomSheetAction.report),
// ),
// Pangea#
if (profileSearchError != null)
ListTile(
leading: const Icon(