Skip to content

Commit 24b6553

Browse files
authored
Zqjeo upgrade (#2976)
* Update the new flutter, ndk version to setup scripts, ci, docs * Reformat app/ * Reformat code for backend, mcp, plugins
1 parent 424f5fe commit 24b6553

File tree

107 files changed

+2355
-2218
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+2355
-2218
lines changed

app/lib/backend/http/api/action_items.dart

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Future<ActionItemsResponse> getActionItems({
1414
DateTime? endDate,
1515
}) async {
1616
String url = '${Env.apiBaseUrl}v1/action-items?limit=$limit&offset=$offset';
17-
17+
1818
if (completed != null) {
1919
url += '&completed=$completed';
2020
}
@@ -27,16 +27,16 @@ Future<ActionItemsResponse> getActionItems({
2727
if (endDate != null) {
2828
url += '&end_date=${endDate.toIso8601String()}';
2929
}
30-
30+
3131
var response = await makeApiCall(
3232
url: url,
3333
headers: {},
3434
method: 'GET',
3535
body: '',
3636
);
37-
37+
3838
if (response == null) return ActionItemsResponse(actionItems: [], hasMore: false);
39-
39+
4040
if (response.statusCode == 200) {
4141
var body = utf8.decode(response.bodyBytes);
4242
return ActionItemsResponse.fromJson(jsonDecode(body));
@@ -53,9 +53,9 @@ Future<ActionItemWithMetadata?> getActionItem(String actionItemId) async {
5353
method: 'GET',
5454
body: '',
5555
);
56-
56+
5757
if (response == null) return null;
58-
58+
5959
if (response.statusCode == 200) {
6060
var body = utf8.decode(response.bodyBytes);
6161
return ActionItemWithMetadata.fromJson(jsonDecode(body));
@@ -75,23 +75,23 @@ Future<ActionItemWithMetadata?> createActionItem({
7575
'description': description,
7676
'completed': completed,
7777
};
78-
78+
7979
if (dueAt != null) {
8080
requestBody['due_at'] = dueAt.toIso8601String();
8181
}
8282
if (conversationId != null) {
8383
requestBody['conversation_id'] = conversationId;
8484
}
85-
85+
8686
var response = await makeApiCall(
8787
url: '${Env.apiBaseUrl}v1/action-items',
8888
headers: {},
8989
method: 'POST',
9090
body: jsonEncode(requestBody),
9191
);
92-
92+
9393
if (response == null) return null;
94-
94+
9595
if (response.statusCode == 200) {
9696
var body = utf8.decode(response.bodyBytes);
9797
return ActionItemWithMetadata.fromJson(jsonDecode(body));
@@ -108,7 +108,7 @@ Future<ActionItemWithMetadata?> updateActionItem(
108108
DateTime? dueAt,
109109
}) async {
110110
var requestBody = <String, dynamic>{};
111-
111+
112112
if (description != null) {
113113
requestBody['description'] = description;
114114
}
@@ -118,16 +118,16 @@ Future<ActionItemWithMetadata?> updateActionItem(
118118
if (dueAt != null) {
119119
requestBody['due_at'] = dueAt.toIso8601String();
120120
}
121-
121+
122122
var response = await makeApiCall(
123123
url: '${Env.apiBaseUrl}v1/action-items/$actionItemId',
124124
headers: {},
125125
method: 'PATCH',
126126
body: jsonEncode(requestBody),
127127
);
128-
128+
129129
if (response == null) return null;
130-
130+
131131
if (response.statusCode == 200) {
132132
var body = utf8.decode(response.bodyBytes);
133133
return ActionItemWithMetadata.fromJson(jsonDecode(body));
@@ -147,9 +147,9 @@ Future<ActionItemWithMetadata?> toggleActionItemCompletion(
147147
method: 'PATCH',
148148
body: '',
149149
);
150-
150+
151151
if (response == null) return null;
152-
152+
153153
if (response.statusCode == 200) {
154154
var body = utf8.decode(response.bodyBytes);
155155
return ActionItemWithMetadata.fromJson(jsonDecode(body));
@@ -166,9 +166,9 @@ Future<bool> deleteActionItem(String actionItemId) async {
166166
method: 'DELETE',
167167
body: '',
168168
);
169-
169+
170170
if (response == null) return false;
171-
171+
172172
return response.statusCode == 204;
173173
}
174174

@@ -180,16 +180,15 @@ Future<ActionItemsResponse> getConversationActionItems(String conversationId) as
180180
method: 'GET',
181181
body: '',
182182
);
183-
183+
184184
if (response == null) return ActionItemsResponse(actionItems: [], hasMore: false);
185-
185+
186186
if (response.statusCode == 200) {
187187
var body = utf8.decode(response.bodyBytes);
188188
var data = jsonDecode(body);
189189
return ActionItemsResponse(
190-
actionItems: (data['action_items'] as List<dynamic>)
191-
.map((item) => ActionItemWithMetadata.fromJson(item))
192-
.toList(),
190+
actionItems:
191+
(data['action_items'] as List<dynamic>).map((item) => ActionItemWithMetadata.fromJson(item)).toList(),
193192
hasMore: false, // Conversation-specific calls don't have pagination
194193
);
195194
} else {
@@ -205,9 +204,9 @@ Future<bool> deleteConversationActionItems(String conversationId) async {
205204
method: 'DELETE',
206205
body: '',
207206
);
208-
207+
209208
if (response == null) return false;
210-
209+
211210
return response.statusCode == 204;
212211
}
213212

@@ -221,15 +220,13 @@ Future<List<ActionItemWithMetadata>> createActionItemsBatch(
221220
method: 'POST',
222221
body: jsonEncode(actionItems),
223222
);
224-
223+
225224
if (response == null) return [];
226-
225+
227226
if (response.statusCode == 200) {
228227
var body = utf8.decode(response.bodyBytes);
229228
var data = jsonDecode(body);
230-
return (data['action_items'] as List<dynamic>)
231-
.map((item) => ActionItemWithMetadata.fromJson(item))
232-
.toList();
229+
return (data['action_items'] as List<dynamic>).map((item) => ActionItemWithMetadata.fromJson(item)).toList();
233230
} else {
234231
debugPrint('createActionItemsBatch error ${response.statusCode}');
235232
return [];

app/lib/backend/http/shared.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ Future<http.Response?> makeApiCall({
3838
}) async {
3939
try {
4040
if (url.contains(Env.apiBaseUrl!)) {
41-
headers['Authorization'] = await getAuthHeader();
42-
// headers['Authorization'] = ''; // set admin key + uid here for testing
41+
headers['Authorization'] = await getAuthHeader();
42+
// headers['Authorization'] = ''; // set admin key + uid here for testing
4343
}
4444

4545
final client = http.Client();
@@ -126,8 +126,8 @@ dynamic extractContentFromResponse(
126126
} else {
127127
debugPrint('Error fetching data: ${response?.statusCode}');
128128
// TODO: handle error, better specially for script migration
129-
PlatformManager.instance.crashReporter.reportCrash(
130-
Exception('Error fetching data: ${response?.statusCode}'), StackTrace.current, userAttributes: {
129+
PlatformManager.instance.crashReporter
130+
.reportCrash(Exception('Error fetching data: ${response?.statusCode}'), StackTrace.current, userAttributes: {
131131
'response_null': (response == null).toString(),
132132
'response_status_code': response?.statusCode.toString() ?? '',
133133
'is_embedding': isEmbedding.toString(),

app/lib/backend/schema/schema.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ export 'message_event.dart';
99
export 'mcp_api_key.dart';
1010
export 'person.dart';
1111
export 'structured.dart';
12-
export 'transcript_segment.dart';
12+
export 'transcript_segment.dart';

app/lib/desktop/pages/actions/desktop_actions_page.dart

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ class DesktopActionsPageState extends State<DesktopActionsPage>
9090
provider.fetchActionItems(showShimmer: true);
9191
}
9292

93-
9493
_fadeController.forward();
9594
_slideController.forward();
9695
}).withPostFrameCallback();
@@ -260,18 +259,13 @@ class DesktopActionsPageState extends State<DesktopActionsPage>
260259
}
261260
}
262261

263-
264-
265-
266-
267262
void _retryLoadingActionItems() {
268263
final provider = Provider.of<ActionItemsProvider>(context, listen: false);
269264
setState(() {
270265
_hasNetworkError = false;
271266
_errorMessage = null;
272267
});
273268
provider.fetchActionItems(showShimmer: true);
274-
275269
}
276270

277271
Widget _buildActionsContent(
@@ -709,12 +703,8 @@ class DesktopActionsPageState extends State<DesktopActionsPage>
709703
),
710704
);
711705
}
712-
713-
714706
}
715707

716-
717-
718708
extension PostFrameCallback on Function {
719709
void withPostFrameCallback() {
720710
WidgetsBinding.instance.addPostFrameCallback((_) => this());

app/lib/desktop/pages/actions/widgets/desktop_action_group.dart

Lines changed: 48 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,9 @@ class _DesktopActionGroupState extends State<DesktopActionGroup> {
109109
}
110110

111111
try {
112-
113112
final provider = Provider.of<ActionItemsProvider>(context, listen: false);
114113
await provider.updateActionItemDescription(item, newText);
115-
114+
116115
setState(() {
117116
_editingStates[itemId] = false;
118117
});
@@ -202,47 +201,45 @@ class _DesktopActionGroupState extends State<DesktopActionGroup> {
202201
),
203202
),
204203
child: Row(
205-
children: [
206-
// Conversation icon
207-
OmiIconBadge(
208-
icon: FontAwesomeIcons.message,
209-
bgColor: ResponsiveHelper.purplePrimary.withValues(alpha: 0.2),
210-
iconColor: ResponsiveHelper.purplePrimary,
211-
radius: 8,
212-
),
204+
children: [
205+
// Conversation icon
206+
OmiIconBadge(
207+
icon: FontAwesomeIcons.message,
208+
bgColor: ResponsiveHelper.purplePrimary.withValues(alpha: 0.2),
209+
iconColor: ResponsiveHelper.purplePrimary,
210+
radius: 8,
211+
),
213212

214-
const SizedBox(width: 12),
215-
216-
// Conversation details
217-
Expanded(
218-
child: Column(
219-
crossAxisAlignment: CrossAxisAlignment.start,
220-
children: [
221-
Text(
222-
widget.conversationTitle.isNotEmpty
223-
? widget.conversationTitle
224-
: 'Untitled Conversation',
225-
style: const TextStyle(
226-
color: ResponsiveHelper.textPrimary,
227-
fontSize: 16,
228-
fontWeight: FontWeight.w600,
229-
),
230-
maxLines: 1,
231-
overflow: TextOverflow.ellipsis,
232-
),
233-
const SizedBox(height: 2),
234-
Text(
235-
'$incompleteCount remaining',
236-
style: const TextStyle(
237-
color: ResponsiveHelper.textSecondary,
238-
fontSize: 12,
239-
),
240-
),
241-
],
213+
const SizedBox(width: 12),
214+
215+
// Conversation details
216+
Expanded(
217+
child: Column(
218+
crossAxisAlignment: CrossAxisAlignment.start,
219+
children: [
220+
Text(
221+
widget.conversationTitle.isNotEmpty ? widget.conversationTitle : 'Untitled Conversation',
222+
style: const TextStyle(
223+
color: ResponsiveHelper.textPrimary,
224+
fontSize: 16,
225+
fontWeight: FontWeight.w600,
226+
),
227+
maxLines: 1,
228+
overflow: TextOverflow.ellipsis,
242229
),
243-
),
244-
],
230+
const SizedBox(height: 2),
231+
Text(
232+
'$incompleteCount remaining',
233+
style: const TextStyle(
234+
color: ResponsiveHelper.textSecondary,
235+
fontSize: 12,
236+
),
237+
),
238+
],
239+
),
245240
),
241+
],
242+
),
246243
),
247244

248245
// Divider
@@ -305,17 +302,17 @@ class _DesktopActionGroupState extends State<DesktopActionGroup> {
305302
Expanded(
306303
child: isEditing
307304
? TextField(
308-
controller: _textControllers[item.id],
309-
focusNode: _focusNodes[item.id],
310-
style: const TextStyle(
311-
color: ResponsiveHelper.textPrimary, fontSize: 14, height: 1.3, fontWeight: FontWeight.w500),
312-
decoration: const InputDecoration(
313-
border: InputBorder.none, contentPadding: EdgeInsets.zero, isDense: true),
314-
maxLines: null,
315-
textInputAction: TextInputAction.done,
316-
onSubmitted: (_) => _saveChanges(item.id),
317-
onChanged: (_) => setState(() {}),
318-
)
305+
controller: _textControllers[item.id],
306+
focusNode: _focusNodes[item.id],
307+
style: const TextStyle(
308+
color: ResponsiveHelper.textPrimary, fontSize: 14, height: 1.3, fontWeight: FontWeight.w500),
309+
decoration:
310+
const InputDecoration(border: InputBorder.none, contentPadding: EdgeInsets.zero, isDense: true),
311+
maxLines: null,
312+
textInputAction: TextInputAction.done,
313+
onSubmitted: (_) => _saveChanges(item.id),
314+
onChanged: (_) => setState(() {}),
315+
)
319316
: GestureDetector(
320317
onTap: () => _startEditing(item.id),
321318
child: Text(
@@ -368,6 +365,4 @@ class _DesktopActionGroupState extends State<DesktopActionGroup> {
368365
final newValue = !item.completed;
369366
context.read<ActionItemsProvider>().updateActionItemState(item, newValue);
370367
}
371-
372-
373368
}

app/lib/desktop/pages/onboarding/desktop_onboarding_wrapper.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ class _DesktopOnboardingWrapperState extends State<DesktopOnboardingWrapper> wit
140140
SharedPreferencesUtil().hasOmiDevice = true;
141141
SharedPreferencesUtil().verifiedPersonaId = null;
142142
MixpanelManager().onboardingStepCompleted('Auth');
143-
if(context.mounted) {
144-
context.read<HomeProvider>().setupHasSpeakerProfile();
143+
if (context.mounted) {
144+
context.read<HomeProvider>().setupHasSpeakerProfile();
145145
}
146146
IntercomManager.instance.loginIdentifiedUser(SharedPreferencesUtil().uid);
147147
IntercomManager.instance.updateUser(

0 commit comments

Comments
 (0)