@@ -238,6 +238,19 @@ function StandardTaskForm({
238238
239239 const currentMetadataJson = useRef < string > ( defaultMetadataJson ) ;
240240
241+ const [ ttlValue , setTtlValue ] = useState < number | undefined > ( selectedCodeSample ?. ttlSeconds ) ;
242+ const [ concurrencyKeyValue , setConcurrencyKeyValue ] = useState < string | undefined > (
243+ selectedCodeSample ?. concurrencyKey
244+ ) ;
245+ const [ queueValue , setQueueValue ] = useState < string | undefined > ( selectedCodeSample ?. queue ) ;
246+ const [ maxAttemptsValue , setMaxAttemptsValue ] = useState < number | undefined > (
247+ selectedCodeSample ?. maxAttempts
248+ ) ;
249+ const [ maxDurationValue , setMaxDurationValue ] = useState < number | undefined > (
250+ selectedCodeSample ?. maxDurationInSeconds
251+ ) ;
252+ const [ tagsValue , setTagsValue ] = useState < string [ ] > ( selectedCodeSample ?. runTags ?? [ ] ) ;
253+
241254 const queueFetcher = useFetcher < typeof queuesLoader > ( ) ;
242255
243256 useEffect ( ( ) => {
@@ -402,7 +415,12 @@ function StandardTaskForm({
402415 </ InputGroup >
403416 < InputGroup >
404417 < Label > TTL</ Label >
405- < DurationPicker name = { ttlSeconds . name } id = { ttlSeconds . id } />
418+ < DurationPicker
419+ name = { ttlSeconds . name }
420+ id = { ttlSeconds . id }
421+ value = { ttlValue }
422+ onChange = { setTtlValue }
423+ />
406424 < FormError id = { ttlSeconds . errorId } > { ttlSeconds . error } </ FormError >
407425 </ InputGroup >
408426 < InputGroup >
@@ -430,7 +448,8 @@ function StandardTaskForm({
430448 dropdownIcon
431449 items = { queues }
432450 filter = { { keys : [ "label" ] } }
433- defaultValue = { undefined }
451+ value = { queueValue }
452+ setValue = { setQueueValue }
434453 >
435454 { ( matches ) =>
436455 matches . map ( ( queueItem ) => (
@@ -461,7 +480,12 @@ function StandardTaskForm({
461480 </ InputGroup >
462481 < InputGroup >
463482 < Label htmlFor = { concurrencyKey . id } > Concurrency key</ Label >
464- < Input { ...conform . input ( concurrencyKey , { type : "text" } ) } variant = "small" />
483+ < Input
484+ { ...conform . input ( concurrencyKey , { type : "text" } ) }
485+ variant = "small"
486+ value = { concurrencyKeyValue ?? "" }
487+ onChange = { ( e ) => setConcurrencyKeyValue ( e . target . value ) }
488+ />
465489 < FormError id = { concurrencyKey . errorId } > { concurrencyKey . error } </ FormError >
466490 </ InputGroup >
467491 < InputGroup >
@@ -471,6 +495,10 @@ function StandardTaskForm({
471495 className = "[&::-webkit-inner-spin-button]:appearance-none"
472496 variant = "small"
473497 min = { 1 }
498+ value = { maxAttemptsValue }
499+ onChange = { ( e ) =>
500+ setMaxAttemptsValue ( e . target . value ? parseInt ( e . target . value ) : undefined )
501+ }
474502 onKeyDown = { ( e ) => {
475503 // only allow entering integers > 1
476504 if ( [ "-" , "+" , "." , "e" , "E" ] . includes ( e . key ) ) {
@@ -488,12 +516,23 @@ function StandardTaskForm({
488516 </ InputGroup >
489517 < InputGroup >
490518 < Label > Max duration</ Label >
491- < DurationPicker name = { maxDurationSeconds . name } id = { maxDurationSeconds . id } />
519+ < DurationPicker
520+ name = { maxDurationSeconds . name }
521+ id = { maxDurationSeconds . id }
522+ value = { maxDurationValue }
523+ onChange = { setMaxDurationValue }
524+ />
492525 < FormError id = { maxDurationSeconds . errorId } > { maxDurationSeconds . error } </ FormError >
493526 </ InputGroup >
494527 < InputGroup >
495528 < Label htmlFor = { tags . id } > Tags</ Label >
496- < RunTagInput name = { tags . name } id = { tags . id } variant = "small" />
529+ < RunTagInput
530+ name = { tags . name }
531+ id = { tags . id }
532+ variant = "small"
533+ tags = { tagsValue }
534+ onTagsChange = { setTagsValue }
535+ />
497536 < FormError id = { tags . errorId } > { tags . error } </ FormError >
498537 </ InputGroup >
499538 < InputGroup >
@@ -554,6 +593,12 @@ function StandardTaskForm({
554593 run . seedMetadata && setMetadata ( run . seedMetadata ) ;
555594 setSelectedCodeSampleId ( run . id ) ;
556595 setIsRecentRunsPopoverOpen ( false ) ;
596+ setTtlValue ( run . ttlSeconds ) ;
597+ setConcurrencyKeyValue ( run . concurrencyKey ) ;
598+ setMaxAttemptsValue ( run . maxAttempts ) ;
599+ setMaxDurationValue ( run . maxDurationInSeconds ) ;
600+ setTagsValue ( run . runTags ?? [ ] ) ;
601+ setQueueValue ( run . queue ) ;
557602 } }
558603 className = "flex w-full items-center gap-2 rounded-sm px-2 py-2 outline-none transition-colors focus-custom hover:bg-charcoal-900 "
559604 >
0 commit comments