From ff35d2c5379d5a4217effaa41ad8553975f64dbe Mon Sep 17 00:00:00 2001 From: Rushil Umaretiya Date: Sat, 4 Nov 2023 01:07:01 -0400 Subject: [PATCH] finished taskgen --- app/page.tsx | 53 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index 00a7ed6..ccf60a4 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -96,10 +96,14 @@ export default function Home() { const [stackInput, setStackInput] = useState(""); const [features, setFeatures] = useState([]); + const [tasks, setTasks] = useState([]); const { setValue } = form; async function onSubmit(values: z.infer) { + setFeatures([]); + setTasks([]); + try { const feature_gen_prompt = `You are an AI software project manager. You use agile methodology and the best software project management techniques to plan software projects for indie developers. @@ -190,13 +194,15 @@ Instructions: For each feature, we need to figure out what other features need t dependencies: z .array( z.object({ - uid: z.enum(featureUids), + uid: z.enum(featureUids).describe("The UID of this feature"), dependencies: z .array( z.object({ uid: z .enum(featureUids) - .describe("The UID of the feature"), + .describe( + "The UID of the feature this feature depends on" + ), }) ) .describe("The UID of the dependencies of the feature"), @@ -259,7 +265,7 @@ Instructions: For each feature, we need to figure out what other features need t .filter((dep) => dep.uid === feature.uid) .map((dep) => _features.find((f) => f.uid === dep.depUid)); - generateTask( + return generateTask( p_name, p_desc, p_stack, @@ -268,9 +274,8 @@ Instructions: For each feature, we need to figure out what other features need t feature ); }); - - const tasks = await Promise.all(featurePromises); - console.log("all tasks", tasks); + const tasks: Task[][] = await Promise.all(featurePromises); + setTasks(tasks.flat()); } async function generateTask( @@ -413,6 +418,8 @@ Dependency-Based Order (numeric) This is your project tech stack. + +
{form.getValues("stack").map((stack) => ( ))} - +
)} /> +

@@ -459,7 +469,7 @@ Dependency-Based Order (numeric) {features!.map((feature) => { return ( - + - {} + + {features.map((_feature) => { + return ( + <> +
+ task.feature === _feature.uid + )} + /> +
+
+ + ); + })} +
); @@ -523,6 +549,15 @@ const TaskTable = (props: any) => { ); }; +const setDogs = (form: any) => { + form.setValue("name", "Uber Dogs"); + form.setValue( + "description", + "Uber Dogs is a mobile app that allows users to order dogs on demand." + ); + form.setValue("stack", ["Django", "google-maps-api", "GraphQL"]); +}; + /* Electronic Medical Record System