Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ PODS:
- BoringSSL-GRPC/Implementation (0.0.37):
- BoringSSL-GRPC/Interface (= 0.0.37)
- BoringSSL-GRPC/Interface (0.0.37)
- cloud_firestore (6.1.0):
- cloud_firestore (6.1.1):
- Firebase/Firestore (= 12.6.0)
- firebase_core
- Flutter
Expand Down Expand Up @@ -1573,7 +1573,7 @@ SPEC CHECKSUMS:
app_links: 3dbc685f76b1693c66a6d9dd1e9ab6f73d97dc0a
audioplayers_darwin: 4f9ca89d92d3d21cec7ec580e78ca888e5fb68bd
BoringSSL-GRPC: dded2a44897e45f28f08ae87a55ee4bcd19bc508
cloud_firestore: 5588cff17e7d54996b46786bb6f1c5db3c06c0a8
cloud_firestore: 45532e0c1fd1f6a5720af8aa0312470c366b73d2
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
downloadsfolder: 7d5c7b5d23e3c4dded522ff2a2ef14a56846378a
Expand Down
17 changes: 10 additions & 7 deletions lib/features/events/widgets/event_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ class EventWidget extends ConsumerWidget {
final String eventId;
final EdgeInsetsGeometry? margin;
final bool showSheetName;
final bool isTitleLongPressEnabled;

const EventWidget({
super.key,
required this.eventId,
this.margin,
this.showSheetName = true,
});
}) : isTitleLongPressEnabled = !showSheetName;

@override
Widget build(BuildContext context, WidgetRef ref) {
Expand Down Expand Up @@ -106,12 +107,14 @@ class EventWidget extends ConsumerWidget {
onTapText: () => context.push(
AppRoutes.eventDetail.route.replaceAll(':eventId', eventId),
),
onTapLongPressText: () => showEventMenu(
context: context,
ref: ref,
isEditing: isEditing,
eventId: eventId,
),
onTapLongPressText: isTitleLongPressEnabled
? () => showEventMenu(
context: context,
ref: ref,
isEditing: isEditing,
eventId: eventId,
)
: null,
);
}

Expand Down
10 changes: 4 additions & 6 deletions lib/features/home/widgets/today_focus/todays_focus_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ class TodaysFocusWidget extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final todaysEvents = ref.watch(todaysEventsProvider);
final todaysTasks = ref.watch(todaysTasksProvider);
final activePollsWithPendingResponse = ref.watch(
activePollsWithPendingResponseProvider,
);
final activePollsList = ref.watch(activePollListProvider);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

find . -name "*.dart" -type f | head -20

Repository: acterglobal/zoe

Length of output: 973


🏁 Script executed:

# Search for provider definitions
rg -n 'final.*activePollListProvider|final.*activePollsWithPendingResponseProvider' --type=dart

Repository: acterglobal/zoe

Length of output: 557


🏁 Script executed:

# Search more broadly for these providers
rg -B5 -A10 'activePollListProvider|activePollsWithPendingResponseProvider' --type=dart

Repository: acterglobal/zoe

Length of output: 50371


🏁 Script executed:

# Find the provider definitions in poll_providers.dart
rg -B5 -A15 'final activePollList|final activePollsWithPendingResponse' lib/features/polls/providers/poll_providers.dart

Repository: acterglobal/zoe

Length of output: 662


🏁 Script executed:

# Check the todays_focus_widget_test to see if it's still using the old provider
head -60 test/features/home/widgets/today_focus/todays_focus_widget_test.dart | grep -A5 -B5 'activePoll'

Repository: acterglobal/zoe

Length of output: 345


🏁 Script executed:

# Get the full provider definitions more clearly
sed -n '310,330p' lib/features/polls/providers/poll_providers.dart

Repository: acterglobal/zoe

Length of output: 663


🏁 Script executed:

# Search for activePollsWithPendingResponse definition
rg -B2 -A20 'activePollsWithPendingResponseProvider' lib/features/polls/providers/poll_providers.dart | head -50

Repository: acterglobal/zoe

Length of output: 41


🏁 Script executed:

# Check if tests in todays_focus_widget_test.dart need to be updated
grep -n 'activePollsWithPendingResponseProvider\|activePollListProvider' test/features/home/widgets/today_focus/todays_focus_widget_test.dart | head -20

Repository: acterglobal/zoe

Length of output: 1394


Update tests to match the provider change in the widget.

The widget now uses activePollListProvider, which returns all active polls (including those the user has already voted on), not just pending ones. However, the test file test/features/home/widgets/today_focus/todays_focus_widget_test.dart still overrides activePollsWithPendingResponseProvider in 18+ test cases. Update all test overrides to use activePollListProvider instead to match the actual widget implementation.

