From 8e8269d12b63424da85cbdcffe282ab8de94731f Mon Sep 17 00:00:00 2001 From: Marc Rejohn Castillano Date: Wed, 25 Feb 2026 07:32:06 +0800 Subject: [PATCH] Fixed task detail scrolling issues on mobile --- lib/screens/tasks/task_detail_screen.dart | 24 ++++++++++------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/lib/screens/tasks/task_detail_screen.dart b/lib/screens/tasks/task_detail_screen.dart index f78d28d6..ff179145 100644 --- a/lib/screens/tasks/task_detail_screen.dart +++ b/lib/screens/tasks/task_detail_screen.dart @@ -2065,15 +2065,15 @@ class _TaskDetailScreenState extends ConsumerState ); } - // 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 ? null : assignedForTask.last; - DateTime? firstMessageByAssignee; DateTime? startedByAssignee; if (latestAssignment != null) { for (final l in logs) { @@ -2209,9 +2208,6 @@ class _TaskDetailScreenState extends ConsumerState if (latestAssignment != null) { final assignedAt = latestAssignment.createdAt; final candidates = []; - if (firstMessageByAssignee != null) { - candidates.add(firstMessageByAssignee); - } if (startedByAssignee != null) { candidates.add(startedByAssignee); } @@ -2779,7 +2775,7 @@ class _TaskDetailScreenState extends ConsumerState ); }, loading: () => const SizedBox.shrink(), - error: (_, __) => const SizedBox.shrink(), + error: (error, _) => const SizedBox.shrink(), ), ], ),