Fixed task detail scrolling issues on mobile

This commit is contained in:
Marc Rejohn Castillano 2026-02-25 07:32:06 +08:00
parent cb71a7ea3a
commit 8e8269d12b

View File

@ -2065,15 +2065,15 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
);
}
// 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),
Expanded(child: tabbedCard),
// Mobile/tablet: allow vertical scrolling of detail card while
// keeping the chat/activity panel filling the remaining viewport
// (and scrolling internally). Use a CustomScrollView to provide a
// bounded height for the tabbed card via SliverFillRemaining.
return CustomScrollView(
slivers: [
SliverToBoxAdapter(child: detailsCard),
const SliverToBoxAdapter(child: SizedBox(height: 12)),
SliverFillRemaining(hasScrollBody: true, child: tabbedCard),
],
);
},
@ -2190,7 +2190,6 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
? null
: assignedForTask.last;
DateTime? firstMessageByAssignee;
DateTime? startedByAssignee;
if (latestAssignment != null) {
for (final l in logs) {
@ -2209,9 +2208,6 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
if (latestAssignment != null) {
final assignedAt = latestAssignment.createdAt;
final candidates = <DateTime>[];
if (firstMessageByAssignee != null) {
candidates.add(firstMessageByAssignee);
}
if (startedByAssignee != null) {
candidates.add(startedByAssignee);
}
@ -2779,7 +2775,7 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
);
},
loading: () => const SizedBox.shrink(),
error: (_, __) => const SizedBox.shrink(),
error: (error, _) => const SizedBox.shrink(),
),
],
),