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