From a9b8c6df669fde24876ad3290ae06fe53f181902 Mon Sep 17 00:00:00 2001 From: Lily Delalande Date: Mon, 24 Mar 2025 21:38:16 -0400 Subject: [PATCH 1/2] add description field to modal --- .../extensions/modal/ExtensionInfoFields.tsx | 73 ++++++++++++------- .../subcomponents/ExtensionList.tsx | 4 +- .../settings_v2/extensions/utils.ts | 6 ++ 3 files changed, 54 insertions(+), 29 deletions(-) diff --git a/ui/desktop/src/components/settings_v2/extensions/modal/ExtensionInfoFields.tsx b/ui/desktop/src/components/settings_v2/extensions/modal/ExtensionInfoFields.tsx index b0bf0b7414b4..46ac6855aa58 100644 --- a/ui/desktop/src/components/settings_v2/extensions/modal/ExtensionInfoFields.tsx +++ b/ui/desktop/src/components/settings_v2/extensions/modal/ExtensionInfoFields.tsx @@ -5,6 +5,7 @@ import React, { useState } from 'react'; interface ExtensionInfoFieldsProps { name: string; type: 'stdio' | 'sse' | 'builtin'; + description: string; onChange: (key: string, value: any) => void; submitAttempted: boolean; } @@ -12,6 +13,7 @@ interface ExtensionInfoFieldsProps { export default function ExtensionInfoFields({ name, type, + description, onChange, submitAttempted, }: ExtensionInfoFieldsProps) { @@ -20,38 +22,55 @@ export default function ExtensionInfoFields({ }; return ( -
-
- +
+ {/* Top row with Name and Type side by side */} +
+
+ +
+ onChange('name', e.target.value)} + placeholder="Enter extension name..." + className={`${!submitAttempted || isNameValid() ? 'border-borderSubtle' : 'border-red-500'} text-textStandard focus:border-borderStandard`} + /> + {submitAttempted && !isNameValid() && ( +
Name is required
+ )} +
+
+ + {/* Type Dropdown */} +
+ + onChange('name', e.target.value)} - placeholder="Enter extension name..." - className={`${!submitAttempted || isNameValid() ? 'border-borderSubtle' : 'border-red-500'} text-textStandard focus:border-borderStandard`} + value={description} + onChange={(e) => onChange('description', e.target.value)} + placeholder="Optional description..." + className={`text-textStandard focus:border-borderStandard`} /> - {submitAttempted && !isNameValid() && ( -
Name is required
- )}
- {/* Type Dropdown */} -
- -