Fix height of chat boxes
This commit is contained in:
parent
9a0cf7a89d
commit
ee1bf5e113
|
|
@ -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),
|
Expanded(child: tabbedCard),
|
||||||
SizedBox(height: mobileTabHeight, child: tabbedCard),
|
],
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -133,29 +133,39 @@ class _TicketDetailScreenState extends ConsumerState<TicketDetailScreen> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Text(ticket.description),
|
// collapse the rest of the details so tall chat areas won't push off-screen
|
||||||
const SizedBox(height: 12),
|
ExpansionTile(
|
||||||
_buildTatRow(context, ticket, effectiveRespondedAt),
|
key: const Key('ticket-details-expansion'),
|
||||||
if (taskForTicket != null) ...[
|
title: const Text('Details'),
|
||||||
const SizedBox(height: 16),
|
initiallyExpanded: true,
|
||||||
Row(
|
childrenPadding: const EdgeInsets.only(top: 8),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
children: [
|
||||||
children: [
|
Text(ticket.description),
|
||||||
Expanded(
|
const SizedBox(height: 12),
|
||||||
child: TaskAssignmentSection(
|
_buildTatRow(context, ticket, effectiveRespondedAt),
|
||||||
taskId: taskForTicket.id,
|
if (taskForTicket != null) ...[
|
||||||
canAssign: showAssign,
|
const SizedBox(height: 16),
|
||||||
),
|
Row(
|
||||||
),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
const SizedBox(width: 8),
|
children: [
|
||||||
IconButton(
|
Expanded(
|
||||||
tooltip: 'Open task',
|
child: TaskAssignmentSection(
|
||||||
onPressed: () => context.go('/tasks/${taskForTicket.id}'),
|
taskId: taskForTicket.id,
|
||||||
icon: const Icon(Icons.open_in_new),
|
canAssign: showAssign,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
IconButton(
|
||||||
|
tooltip: 'Open task',
|
||||||
|
onPressed: () =>
|
||||||
|
context.go('/tasks/${taskForTicket.id}'),
|
||||||
|
icon: const Icon(Icons.open_in_new),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -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(
|
children: [
|
||||||
child: Column(
|
detailsCard,
|
||||||
children: [
|
const SizedBox(height: 12),
|
||||||
detailsCard,
|
Expanded(child: messagesCard),
|
||||||
const SizedBox(height: 12),
|
],
|
||||||
SizedBox(height: mobileMessagesHeight, child: messagesCard),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user