Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ AGENTS.md

pnpm-workspace.yaml

.Assets.car
**.car
3 changes: 0 additions & 3 deletions src/api/posthogClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,12 @@ export class PostHogAPIClient {
}

async createTask(
title: string,
description: string,
repositoryConfig?: { organization: string; repository: string },
) {
const teamId = await this.getTeamId();

const payload = {
title,
description,
origin_product: "user_created" as const,
...(repositoryConfig && { repository_config: repositoryConfig }),
Expand Down Expand Up @@ -105,7 +103,6 @@ export class PostHogAPIClient {
async duplicateTask(taskId: string) {
const task = await this.getTask(taskId);
return this.createTask(
`${task.title} (copy)`,
task.description,
task.repository_config as RepositoryConfig | undefined,
);
Expand Down
42 changes: 9 additions & 33 deletions src/renderer/components/TaskCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
IconButton,
Switch,
Text,
TextArea,
} from "@radix-ui/themes";
import { useCallback, useEffect, useState } from "react";
import { Controller, useForm } from "react-hook-form";
Expand Down Expand Up @@ -51,7 +50,6 @@ export function TaskCreate({ open, onOpenChange }: TaskCreateProps) {
const [repoWarning, setRepoWarning] = useState<string | null>(null);

const {
register,
handleSubmit,
reset,
control,
Expand All @@ -60,7 +58,6 @@ export function TaskCreate({ open, onOpenChange }: TaskCreateProps) {
formState: { errors, isSubmitted },
} = useForm({
defaultValues: {
title: "",
description: "",
repository: "",
folderPath: "",
Expand Down Expand Up @@ -107,7 +104,6 @@ export function TaskCreate({ open, onOpenChange }: TaskCreateProps) {
}, [folderPath, detectRepoFromFolder]);

const onSubmit = (data: {
title: string;
description: string;
repository: string;
folderPath: string;
Expand All @@ -116,7 +112,7 @@ export function TaskCreate({ open, onOpenChange }: TaskCreateProps) {
return;
}

if (!data.title.trim() || !data.description.trim()) {
if (!data.description.trim()) {
return;
}

Expand All @@ -126,7 +122,6 @@ export function TaskCreate({ open, onOpenChange }: TaskCreateProps) {

createTask(
{
title: data.title,
description: data.description,
repositoryConfig,
},
Expand Down Expand Up @@ -213,23 +208,6 @@ export function TaskCreate({ open, onOpenChange }: TaskCreateProps) {
style={{ display: "contents" }}
>
<Flex direction="column" gap="4" mt="4" flexGrow="1">
<Flex direction="column" gap="2">
<TextArea
{...register("title", {
required: true,
validate: (v) => v.trim().length > 0,
})}
placeholder="Task title..."
size="3"
autoFocus
rows={1}
style={{
resize: "none",
overflow: "hidden",
minHeight: "auto",
}}
/>
</Flex>
<Flex
direction="column"
gap="2"
Expand Down Expand Up @@ -329,16 +307,14 @@ export function TaskCreate({ open, onOpenChange }: TaskCreateProps) {
</Callout.Root>
)}

{isSubmitted &&
(errors.title || errors.description || errors.folderPath) && (
<Callout.Root color="red" size="1">
<Callout.Text>
{errors.title && "Title is required. "}
{errors.description && "Description is required. "}
{errors.folderPath && "Working directory is required."}
</Callout.Text>
</Callout.Root>
)}
{isSubmitted && (errors.description || errors.folderPath) && (
<Callout.Root color="red" size="1">
<Callout.Text>
{errors.description && "Description is required. "}
{errors.folderPath && "Working directory is required."}
</Callout.Text>
</Callout.Root>
)}

{error && (
<Callout.Root color="red" size="1">
Expand Down
3 changes: 0 additions & 3 deletions src/renderer/hooks/useTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,14 @@ export function useCreateTask() {

return useMutation({
mutationFn: async ({
title,
description,
repositoryConfig,
}: {
title: string;
description: string;
repositoryConfig?: { organization: string; repository: string };
}) => {
if (!client) throw new Error("Not authenticated");
const task = (await client.createTask(
title,
description,
repositoryConfig,
)) as unknown as Task;
Expand Down
14 changes: 10 additions & 4 deletions vite.main.config.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { copyFileSync, mkdirSync } from "node:fs";
import { join } from "node:path";
import { defineConfig, type Plugin } from "vite";
import { copyFileSync, mkdirSync } from "fs";
import { join } from "path";

/**
* Custom Vite plugin to fix circular __filename references in bundled ESM packages.
Expand Down Expand Up @@ -38,8 +38,14 @@ function copyAgentTemplates(): Plugin {
return {
name: "copy-agent-templates",
writeBundle() {
const templateSrc = join(__dirname, "node_modules/@posthog/agent/dist/templates/plan-template.md");
const templateDest = join(__dirname, ".vite/build/templates/plan-template.md");
const templateSrc = join(
__dirname,
"node_modules/@posthog/agent/dist/templates/plan-template.md",
);
const templateDest = join(
__dirname,
".vite/build/templates/plan-template.md",
);

mkdirSync(join(__dirname, ".vite/build/templates"), { recursive: true });
copyFileSync(templateSrc, templateDest);
Expand Down