Skip to content

2309-action-items-make-them-as-a-separate-tab #2310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 12, 2025
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
94 changes: 90 additions & 4 deletions app/lib/pages/conversation_detail/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import 'package:omi/pages/conversation_detail/widgets.dart';
import 'package:omi/pages/settings/people.dart';
import 'package:omi/providers/connectivity_provider.dart';
import 'package:omi/providers/conversation_provider.dart';
import 'package:omi/utils/alerts/app_snackbar.dart';
import 'package:omi/utils/analytics/mixpanel.dart';
import 'package:omi/utils/other/temp.dart';
import 'package:omi/widgets/conversation_bottom_bar.dart';
Expand Down Expand Up @@ -49,10 +48,23 @@ class _ConversationDetailPageState extends State<ConversationDetailPage> with Ti
void initState() {
super.initState();

_controller = TabController(length: 2, vsync: this, initialIndex: 1); // Start with summary tab
_controller = TabController(length: 3, vsync: this, initialIndex: 1); // Start with summary tab
_controller!.addListener(() {
setState(() {
selectedTab = _controller!.index == 0 ? ConversationTab.transcript : ConversationTab.summary;
switch (_controller!.index) {
case 0:
selectedTab = ConversationTab.transcript;
break;
case 1:
selectedTab = ConversationTab.summary;
break;
case 2:
selectedTab = ConversationTab.actionItems;
break;
default:
debugPrint('Invalid tab index: ${_controller!.index}');
selectedTab = ConversationTab.summary;
}
});
});

Expand Down Expand Up @@ -188,6 +200,7 @@ class _ConversationDetailPageState extends State<ConversationDetailPage> with Ti
},
),
const SummaryTab(),
const ActionItemsTab(),
],
);
}),
Expand All @@ -210,7 +223,21 @@ class _ConversationDetailPageState extends State<ConversationDetailPage> with Ti
hasSegments:
conversation.transcriptSegments.isNotEmpty || conversation.externalIntegration != null,
onTabSelected: (tab) {
int index = tab == ConversationTab.transcript ? 0 : 1;
int index;
switch (tab) {
case ConversationTab.transcript:
index = 0;
break;
case ConversationTab.summary:
index = 1;
break;
case ConversationTab.actionItems:
index = 2;
break;
default:
debugPrint('Invalid tab selected: $tab');
index = 1; // Default to summary tab
}
_controller!.animateTo(index);
},
onStopPressed: () {
Expand Down Expand Up @@ -556,3 +583,62 @@ class EditSegmentWidget extends StatelessWidget {
});
}
}

class ActionItemsTab extends StatelessWidget {
const ActionItemsTab({super.key});

@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
child: Consumer<ConversationDetailProvider>(
builder: (context, provider, child) {
final hasActionItems = provider.conversation.structured.actionItems.where((item) => !item.deleted).isNotEmpty;

return ListView(
shrinkWrap: true,
children: [
const SizedBox(height: 24),
if (hasActionItems) const ActionItemsListWidget() else _buildEmptyState(context),
const SizedBox(height: 150)
],
);
},
),
);
}

Widget _buildEmptyState(BuildContext context) {
return Center(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 40.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(
Icons.check_circle_outline,
size: 72,
color: Colors.grey,
),
const SizedBox(height: 24),
Text(
'No Action Items',
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
color: Colors.white,
),
),
const SizedBox(height: 12),
Text(
'This memory doesn\'t have any action items yet. They\'ll appear here when your conversations include tasks or to-dos.',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.grey.shade400,
fontSize: 16,
),
),
],
),
),
);
}
}
23 changes: 19 additions & 4 deletions app/lib/widgets/conversation_bottom_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ enum ConversationBottomBarMode {
detail // For viewing completed conversations
}

enum ConversationTab { transcript, summary }
enum ConversationTab { transcript, summary, actionItems }

class ConversationBottomBar extends StatelessWidget {
final ConversationBottomBarMode mode;
Expand Down Expand Up @@ -49,7 +49,7 @@ class ConversationBottomBar extends StatelessWidget {
borderRadius: BorderRadius.circular(28),
child: Container(
height: 56,
width: mode == ConversationBottomBarMode.recording ? 180 : 290,
width: mode == ConversationBottomBarMode.recording ? 180 : 360,
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: Colors.grey.shade900,
Expand All @@ -69,8 +69,15 @@ class ConversationBottomBar extends StatelessWidget {
// Transcript tab
_buildTranscriptTab(),

// Stop button or Summary tab
if (mode == ConversationBottomBarMode.recording) _buildStopButton() else _buildSummaryTab(context),
// Stop button or Summary/Action Items tabs
...switch (mode) {
ConversationBottomBarMode.recording => [_buildStopButton()],
ConversationBottomBarMode.detail => [
_buildSummaryTab(context),
_buildActionItemsTab(),
],
_ => [_buildSummaryTab(context)],
},
],
),
),
Expand Down Expand Up @@ -164,4 +171,12 @@ class ConversationBottomBar extends StatelessWidget {
},
);
}

Widget _buildActionItemsTab() {
return TabButton(
icon: Icons.check_circle_outline,
isSelected: selectedTab == ConversationTab.actionItems,
onTap: () => onTabSelected(ConversationTab.actionItems),
);
}
}