Update project structure and enhance functionality with new features and dependencies
This commit is contained in:
@@ -111,7 +111,7 @@ class ToolBubbleBase extends StatelessWidget {
|
||||
child: Button.outline(
|
||||
leading: Icon(LucideIcons.check).iconSmall,
|
||||
onPressed: () => context.read<ChatProvider>().resolvePermission(PermissionDecision.allowOnce),
|
||||
child: Text("Allow").small,
|
||||
child: Text("Yes").small,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -121,7 +121,7 @@ class ToolBubbleBase extends StatelessWidget {
|
||||
child: Button.outline(
|
||||
leading: Icon(LucideIcons.checkCheck).iconSmall,
|
||||
onPressed: () => context.read<ChatProvider>().resolvePermission(PermissionDecision.allowAlways),
|
||||
child: Text("Allow always").small,
|
||||
child: Text("Yes, for this session").small,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -131,7 +131,7 @@ class ToolBubbleBase extends StatelessWidget {
|
||||
child: Button.destructive(
|
||||
leading: Icon(LucideIcons.x).iconSmall,
|
||||
onPressed: () => context.read<ChatProvider>().resolvePermission(PermissionDecision.reject),
|
||||
child: Text("Reject").small,
|
||||
child: Text("No").small,
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
@@ -1,18 +1,60 @@
|
||||
import "dart:typed_data";
|
||||
import "package:shadcn_flutter/shadcn_flutter.dart";
|
||||
import "../../../models/attachment.dart";
|
||||
import "../attachment_preview.dart";
|
||||
import "../../../../src/session/session_types.dart";
|
||||
|
||||
class UserBubble extends StatelessWidget {
|
||||
const UserBubble({super.key, required this.content});
|
||||
const UserBubble({
|
||||
super.key,
|
||||
required this.content,
|
||||
this.attachments,
|
||||
});
|
||||
|
||||
final String content;
|
||||
final List<MessageAttachment>? attachments;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final atts = attachments;
|
||||
|
||||
return Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: OutlinedContainer(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
backgroundColor: Theme.of(context).colorScheme.border,
|
||||
child: SelectableText(content),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
|
||||
if (atts != null && atts.isNotEmpty) ...[
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
reverse: true,
|
||||
child: Row(
|
||||
children: [
|
||||
for (final att in atts)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
child: AttachmentItem(
|
||||
attachment: Attachment(
|
||||
name: att.name,
|
||||
mimeType: att.mimeType,
|
||||
data: Uint8List.fromList(att.data),
|
||||
),
|
||||
onRemove: () {},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Gap(6),
|
||||
],
|
||||
|
||||
OutlinedContainer(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
backgroundColor: Theme.of(context).colorScheme.border,
|
||||
child: SelectableText(content),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user