6232c7c99a
Plans 1-3 implemented: Plan 1 — Foundation - Add google_fonts ^6.2.1 - lib/core/theme.dart: slate-indigo ColorScheme (dark/light), Fraunces headings, GradientButton widget - lib/providers/capture_work_queue_provider.dart: in-memory sequential work queue; CaptureWorkQueueNotifier drains one item at a time; captureResultProvider feeds snackbars to UI - lib/app.dart: wire fabledDarkTheme/fabledLightTheme; replace blocking _QuickCaptureBar with queue-based implementation (progress bar, badge) Plan 2 — Navigation - 3-tab shell: Briefing · Library · Chat (was Notes · Tasks · Projects · Chat) - lib/screens/library/library_screen.dart: unified notes+tasks+projects list with filter pills, status sub-filter for tasks, live search, FAB - lib/widgets/library_item_card.dart: NoteLibraryCard, TaskLibraryCard (status cycle), ProjectLibraryCard - lib/screens/chat/conversations_tab_screen.dart: focused replacement for ConversationsListScreen - Delete 5 dead screens: notes_list, tasks_list, project_list, conversations_list, quick_capture Plan 3 — Briefing - lib/data/models/briefing_conversation.dart - lib/data/api/briefing_api.dart: getToday, getHistory, getMessages, triggerSlot - lib/providers/briefing_provider.dart: BriefingNotifier with sendReply (optimistic + SSE + poll, same pattern as MessagesNotifier) and refresh - lib/widgets/chat_message_bubble.dart: extracted + redesigned shared bubble (ghost user bubbles, left-accent assistant bubbles) - lib/widgets/briefing_digest_card.dart: expandable first-message card - lib/screens/briefing/briefing_screen.dart: digest card, conversation list, streaming reply bar, refresh button, history overflow menu - lib/screens/briefing/briefing_history_screen.dart: read-only past dates Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
63 lines
2.0 KiB
Dart
63 lines
2.0 KiB
Dart
import 'package:dio/dio.dart';
|
|
|
|
import '../models/briefing_conversation.dart';
|
|
import '../models/message.dart';
|
|
import 'api_client.dart';
|
|
|
|
class BriefingApi {
|
|
final Dio _dio;
|
|
const BriefingApi(this._dio);
|
|
|
|
/// GET /api/briefing/conversations/today
|
|
/// Returns (or creates) today's briefing conversation with messages embedded.
|
|
Future<BriefingConversation> getToday() async {
|
|
try {
|
|
final response = await _dio.get('/api/briefing/conversations/today');
|
|
return BriefingConversation.fromJson(
|
|
response.data as Map<String, dynamic>);
|
|
} on DioException catch (e) {
|
|
throw dioToApp(e);
|
|
}
|
|
}
|
|
|
|
/// GET /api/briefing/conversations
|
|
/// Returns list of past briefing conversations (no messages embedded).
|
|
Future<List<BriefingConversation>> getHistory() async {
|
|
try {
|
|
final response = await _dio.get('/api/briefing/conversations');
|
|
final data = response.data as Map<String, dynamic>;
|
|
final list = data['conversations'] as List<dynamic>;
|
|
return list
|
|
.map((e) => BriefingConversation.fromJson(e as Map<String, dynamic>))
|
|
.toList();
|
|
} on DioException catch (e) {
|
|
throw dioToApp(e);
|
|
}
|
|
}
|
|
|
|
/// GET /api/briefing/conversations/<id>/messages
|
|
Future<List<Message>> getMessages(int convId) async {
|
|
try {
|
|
final response =
|
|
await _dio.get('/api/briefing/conversations/$convId/messages');
|
|
final data = response.data as Map<String, dynamic>;
|
|
final list = data['messages'] as List<dynamic>;
|
|
return list
|
|
.map((e) => Message.fromJson(e as Map<String, dynamic>))
|
|
.toList();
|
|
} on DioException catch (e) {
|
|
throw dioToApp(e);
|
|
}
|
|
}
|
|
|
|
/// POST /api/briefing/trigger body: {"slot": slot}
|
|
/// slot: "compilation" | "morning" | "midday" | "afternoon"
|
|
Future<void> triggerSlot(String slot) async {
|
|
try {
|
|
await _dio.post('/api/briefing/trigger', data: {'slot': slot});
|
|
} on DioException catch (e) {
|
|
throw dioToApp(e);
|
|
}
|
|
}
|
|
}
|