Skip to content

Commit 95937eb

Browse files
committed
Remove title field from task creation
1 parent c84c632 commit 95937eb

File tree

3 files changed

+9
-39
lines changed

3 files changed

+9
-39
lines changed

src/api/posthogClient.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,12 @@ export class PostHogAPIClient {
6161
}
6262

6363
async createTask(
64-
title: string,
6564
description: string,
6665
repositoryConfig?: { organization: string; repository: string },
6766
) {
6867
const teamId = await this.getTeamId();
6968

7069
const payload = {
71-
title,
7270
description,
7371
origin_product: "user_created" as const,
7472
...(repositoryConfig && { repository_config: repositoryConfig }),
@@ -105,7 +103,6 @@ export class PostHogAPIClient {
105103
async duplicateTask(taskId: string) {
106104
const task = await this.getTask(taskId);
107105
return this.createTask(
108-
`${task.title} (copy)`,
109106
task.description,
110107
task.repository_config as RepositoryConfig | undefined,
111108
);

src/renderer/components/TaskCreate.tsx

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
IconButton,
1515
Switch,
1616
Text,
17-
TextArea,
1817
} from "@radix-ui/themes";
1918
import { useCallback, useEffect, useState } from "react";
2019
import { Controller, useForm } from "react-hook-form";
@@ -51,7 +50,6 @@ export function TaskCreate({ open, onOpenChange }: TaskCreateProps) {
5150
const [repoWarning, setRepoWarning] = useState<string | null>(null);
5251

5352
const {
54-
register,
5553
handleSubmit,
5654
reset,
5755
control,
@@ -60,7 +58,6 @@ export function TaskCreate({ open, onOpenChange }: TaskCreateProps) {
6058
formState: { errors, isSubmitted },
6159
} = useForm({
6260
defaultValues: {
63-
title: "",
6461
description: "",
6562
repository: "",
6663
folderPath: "",
@@ -107,7 +104,6 @@ export function TaskCreate({ open, onOpenChange }: TaskCreateProps) {
107104
}, [folderPath, detectRepoFromFolder]);
108105

109106
const onSubmit = (data: {
110-
title: string;
111107
description: string;
112108
repository: string;
113109
folderPath: string;
@@ -116,7 +112,7 @@ export function TaskCreate({ open, onOpenChange }: TaskCreateProps) {
116112
return;
117113
}
118114

119-
if (!data.title.trim() || !data.description.trim()) {
115+
if (!data.description.trim()) {
120116
return;
121117
}
122118

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

127123
createTask(
128124
{
129-
title: data.title,
130125
description: data.description,
131126
repositoryConfig,
132127
},
@@ -213,23 +208,6 @@ export function TaskCreate({ open, onOpenChange }: TaskCreateProps) {
213208
style={{ display: "contents" }}
214209
>
215210
<Flex direction="column" gap="4" mt="4" flexGrow="1">
216-
<Flex direction="column" gap="2">
217-
<TextArea
218-
{...register("title", {
219-
required: true,
220-
validate: (v) => v.trim().length > 0,
221-
})}
222-
placeholder="Task title..."
223-
size="3"
224-
autoFocus
225-
rows={1}
226-
style={{
227-
resize: "none",
228-
overflow: "hidden",
229-
minHeight: "auto",
230-
}}
231-
/>
232-
</Flex>
233211
<Flex
234212
direction="column"
235213
gap="2"
@@ -329,16 +307,14 @@ export function TaskCreate({ open, onOpenChange }: TaskCreateProps) {
329307
</Callout.Root>
330308
)}
331309

332-
{isSubmitted &&
333-
(errors.title || errors.description || errors.folderPath) && (
334-
<Callout.Root color="red" size="1">
335-
<Callout.Text>
336-
{errors.title && "Title is required. "}
337-
{errors.description && "Description is required. "}
338-
{errors.folderPath && "Working directory is required."}
339-
</Callout.Text>
340-
</Callout.Root>
341-
)}
310+
{isSubmitted && (errors.description || errors.folderPath) && (
311+
<Callout.Root color="red" size="1">
312+
<Callout.Text>
313+
{errors.description && "Description is required. "}
314+
{errors.folderPath && "Working directory is required."}
315+
</Callout.Text>
316+
</Callout.Root>
317+
)}
342318

343319
{error && (
344320
<Callout.Root color="red" size="1">

src/renderer/hooks/useTasks.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,14 @@ export function useCreateTask() {
4949

5050
return useMutation({
5151
mutationFn: async ({
52-
title,
5352
description,
5453
repositoryConfig,
5554
}: {
56-
title: string;
5755
description: string;
5856
repositoryConfig?: { organization: string; repository: string };
5957
}) => {
6058
if (!client) throw new Error("Not authenticated");
6159
const task = (await client.createTask(
62-
title,
6360
description,
6461
repositoryConfig,
6562
)) as unknown as Task;

0 commit comments

Comments
 (0)