Merge branch 'main' into 3168-allow-clicking-of-words-in-transcripts

This commit is contained in:
ggurdin 2025-06-20 15:03:24 -04:00 committed by GitHub
commit c89abd4862
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 71 additions and 73 deletions

View file

@ -37,7 +37,6 @@ class AudioPlayerWidget extends StatefulWidget {
final PangeaAudioFile? matrixFile;
final ChatController chatController;
final MessageOverlayController? overlayController;
final VoidCallback? onPlay;
final bool autoplay;
// Pangea#
@ -55,7 +54,6 @@ class AudioPlayerWidget extends StatefulWidget {
this.matrixFile,
required this.chatController,
this.overlayController,
this.onPlay,
this.autoplay = false,
// Pangea#
super.key,
@ -465,11 +463,7 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
onLongPress: () =>
widget.event?.saveFile(context),
// Pangea#
onTap: () {
widget.onPlay != null
? widget.onPlay!.call()
: _onButtonTap();
},
onTap: _onButtonTap,
child: Material(
color: widget.color.withAlpha(64),
borderRadius: BorderRadius.circular(64),

View file

@ -225,14 +225,6 @@ class MessageContent extends StatelessWidget {
eventId: event.eventId,
roomId: event.room.id,
senderId: event.senderId,
onPlay: overlayController == null
? () {
controller.showToolbar(
pangeaMessageEvent!.event,
pangeaMessageEvent: pangeaMessageEvent,
);
}
: null,
autoplay: overlayController != null,
// Pangea#
);

View file

@ -544,7 +544,7 @@ class RoomDetailsButtonRowState extends State<RoomDetailsButtonRow> {
);
}
final button = buttons[index];
final button = mainViewButtons[index];
return Expanded(
child: RoomDetailsButton(
mini: mini,
@ -729,66 +729,70 @@ class RoomParticipantsSection extends StatelessWidget {
padding: EdgeInsets.all(_padding),
child: SizedBox(
width: _width,
child: Column(
children: [
Stack(
alignment: Alignment.center,
children: [
if (gradient != null)
CircleAvatar(
radius: _width / 2,
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: gradient,
),
),
)
else
SizedBox(
height: _width,
width: _width,
),
Builder(
builder: (context) {
return MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () => showMemberActionsPopupMenu(
context: context,
user: user,
child: Opacity(
opacity: user.membership == Membership.join ? 1.0 : 0.5,
child: Column(
children: [
Stack(
alignment: Alignment.center,
children: [
if (gradient != null)
CircleAvatar(
radius: _width / 2,
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: gradient,
),
child: Center(
child: Avatar(
mxContent: user.avatarUrl,
name: user.calcDisplayname(),
size: _width - 6.0,
presenceUserId: user.id,
showPresence: false,
),
)
else
SizedBox(
height: _width,
width: _width,
),
Builder(
builder: (context) {
return MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () => showMemberActionsPopupMenu(
context: context,
user: user,
),
child: Center(
child: Avatar(
mxContent: user.avatarUrl,
name: user.calcDisplayname(),
size: _width - 6.0,
presenceUserId: user.id,
showPresence: false,
),
),
),
),
);
},
),
],
),
Text(
user.calcDisplayname(),
style: Theme.of(context)
.textTheme
.labelLarge
?.copyWith(
color: Theme.of(context).colorScheme.primary,
fontWeight: FontWeight.bold,
);
},
),
overflow: TextOverflow.ellipsis,
),
LevelDisplayName(
userId: user.id,
textStyle: Theme.of(context).textTheme.labelSmall,
),
],
],
),
Text(
user.calcDisplayname(),
style: Theme.of(context)
.textTheme
.labelLarge
?.copyWith(
color:
Theme.of(context).colorScheme.primary,
fontWeight: FontWeight.bold,
),
overflow: TextOverflow.ellipsis,
),
LevelDisplayName(
userId: user.id,
textStyle: Theme.of(context).textTheme.labelSmall,
),
],
),
),
),
);

View file

@ -89,6 +89,14 @@ class LoadParticipantsUtilState extends State<LoadParticipantsUtil> {
return -1;
}
if (a.membership != Membership.join && b.membership != Membership.join) {
return a.displayName?.compareTo(b.displayName ?? '') ?? 0;
} else if (a.membership != Membership.join) {
return 1;
} else if (b.membership != Membership.join) {
return -1;
}
final PublicProfileModel? aProfile = _levelsCache[a.id];
final PublicProfileModel? bProfile = _levelsCache[b.id];
@ -100,7 +108,7 @@ class LoadParticipantsUtilState extends State<LoadParticipantsUtil> {
Future<void> _cacheLevels() async {
for (final user in participants) {
if (_levelsCache[user.id] == null) {
if (_levelsCache[user.id] == null && user.membership == Membership.join) {
_levelsCache[user.id] = await MatrixState
.pangeaController.userController
.getPublicProfile(user.id);