Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
40bf58b
Revamps conversation details page #1
beastoin Apr 9, 2025
e28c2e3
Enhance tab controller on conversation details
beastoin Apr 10, 2025
88514ba
With conversational apps
beastoin Apr 10, 2025
4a89b9c
Add support reprocess with apps based
beastoin Apr 10, 2025
406198e
Add support auto-selected best fit apps for conversation summarizing
beastoin Apr 10, 2025
f2e5016
Local assets on auto selecting summarizing apps
beastoin Apr 10, 2025
396148b
Enhance sumarized apps sheets
beastoin Apr 10, 2025
87b233e
refactor: Modularize SummarizedAppsBottomSheet into smaller, focused …
beastoin Apr 10, 2025
b9223f9
feat: Add auto-renew icon to Auto option in apps list
beastoin Apr 10, 2025
3c269b2
refactor: Modularize ConversationBottomBar with reusable components
beastoin Apr 10, 2025
69bc73a
fix: Remove extra closing brace in conversation_bottom_bar.dart
beastoin Apr 10, 2025
c1af569
fix: Handle nullable label in TabButton with null-coalescing operator
beastoin Apr 10, 2025
83c3486
feat: Add generate summary button with reprocessing logic in GetAppsW…
beastoin Apr 10, 2025
641e875
feat: Add support for custom SVG icon in TabButton widget
beastoin Apr 10, 2025
d236e4f
refactor: Remove unused imports from conversation bottom bar
beastoin Apr 10, 2025
73e99bf
feat: Replace sticky note icon with SVG AI magic icon in conversation…
beastoin Apr 10, 2025
c6dd324
feat: Add loading state for summary generation in conversation bottom…
beastoin Apr 10, 2025
e1f3072
refactor: Simplify reprocess conversation button logic and remove unn…
beastoin Apr 10, 2025
7956993
feat: Add loading state when generating conversation summary
beastoin Apr 10, 2025
89edc62
refactor: Remove unnecessary notifyListeners() call in reprocess conv…
beastoin Apr 10, 2025
4d557ee
feat: Show SummarizedAppsBottomSheet on Generate Summary click
beastoin Apr 10, 2025
6265761
refactor: Replace reprocess conversation logic with summarized apps b…
beastoin Apr 10, 2025
9243337
refactor: Prioritize appImage over icon and customIcon in TabButton
beastoin Apr 10, 2025
296e2c6
refactor: Update AppDetailWidget to use typed AppResponse and remove …
beastoin Apr 10, 2025
30cbfeb
refactor: Rename AppDetailWidget to AppResultDetailWidget
beastoin Apr 10, 2025
ad6b9a8
refactor: Remove unused parameters from AppResultDetailWidget
beastoin Apr 10, 2025
3a8a801
feat: Add empty content handling in AppResultDetailWidget
beastoin Apr 10, 2025
f201408
refactor: Simplify empty content display and update no content message
beastoin Apr 10, 2025
3e385f8
feat: Add "Try another app" button when no app content is available
beastoin Apr 10, 2025
2cb1019
style: Remove button and improve empty content message styling
beastoin Apr 10, 2025
2ce7332
refactor: Simplify no content widget layout in conversation detail page
beastoin Apr 10, 2025
f3534bb
feat: Add underline and click handler for "Try another app" text in e…
beastoin Apr 10, 2025
ce5b770
feat: Enhance no content message with interactive "Try another app" link
beastoin Apr 10, 2025
3432c2f
feat: Hide app info section when content is empty
beastoin Apr 10, 2025
972f07d
App results with empty, enhance apps selecting prompts, handle edge c…
beastoin Apr 10, 2025
e075d28
High performance transcript segments widget
beastoin Apr 10, 2025
2d123ce
get app result v2
beastoin Apr 11, 2025
601e103
Extends with default apps, always
beastoin Apr 11, 2025
cc00c45
Enhance the app selecting prompt
beastoin Apr 11, 2025
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 app/lib/backend/http/api/conversations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ Future<List<ServerConversation>> getConversations(
return [];
}

