refactor: Improved UX for room upgrades

This commit is contained in:
Krille 2025-03-07 12:29:31 +01:00
commit b645193f7b
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
5 changed files with 37 additions and 47 deletions

View file

@ -169,11 +169,6 @@ class ChatView extends StatelessWidget {
if (scrollUpBannerEventId != null) {
appbarBottomHeight += ChatAppBarListTile.fixedHeight;
}
final tombstoneEvent =
controller.room.getState(EventTypes.RoomTombstone);
if (tombstoneEvent != null) {
appbarBottomHeight += ChatAppBarListTile.fixedHeight;
}
return Scaffold(
appBar: AppBar(
actionsIconTheme: IconThemeData(
@ -212,18 +207,6 @@ class ChatView extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
PinnedEvents(controller),
if (tombstoneEvent != null)
ChatAppBarListTile(
title: tombstoneEvent.parsedTombstoneContent.body,
leading: const Padding(
padding: EdgeInsets.all(8.0),
child: Icon(Icons.upgrade_outlined),
),
trailing: TextButton(
onPressed: controller.goToNewRoomAction,
child: Text(L10n.of(context).goToTheNewRoom),
),
),
if (scrollUpBannerEventId != null)
ChatAppBarListTile(
leading: IconButton(
@ -300,7 +283,21 @@ class ChatView extends StatelessWidget {
child: ChatEventList(controller: controller),
),
),
if (controller.room.canSendDefaultMessages &&
if (controller.room.isExtinct)
Container(
margin: EdgeInsets.only(
bottom: bottomSheetPadding,
left: bottomSheetPadding,
right: bottomSheetPadding,
),
width: double.infinity,
child: ElevatedButton.icon(
icon: const Icon(Icons.chevron_right),
label: Text(L10n.of(context).enterNewChat),
onPressed: controller.goToNewRoomAction,
),
)
else if (controller.room.canSendDefaultMessages &&
controller.room.membership == Membership.join)
Container(
margin: EdgeInsets.only(