@@ -10,7 +10,6 @@ import 'package:omi/pages/conversation_detail/widgets.dart';
10
10
import 'package:omi/pages/settings/people.dart' ;
11
11
import 'package:omi/providers/connectivity_provider.dart' ;
12
12
import 'package:omi/providers/conversation_provider.dart' ;
13
- import 'package:omi/utils/alerts/app_snackbar.dart' ;
14
13
import 'package:omi/utils/analytics/mixpanel.dart' ;
15
14
import 'package:omi/utils/other/temp.dart' ;
16
15
import 'package:omi/widgets/conversation_bottom_bar.dart' ;
@@ -49,10 +48,23 @@ class _ConversationDetailPageState extends State<ConversationDetailPage> with Ti
49
48
void initState () {
50
49
super .initState ();
51
50
52
- _controller = TabController (length: 2 , vsync: this , initialIndex: 1 ); // Start with summary tab
51
+ _controller = TabController (length: 3 , vsync: this , initialIndex: 1 ); // Start with summary tab
53
52
_controller! .addListener (() {
54
53
setState (() {
55
- selectedTab = _controller! .index == 0 ? ConversationTab .transcript : ConversationTab .summary;
54
+ switch (_controller! .index) {
55
+ case 0 :
56
+ selectedTab = ConversationTab .transcript;
57
+ break ;
58
+ case 1 :
59
+ selectedTab = ConversationTab .summary;
60
+ break ;
61
+ case 2 :
62
+ selectedTab = ConversationTab .actionItems;
63
+ break ;
64
+ default :
65
+ debugPrint ('Invalid tab index: ${_controller !.index }' );
66
+ selectedTab = ConversationTab .summary;
67
+ }
56
68
});
57
69
});
58
70
@@ -188,6 +200,7 @@ class _ConversationDetailPageState extends State<ConversationDetailPage> with Ti
188
200
},
189
201
),
190
202
const SummaryTab (),
203
+ const ActionItemsTab (),
191
204
],
192
205
);
193
206
}),
@@ -210,7 +223,21 @@ class _ConversationDetailPageState extends State<ConversationDetailPage> with Ti
210
223
hasSegments:
211
224
conversation.transcriptSegments.isNotEmpty || conversation.externalIntegration != null ,
212
225
onTabSelected: (tab) {
213
- int index = tab == ConversationTab .transcript ? 0 : 1 ;
226
+ int index;
227
+ switch (tab) {
228
+ case ConversationTab .transcript:
229
+ index = 0 ;
230
+ break ;
231
+ case ConversationTab .summary:
232
+ index = 1 ;
233
+ break ;
234
+ case ConversationTab .actionItems:
235
+ index = 2 ;
236
+ break ;
237
+ default :
238
+ debugPrint ('Invalid tab selected: $tab ' );
239
+ index = 1 ; // Default to summary tab
240
+ }
214
241
_controller! .animateTo (index);
215
242
},
216
243
onStopPressed: () {
@@ -556,3 +583,62 @@ class EditSegmentWidget extends StatelessWidget {
556
583
});
557
584
}
558
585
}
586
+
587
+ class ActionItemsTab extends StatelessWidget {
588
+ const ActionItemsTab ({super .key});
589
+
590
+ @override
591
+ Widget build (BuildContext context) {
592
+ return GestureDetector (
593
+ onTap: () => FocusScope .of (context).unfocus (),
594
+ child: Consumer <ConversationDetailProvider >(
595
+ builder: (context, provider, child) {
596
+ final hasActionItems = provider.conversation.structured.actionItems.where ((item) => ! item.deleted).isNotEmpty;
597
+
598
+ return ListView (
599
+ shrinkWrap: true ,
600
+ children: [
601
+ const SizedBox (height: 24 ),
602
+ if (hasActionItems) const ActionItemsListWidget () else _buildEmptyState (context),
603
+ const SizedBox (height: 150 )
604
+ ],
605
+ );
606
+ },
607
+ ),
608
+ );
609
+ }
610
+
611
+ Widget _buildEmptyState (BuildContext context) {
612
+ return Center (
613
+ child: Padding (
614
+ padding: const EdgeInsets .symmetric (horizontal: 24.0 , vertical: 40.0 ),
615
+ child: Column (
616
+ mainAxisAlignment: MainAxisAlignment .center,
617
+ children: [
618
+ const Icon (
619
+ Icons .check_circle_outline,
620
+ size: 72 ,
621
+ color: Colors .grey,
622
+ ),
623
+ const SizedBox (height: 24 ),
624
+ Text (
625
+ 'No Action Items' ,
626
+ style: Theme .of (context).textTheme.headlineSmall? .copyWith (
627
+ color: Colors .white,
628
+ ),
629
+ ),
630
+ const SizedBox (height: 12 ),
631
+ Text (
632
+ 'This memory doesn\' t have any action items yet. They\' ll appear here when your conversations include tasks or to-dos.' ,
633
+ textAlign: TextAlign .center,
634
+ style: TextStyle (
635
+ color: Colors .grey.shade400,
636
+ fontSize: 16 ,
637
+ ),
638
+ ),
639
+ ],
640
+ ),
641
+ ),
642
+ );
643
+ }
644
+ }
0 commit comments