@@ -14,7 +14,6 @@ import {
1414 IconButton ,
1515 Switch ,
1616 Text ,
17- TextArea ,
1817} from "@radix-ui/themes" ;
1918import { useCallback , useEffect , useState } from "react" ;
2019import { 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" >
0 commit comments