Fix height of chat boxes

This commit is contained in:
Marc Rejohn Castillano 2026-02-23 18:50:31 +08:00
parent 9a0cf7a89d
commit ee1bf5e113
2 changed files with 51 additions and 46 deletions

View File

@ -2026,18 +2026,16 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
); );
} }
// Mobile: make whole detail screen scrollable and give the // Mobile: avoid two scrollables nested together. detailsCard can
// tabbed area a fixed height so it can layout inside the // independently scroll and the tabbed card takes whatever space
// scrollable column. // remains so the chat/activity list always receives gestures and
final mobileTabHeight = MediaQuery.of(context).size.height * 0.72; // can never be pushed completely offscreen.
return SingleChildScrollView( return Column(
child: Column(
children: [ children: [
detailsCard, detailsCard,
const SizedBox(height: 12), const SizedBox(height: 12),
SizedBox(height: mobileTabHeight, child: tabbedCard), Expanded(child: tabbedCard),
], ],
),
); );
}, },
), ),

View File

@ -133,6 +133,13 @@ class _TicketDetailScreenState extends ConsumerState<TicketDetailScreen> {
], ],
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
// collapse the rest of the details so tall chat areas won't push off-screen
ExpansionTile(
key: const Key('ticket-details-expansion'),
title: const Text('Details'),
initiallyExpanded: true,
childrenPadding: const EdgeInsets.only(top: 8),
children: [
Text(ticket.description), Text(ticket.description),
const SizedBox(height: 12), const SizedBox(height: 12),
_buildTatRow(context, ticket, effectiveRespondedAt), _buildTatRow(context, ticket, effectiveRespondedAt),
@ -150,13 +157,16 @@ class _TicketDetailScreenState extends ConsumerState<TicketDetailScreen> {
const SizedBox(width: 8), const SizedBox(width: 8),
IconButton( IconButton(
tooltip: 'Open task', tooltip: 'Open task',
onPressed: () => context.go('/tasks/${taskForTicket.id}'), onPressed: () =>
context.go('/tasks/${taskForTicket.id}'),
icon: const Icon(Icons.open_in_new), icon: const Icon(Icons.open_in_new),
), ),
], ],
), ),
], ],
], ],
),
],
); );
final detailsCard = Card( final detailsCard = Card(
@ -410,19 +420,16 @@ class _TicketDetailScreenState extends ConsumerState<TicketDetailScreen> {
); );
} }
// Mobile: make entire detail screen scrollable and give the // Mobile: avoid nesting scrollables. detailsCard itself is
// messages area a fixed height so it can layout inside the // scrollable if it grows tall, and the messages area takes the
// scrollable column. // remaining space so the chat list can always receive touch
final mobileMessagesHeight = // gestures and never end up offscreen.
MediaQuery.of(context).size.height * 0.72; return Column(
return SingleChildScrollView(
child: Column(
children: [ children: [
detailsCard, detailsCard,
const SizedBox(height: 12), const SizedBox(height: 12),
SizedBox(height: mobileMessagesHeight, child: messagesCard), Expanded(child: messagesCard),
], ],
),
); );
}, },
), ),