Future<ServerConversation?> reProcessConversationServer(String conversationId) async {
Future<ServerConversation?> reProcessConversationServer(String conversationId, {String? appId}) async {
var response = await makeApiCall(
url: '${Env.apiBaseUrl}v1/conversations/$conversationId/reprocess',
url: '${Env.apiBaseUrl}v1/conversations/$conversationId/reprocess${appId != null ? '?app_id=$appId' : ''}',
headers: {},
method: 'POST',
body: '',
Expand Down
7 changes: 6 additions & 1 deletion app/lib/pages/capture/widgets/widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,14 @@ getTranscriptWidget(
}

return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
if (photos.isNotEmpty) const PhotosGridComponent(),
if (segments.isNotEmpty) TranscriptWidget(segments: segments),
if (segments.isNotEmpty)
TranscriptWidget(
segments: segments,
bottomMargin: 100, // Smaller bottom margin for capturing page
),
],
);
}
Expand Down
206 changes: 73 additions & 133 deletions app/lib/pages/conversation_capturing/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:omi/pages/conversation_detail/page.dart';
import 'package:omi/providers/capture_provider.dart';
import 'package:omi/providers/device_provider.dart';
import 'package:omi/widgets/confirmation_dialog.dart';
import 'package:omi/widgets/conversation_bottom_bar.dart';
import 'package:provider/provider.dart';

class ConversationCapturingPage extends StatefulWidget {
Expand All @@ -27,25 +28,12 @@ class _ConversationCapturingPageState extends State<ConversationCapturingPage> w
final scaffoldKey = GlobalKey<ScaffoldState>();
TabController? _controller;
late bool showSummarizeConfirmation;
Timer? _timer;
int _elapsedTime = 0;

@override
void initState() {
_controller = TabController(length: 2, vsync: this, initialIndex: 0);
_controller!.addListener(() => setState(() {}));
showSummarizeConfirmation = SharedPreferencesUtil().showSummarizeConfirmation;
WidgetsBinding.instance.addPostFrameCallback((_) {
final captureProvider = context.read<CaptureProvider>();
if (captureProvider.segments.isNotEmpty) {
if (captureProvider.inProgressConversation != null) {
setState(() {
_elapsedTime = convertDateTimeToSeconds(captureProvider.inProgressConversation!.createdAt);
});
}
_startTimer();
}
});
super.initState();
}

Expand All @@ -66,14 +54,6 @@ class _ConversationCapturingPageState extends State<ConversationCapturingPage> w
return '${twoDigits(hours)}:${twoDigits(minutes)}:${twoDigits(remainingSeconds)}';
}

void _startTimer() {
_timer = Timer.periodic(const Duration(seconds: 1), (timer) {
setState(() {
_elapsedTime++;
});
});
}

