From 9a980f2f9fcc713f4da8d5b556d8a155bd45ed34 Mon Sep 17 00:00:00 2001 From: arkml Date: Mon, 11 Aug 2025 23:46:30 +0530 Subject: [PATCH] Project modals (#190) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * added the project create and select modals * Added logo and link to home page * minor changes to side bar * added import json and blank template options * added website like home page * change homepage to be more like website * fixed landing page text box * minor size changes to the home page * added prebuilt agents section * Minor changes to the prebuilt agent card * removed the project selection and new project options from side bar * fixed prebuilt agents * fixed import json * my assistants has pagination * add dark mode support to home page * addressed review comments * increase build agents textbox lines * fixed PR comments * move prebuilt assistant under build view * minor changes to home page * minor changes to home page * removed my assistants from side bar * removed sidebar items * fixed review comments * fixed review comments * Add "use client" directive to project-creation-utils.ts This file uses localStorage and calls server actions directly, requiring client-side execution. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * fix import of pipeline agents --------- Co-authored-by: Claude --- apps/rowboat/app/actions/project_actions.ts | 14 +- .../app/components/ui/textarea-with-send.tsx | 78 +++ apps/rowboat/app/projects/app.tsx | 46 +- .../components/build-assistant-section.tsx | 467 ++++++++++++++++++ .../projects/components/create-project.tsx | 119 +++-- .../projects/components/templates-section.tsx | 145 ++++++ .../projects/layout/components/sidebar.tsx | 266 +++++++--- .../projects/lib/project-creation-utils.ts | 121 +++++ 8 files changed, 1092 insertions(+), 164 deletions(-) create mode 100644 apps/rowboat/app/components/ui/textarea-with-send.tsx create mode 100644 apps/rowboat/app/projects/components/build-assistant-section.tsx create mode 100644 apps/rowboat/app/projects/components/templates-section.tsx create mode 100644 apps/rowboat/app/projects/lib/project-creation-utils.ts diff --git a/apps/rowboat/app/actions/project_actions.ts b/apps/rowboat/app/actions/project_actions.ts index 2cb425e4..3f54db97 100644 --- a/apps/rowboat/app/actions/project_actions.ts +++ b/apps/rowboat/app/actions/project_actions.ts @@ -20,6 +20,17 @@ const KLAVIS_API_KEY = process.env.KLAVIS_API_KEY || ''; const projectActionAuthorizationPolicy = container.resolve('projectActionAuthorizationPolicy'); +export async function listTemplates() { + const templatesArray = Object.entries(templates) + .filter(([key]) => key !== 'default') // Exclude the default template + .map(([key, template]) => ({ + id: key, + ...template + })); + + return templatesArray; +} + export async function projectAuthCheck(projectId: string) { if (!USE_AUTH) { return; @@ -115,11 +126,12 @@ export async function createProjectFromWorkflowJson(formData: FormData): Promise const name = formData.get('name') as string | null; const workflowJson = formData.get('workflowJson') as string; - const { agents, prompts, tools, startAgent } = Workflow.parse(workflowJson); + const { agents, prompts, tools, pipelines, startAgent } = Workflow.parse(JSON.parse(workflowJson)); const response = await createBaseProject(name || 'Imported project', user, { agents, prompts, tools, + pipelines, startAgent, lastUpdatedAt: (new Date()).toISOString(), }); diff --git a/apps/rowboat/app/components/ui/textarea-with-send.tsx b/apps/rowboat/app/components/ui/textarea-with-send.tsx new file mode 100644 index 00000000..96531554 --- /dev/null +++ b/apps/rowboat/app/components/ui/textarea-with-send.tsx @@ -0,0 +1,78 @@ +'use client'; + +import { forwardRef, TextareaHTMLAttributes } from 'react'; +import { Textarea } from '@/components/ui/textarea'; +import { Send } from 'lucide-react'; +import clsx from 'clsx'; + +interface TextareaWithSendProps extends Omit, 'onChange'> { + value: string; + onChange: (value: string) => void; + onSubmit: () => void; + isSubmitting?: boolean; + submitDisabled?: boolean; + placeholder?: string; + className?: string; + rows?: number; + autoFocus?: boolean; + autoResize?: boolean; +} + +export const TextareaWithSend = forwardRef( + ({ + value, + onChange, + onSubmit, + isSubmitting = false, + submitDisabled = false, + placeholder, + className, + rows = 3, + autoFocus = false, + autoResize = false, + ...props + }, ref) => { + return ( +
+