diff --git a/apps/rowboat/app/globals.css b/apps/rowboat/app/globals.css index 8befa83b..25bf132f 100644 --- a/apps/rowboat/app/globals.css +++ b/apps/rowboat/app/globals.css @@ -1,3 +1,4 @@ +@import './styles/quill-mentions.css'; @tailwind base; @tailwind components; @tailwind utilities; @@ -76,7 +77,6 @@ html, body { @apply bg-background text-foreground; } - /* Add these new utility classes */ .card-shadow { @apply shadow-sm dark:shadow-none dark:border-border; } @@ -90,105 +90,11 @@ html, body { } } -/* Add this to disable color transitions */ * { -webkit-transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, opacity 0.2s ease-in-out !important; transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, opacity 0.2s ease-in-out !important; } -/* Ensure smooth transitions */ * { @apply transition-colors duration-200; -} - -/* Add these styles alongside your other global styles */ -.ql-mention-list-container { - border: 1px solid #e2e8f0; - border-radius: 0.375rem; - box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); - background-color: white; - z-index: 1000; -} - -/* Base dark mode styles */ -.dark .ql-mention-list-container { - background-color: #1f2937; - border-color: #374151; -} - -.dark .ql-mention-list-container * { - background-color: #1f2937 !important; - color: #f9fafb !important; -} - -/* Target individual items */ -.dark .ql-mention-list-item { - color: #f9fafb !important; - background-color: #1f2937 !important; -} - -/* Target hover and selected states for individual items */ -.dark .ql-mention-list-container .ql-mention-list-item.selected, -.dark .ql-mention-list-container .ql-mention-list-item:hover { - background-color: #6b7280 !important; -} - -/* Ensure the background color only applies to the item itself */ -.dark .ql-mention-list-item > * { - background-color: inherit !important; -} - -/* Additional catch-all for any other possible class combinations */ -.dark [class*="mention"].selected, -.dark [class*="mention"]:hover { - background-color: #6b7280 !important; -} - -.ql-mention-list { - padding: 0.5rem 0; -} - -/* Styles for mentions in the editor */ -.ql-editor .mention { - background-color: #e0f2fe; /* light blue bg */ - color: #1e40af; /* darker blue text */ - padding: 0.125rem 0.375rem; - border-radius: 0.25rem; - white-space: nowrap; - display: inline-block; -} - -/* Style for the @ symbol */ -.ql-editor .mention .ql-mention-denotation-char { - color: #1e40af; /* blue color for @ symbol */ - font-weight: normal; -} - -.ql-editor .mention .invalid { - color: red; -} - -/* Add custom scrollbar styling */ -.dark *::-webkit-scrollbar { - width: 8px; - height: 8px; -} - -.dark *::-webkit-scrollbar-track { - background: #1f2937; /* dark gray background */ -} - -.dark *::-webkit-scrollbar-thumb { - background: #4b5563; /* medium gray thumb */ - border-radius: 4px; -} - -.dark *::-webkit-scrollbar-thumb:hover { - background: #6b7280; /* lighter gray on hover */ -} - -/* For Firefox */ -.dark * { - scrollbar-width: thin; - scrollbar-color: #4b5563 #1f2937; } \ No newline at end of file diff --git a/apps/rowboat/app/lib/components/atmentions.ts b/apps/rowboat/app/lib/components/atmentions.ts new file mode 100644 index 00000000..8a17a39d --- /dev/null +++ b/apps/rowboat/app/lib/components/atmentions.ts @@ -0,0 +1,57 @@ +interface AtMentionItem { + id: string; + value: string; + [key: string]: string; // Add index signature to allow any string key +} + +interface CreateAtMentionsProps { + agents: any[]; + prompts: any[]; + tools: any[]; + currentAgentName?: string; +} + +export function createAtMentions({ agents, prompts, tools, currentAgentName }: CreateAtMentionsProps): AtMentionItem[] { + const atMentions: AtMentionItem[] = []; + + // Add agents + for (const a of agents) { + if (a.disabled || a.name === currentAgentName) { + continue; + } + const id = `agent:${a.name}`; + atMentions.push({ + id, + value: id, + denotationChar: "@", // Add required properties for Match type + link: id, + target: "_self" + }); + } + + // Add prompts + for (const prompt of prompts) { + const id = `prompt:${prompt.name}`; + atMentions.push({ + id, + value: id, + denotationChar: "@", + link: id, + target: "_self" + }); + } + + // Add tools + for (const tool of tools) { + const id = `tool:${tool.name}`; + atMentions.push({ + id, + value: id, + denotationChar: "@", + link: id, + target: "_self" + }); + } + + return atMentions; +} \ No newline at end of file diff --git a/apps/rowboat/app/projects/[projectId]/config/app.tsx b/apps/rowboat/app/projects/[projectId]/config/app.tsx index 5da1ca89..214e0dce 100644 --- a/apps/rowboat/app/projects/[projectId]/config/app.tsx +++ b/apps/rowboat/app/projects/[projectId]/config/app.tsx @@ -24,8 +24,8 @@ export function Section({ title: string; children: React.ReactNode; }) { - return