Additionally, confirm that displaying all active polls (not just pending) is the intended behavior for the Today's Focus section.

🤖 Prompt for AI Agents
In lib/features/home/widgets/today_focus/todays_focus_widget.dart around line 24
and in test/features/home/widgets/today_focus/todays_focus_widget_test.dart, the
widget now reads from activePollListProvider but the tests still override
activePollsWithPendingResponseProvider; update all test overrides (18+
instances) to override activePollListProvider instead, adjust any mocked return
values to reflect that it now returns all active polls (including
already-voted), and run/adjust assertions to confirm the widget displays all
active polls as intended for Today's Focus.


if (todaysEvents.isEmpty &&
todaysTasks.isEmpty &&
activePollsWithPendingResponse.isEmpty) {
activePollsList.isEmpty) {
return const SizedBox.shrink();
}

Expand All @@ -47,8 +45,8 @@ class TodaysFocusWidget extends ConsumerWidget {
_buildTaskSection(context, todaysTasks),
const SizedBox(height: 16),
],
if (activePollsWithPendingResponse.isNotEmpty) ...[
_buildPollSection(context, activePollsWithPendingResponse),
if (activePollsList.isNotEmpty) ...[
_buildPollSection(context, activePollsList),
const SizedBox(height: 16),
],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class TodaysItemWidget extends StatelessWidget {
shape: BoxShape.circle,
color: color.withValues(alpha: 0.2),
),
child: Icon(Icons.event_rounded, color: color, size: 18),
child: Icon(icon, color: color, size: 18),
),
const SizedBox(width: 12),
Text(
Expand Down
22 changes: 17 additions & 5 deletions lib/features/polls/screens/polls_list_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class _PollsListScreenState extends ConsumerState<PollsListScreen>
title: ZoeAppBar(title: L10n.of(context).polls),
bottom: ZoeGlassyTabWidget(
tabTexts: [
PollStatus.draft.name,
PollStatus.active.name,
PollStatus.draft.name,
PollStatus.completed.name,
],
selectedIndex: _tabController.index,
Expand Down Expand Up @@ -89,8 +89,8 @@ class _PollsListScreenState extends ConsumerState<PollsListScreen>
child: TabBarView(
controller: _tabController,
children: [
_buildNotActivePollsTab(),
_buildActivePollsTab(),
_buildNotActivePollsTab(),
_buildCompletedPollsTab(),
],
),
Expand All @@ -107,7 +107,11 @@ class _PollsListScreenState extends ConsumerState<PollsListScreen>
pollsProvider: notActivePollListProvider,
isEditing: false,
shrinkWrap: false,
emptyState: EmptyStateListWidget(message: L10n.of(context).noPollsFound, color: AppColors.brightMagentaColor, contentType: ContentType.poll),
emptyState: EmptyStateListWidget(
message: L10n.of(context).noPollsFound,
color: AppColors.brightMagentaColor,
contentType: ContentType.poll,
),
),
);
}
Expand All @@ -119,7 +123,11 @@ class _PollsListScreenState extends ConsumerState<PollsListScreen>
pollsProvider: activePollListProvider,
isEditing: false,
shrinkWrap: false,
emptyState: EmptyStateListWidget(message: L10n.of(context).noPollsFound, color: AppColors.brightMagentaColor, contentType: ContentType.poll),
emptyState: EmptyStateListWidget(
message: L10n.of(context).noPollsFound,
color: AppColors.brightMagentaColor,
contentType: ContentType.poll,
),
),
);
}
Expand All @@ -131,7 +139,11 @@ class _PollsListScreenState extends ConsumerState<PollsListScreen>
pollsProvider: completedPollListProvider,
isEditing: false,
shrinkWrap: false,
emptyState: EmptyStateListWidget(message: L10n.of(context).noPollsFound, color: AppColors.brightMagentaColor, contentType: ContentType.poll),
emptyState: EmptyStateListWidget(
message: L10n.of(context).noPollsFound,
color: AppColors.brightMagentaColor,
contentType: ContentType.poll,
),
),
);
}
Expand Down
16 changes: 9 additions & 7 deletions lib/features/polls/widgets/poll_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,15 @@ class PollWidget extends ConsumerWidget {
);
}
},
onTapLongPressText: () => showPollMenu(
context: context,
ref: ref,
isEditing: isEditing,
pollId: pollId,
isDetailScreen: isDetailScreen,
),
onTapLongPressText: isDetailScreen
? () => showPollMenu(
context: context,
ref: ref,
isEditing: isEditing,
pollId: pollId,
isDetailScreen: isDetailScreen,
)
: null,
),
),
if (isEditing)
Expand Down
Loading