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>
80 lines
2.8 KiB
Dart
80 lines
2.8 KiB
Dart
import 'dart:math' show min;
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_markdown_plus/flutter_markdown_plus.dart';
|
|
|
|
import '../data/models/message.dart';
|
|
|
|
class ChatMessageBubble extends StatelessWidget {
|
|
final Message message;
|
|
const ChatMessageBubble({super.key, required this.message});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final isUser = message.role == MessageRole.user;
|
|
final scheme = Theme.of(context).colorScheme;
|
|
final isGenerating = message.status == 'generating';
|
|
|
|
return Align(
|
|
alignment: isUser ? Alignment.centerRight : Alignment.centerLeft,
|
|
child: Container(
|
|
constraints: BoxConstraints(
|
|
maxWidth: min(MediaQuery.of(context).size.width * 0.82, 480),
|
|
),
|
|
margin: const EdgeInsets.symmetric(vertical: 4, horizontal: 4),
|
|
decoration: isUser
|
|
? BoxDecoration(
|
|
// Ghost style: transparent bg, thin border
|
|
color: Colors.transparent,
|
|
border: Border.all(
|
|
color: scheme.primary.withValues(alpha: 0.35),
|
|
width: 1,
|
|
),
|
|
borderRadius: const BorderRadius.only(
|
|
topLeft: Radius.circular(16),
|
|
topRight: Radius.circular(16),
|
|
bottomLeft: Radius.circular(16),
|
|
bottomRight: Radius.circular(4),
|
|
),
|
|
)
|
|
: BoxDecoration(
|
|
// Assistant: elevated surface + left accent border
|
|
color: scheme.surfaceContainerHighest,
|
|
border: Border(
|
|
left: BorderSide(color: scheme.primary, width: 2),
|
|
),
|
|
borderRadius: const BorderRadius.only(
|
|
topLeft: Radius.circular(4),
|
|
topRight: Radius.circular(16),
|
|
bottomLeft: Radius.circular(4),
|
|
bottomRight: Radius.circular(16),
|
|
),
|
|
),
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
|
child: isGenerating && message.content.isEmpty
|
|
? SizedBox(
|
|
width: 20,
|
|
height: 20,
|
|
child: CircularProgressIndicator(
|
|
strokeWidth: 2,
|
|
color: scheme.onSurfaceVariant,
|
|
),
|
|
)
|
|
: MarkdownBody(
|
|
data: message.content.isEmpty ? '…' : message.content,
|
|
styleSheet: MarkdownStyleSheet(
|
|
p: TextStyle(
|
|
color: isUser
|
|
? scheme.onSurface.withValues(alpha: 0.75)
|
|
: scheme.onSurface,
|
|
fontSize: 14,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|