void _pushNewConversation(BuildContext context, conversation) async {
WidgetsBinding.instance.addPostFrameCallback((_) async {
await Navigator.of(context).pushReplacement(MaterialPageRoute(
Expand All @@ -84,28 +64,11 @@ class _ConversationCapturingPageState extends State<ConversationCapturingPage> w
});
}

@override
dispose() {
_timer?.cancel();
super.dispose();
}

@override
Widget build(BuildContext context) {
return Consumer2<CaptureProvider, DeviceProvider>(
builder: (context, provider, deviceProvider, child) {
// Track memory
// if ((provider.memoryProvider?.memories ?? []).isNotEmpty &&
// (provider.memoryProvider!.memories.first.id != widget.topMemoryId || widget.topMemoryId == null)) {
// _pushNewMemory(context, provider.memoryProvider!.memories.first);
// }

// Conversation source
var conversationSource = ConversationSource.omi;
// var captureProvider = context.read<CaptureProvider>();
// if (captureProvider.isGlasses) {
// memorySource = MemorySource.openglass;
// }
return PopScope(
canPop: true,
child: Scaffold(
Expand Down Expand Up @@ -144,35 +107,18 @@ class _ConversationCapturingPageState extends State<ConversationCapturingPage> w
),
body: Column(
children: [
TabBar(
indicatorSize: TabBarIndicatorSize.label,
isScrollable: false,
padding: EdgeInsets.zero,
indicatorPadding: EdgeInsets.zero,
controller: _controller,
labelStyle: Theme.of(context).textTheme.titleLarge!.copyWith(fontSize: 18),
tabs: [
Tab(
text: conversationSource == ConversationSource.openglass
? 'Photos'
: conversationSource == ConversationSource.screenpipe
? 'Raw Data'
: 'Transcript',
),
const Tab(text: 'Summary')
],
indicator: BoxDecoration(color: Colors.transparent, borderRadius: BorderRadius.circular(16)),
),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: TabBarView(
controller: _controller,
physics: const NeverScrollableScrollPhysics(),
children: [
// Transcript tab
ListView(
shrinkWrap: true,
children: [
const SizedBox(height: 16),
provider.segments.isEmpty
? Column(
children: [
Expand All @@ -184,16 +130,23 @@ class _ConversationCapturingPageState extends State<ConversationCapturingPage> w
),
],
)
: getTranscriptWidget(
false,
provider.segments,
[],
deviceProvider.connectedDevice,
)
: Container(
height: provider.segments.length > 100
? MediaQuery.of(context).size.height - 200
: null,
child: getTranscriptWidget(
false,
provider.segments,
[],
deviceProvider.connectedDevice,
),
),
const SizedBox(height: 100), // Add space at bottom for the floating bar
],
),
// Summary tab
Padding(
padding: const EdgeInsets.only(top: 140),
padding: const EdgeInsets.only(top: 40),
child: ListView(
shrinkWrap: true,
children: [
Expand Down Expand Up @@ -223,78 +176,65 @@ class _ConversationCapturingPageState extends State<ConversationCapturingPage> w
],
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
floatingActionButton: provider.segments.isEmpty
? const SizedBox()
: Column(
mainAxisSize: MainAxisSize.min,
children: [
AnimatedContainer(
duration: const Duration(milliseconds: 200),
height: _controller?.index == 0 ? 0 : 30,
child: Text(
_elapsedTime > 0 ? convertToHHMMSS(_elapsedTime) : "",
style: const TextStyle(fontSize: 16, color: Colors.white),
),
),
Container(
height: 60,
width: 60,
margin: const EdgeInsets.only(bottom: 10),
decoration: const BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
),
child: InkWell(
onTap: () {
if (provider.segments.isNotEmpty) {
if (!showSummarizeConfirmation) {
context.read<CaptureProvider>().forceProcessingCurrentConversation();
Navigator.of(context).pop();
return;
}
showDialog(
context: context,
builder: (context) {
return StatefulBuilder(
builder: (context, setState) {
return ConfirmationDialog(
title: "Finished Conversation?",
description:
"Are you sure you want to stop recording and summarize the conversation now?",
checkboxValue: !showSummarizeConfirmation,
checkboxText: "Don't ask me again",
onCheckboxChanged: (value) {
if (value != null) {
setState(() {
showSummarizeConfirmation = !value;
});
}
},
onCancel: () {
Navigator.of(context).pop();
},
onConfirm: () {
SharedPreferencesUtil().showSummarizeConfirmation =
showSummarizeConfirmation;
context.read<CaptureProvider>().forceProcessingCurrentConversation();
Navigator.of(context).pop();
Navigator.of(context).pop();
},
);
floatingActionButton: Column(
mainAxisSize: MainAxisSize.min,
children: [
provider.segments.isEmpty
? const SizedBox()
: ConversationBottomBar(
mode: ConversationBottomBarMode.recording,
selectedTab: _controller!.index == 0
? ConversationTab.transcript
: ConversationTab.summary,
hasSegments: provider.segments.isNotEmpty,
onTabSelected: (tab) {
_controller!.animateTo(tab == ConversationTab.transcript ? 0 : 1);
setState(() {});
},
onStopPressed: () {
if (provider.segments.isNotEmpty) {
if (!showSummarizeConfirmation) {
context.read<CaptureProvider>().forceProcessingCurrentConversation();
Navigator.of(context).pop();
return;
}
showDialog(
context: context,
builder: (context) {
return StatefulBuilder(
builder: (context, setState) {
return ConfirmationDialog(
title: "Finished Conversation?",
description:
"Are you sure you want to stop recording and summarize the conversation now?\n\nHints: Conversation is summarized after 2 minutes of no speech.",
checkboxValue: !showSummarizeConfirmation,
checkboxText: "Don't ask me again",
onCheckboxChanged: (value) {
if (value != null) {
setState(() {
showSummarizeConfirmation = !value;
});
}
},
onCancel: () {
Navigator.of(context).pop();
},
onConfirm: () {
SharedPreferencesUtil().showSummarizeConfirmation = showSummarizeConfirmation;
context.read<CaptureProvider>().forceProcessingCurrentConversation();
Navigator.of(context).pop();
Navigator.of(context).pop();
},
);
});
}
},
child: const Icon(
Icons.stop,
color: Colors.white,
size: 34,
),
),
},
);
},
);
}
},
),
],
),
],
),
),
);
},
Expand Down
Loading