pierrejeambrun commented on code in PR #46596: URL: https://github.com/apache/airflow/pull/46596#discussion_r1949149192
########## airflow/ui/src/components/TriggerDag/TriggerDAGForm.tsx: ########## @@ -224,7 +216,36 @@ const TriggerDAGForm = ({ dagId, onClose, open }: TriggerDAGFormProps) => { render={({ field }) => ( <Field.Root mt={6}> <Field.Label fontSize="md">Dag Run Notes</Field.Label> - <Input {...field} placeholder="Optional" size="sm" /> + <Editable.Root + onChange={(event: ChangeEvent<HTMLInputElement>) => { + field.value = event.target.value; + }} + value={field.value} + > + <Editable.Preview + _hover={{ backgroundColor: "transparent" }} + alignItems="flex-start" + as={VStack} + gap="0" + height="150px" + overflowY="auto" + width="100%" + > + {Boolean(field.value) ? ( + <ReactMarkdown>{field.value}</ReactMarkdown> + ) : ( + <Text color="fg.subtle">Add a note...</Text> + )} + </Editable.Preview> + <Editable.Textarea + {...field} + data-testid="notes-input" + height="150px" + overflowY="auto" + placeholder="Add a note..." + resize="none" + /> + </Editable.Root> Review Comment: Good idea. Ideally I think we want to extract a component from this `Editable' for markdown content input. I feel like this will be needed to a different places. ########## airflow/ui/src/components/TriggerDag/TriggerDAGForm.tsx: ########## @@ -224,7 +216,36 @@ const TriggerDAGForm = ({ dagId, onClose, open }: TriggerDAGFormProps) => { render={({ field }) => ( <Field.Root mt={6}> <Field.Label fontSize="md">Dag Run Notes</Field.Label> - <Input {...field} placeholder="Optional" size="sm" /> + <Editable.Root + onChange={(event: ChangeEvent<HTMLInputElement>) => { + field.value = event.target.value; + }} + value={field.value} + > + <Editable.Preview + _hover={{ backgroundColor: "transparent" }} + alignItems="flex-start" + as={VStack} + gap="0" + height="150px" + overflowY="auto" + width="100%" + > + {Boolean(field.value) ? ( + <ReactMarkdown>{field.value}</ReactMarkdown> + ) : ( + <Text color="fg.subtle">Add a note...</Text> + )} + </Editable.Preview> + <Editable.Textarea + {...field} + data-testid="notes-input" + height="150px" + overflowY="auto" + placeholder="Add a note..." + resize="none" + /> + </Editable.Root> Review Comment: Good idea. Ideally I think we want to extract a component from this `Editable' for markdown content input. I feel like this will be needed at different places. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org