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
// tabbed area a fixed height so it can layout inside the
// scrollable column.
final mobileTabHeight = MediaQuery.of(context).size.height * 0.72;
return SingleChildScrollView(
child: Column(
// Mobile: avoid two scrollables nested together. detailsCard can
// independently scroll and the tabbed card takes whatever space
// remains so the chat/activity list always receives gestures and
// can never be pushed completely offscreen.
return Column(
children: [
detailsCard,
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),
// 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),
const SizedBox(height: 12),
_buildTatRow(context, ticket, effectiveRespondedAt),
@ -150,13 +157,16 @@ class _TicketDetailScreenState extends ConsumerState<TicketDetailScreen> {
const SizedBox(width: 8),
IconButton(
tooltip: 'Open task',
onPressed: () => context.go('/tasks/${taskForTicket.id}'),
onPressed: () =>
context.go('/tasks/${taskForTicket.id}'),
icon: const Icon(Icons.open_in_new),
),
],
),
],
],
),
],
);
final detailsCard = Card(
@ -410,19 +420,16 @@ class _TicketDetailScreenState extends ConsumerState<TicketDetailScreen> {
);
}
// Mobile: make entire detail screen scrollable and give the
// messages area a fixed height so it can layout inside the
// scrollable column.
final mobileMessagesHeight =
MediaQuery.of(context).size.height * 0.72;
return SingleChildScrollView(
child: Column(
// Mobile: avoid nesting scrollables. detailsCard itself is
// scrollable if it grows tall, and the messages area takes the
// remaining space so the chat list can always receive touch
// gestures and never end up offscreen.
return Column(
children: [
detailsCard,
const SizedBox(height: 12),
SizedBox(height: mobileMessagesHeight, child: messagesCard),
Expanded(child: messagesCard),
],
),
);
},
),