@@ -61,8 +61,14 @@ const isUpdatingFromStorage = ref(false)
6161// Load data from storage
6262const loadFromStorage = () => {
6363 const storedData = eventBus .getState <TechnicalFormData >(STORAGE_KEY )
64+
6465 if (storedData ) {
6566 localData .value = { ... localData .value , ... storedData }
67+ } else if (props .formData ?.technical ) {
68+ // If no stored data but we have initial form data (edit mode), use it
69+ localData .value = { ... localData .value , ... props .formData .technical }
70+ // Save it to storage for consistency
71+ saveToStorage ()
6672 }
6773}
6874
@@ -98,6 +104,22 @@ const handleStorageChange = (data: { key: string; newValue: any }) => {
98104// Watch for changes in localData and save to storage
99105watch (localData , saveToStorage , { deep: true })
100106
107+ // Watch for changes in props.formData to handle initial data loading in edit mode
108+ watch (
109+ () => props .formData ?.technical ,
110+ (newTechnicalData ) => {
111+ if (newTechnicalData && isEditMode .value ) {
112+ // Only update if storage doesn't already have data or if the language is missing
113+ const storedData = eventBus .getState <TechnicalFormData >(STORAGE_KEY )
114+ if (! storedData || ! storedData .language ) {
115+ localData .value = { ... localData .value , ... newTechnicalData }
116+ saveToStorage ()
117+ }
118+ }
119+ },
120+ { immediate: true , deep: true }
121+ )
122+
101123// Example configuration for hover card
102124const exampleConfig = ` {
103125 "mcpServers": {
@@ -397,6 +419,44 @@ onUnmounted(() => {
397419 <!-- Structured Form Fields -->
398420 <div class =" mt-6 border-t border-gray-100" >
399421 <dl class =" divide-y divide-gray-100" >
422+ <!-- Language Selection -->
423+ <div class =" px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0" >
424+ <dt class =" text-sm/6 font-medium text-gray-900" >{{ t('mcpCatalog.form.technical.language.label') }}</dt >
425+ <dd class =" mt-1 sm:col-span-2 sm:mt-0" >
426+ <Select
427+ :model-value =" localData.language"
428+ @update:model-value =" (value) => updateField('language', String(value || ''))"
429+ >
430+ <SelectTrigger >
431+ <SelectValue :placeholder =" t('mcpCatalog.form.technical.language.placeholder')" />
432+ </SelectTrigger >
433+ <SelectContent >
434+ <SelectItem value =" JavaScript" >
435+ {{ t('mcpCatalog.form.technical.language.options.javascript') }}
436+ </SelectItem >
437+ <SelectItem value =" TypeScript" >
438+ {{ t('mcpCatalog.form.technical.language.options.typescript') }}
439+ </SelectItem >
440+ <SelectItem value =" Python" >
441+ {{ t('mcpCatalog.form.technical.language.options.python') }}
442+ </SelectItem >
443+ <SelectItem value =" Go" >
444+ {{ t('mcpCatalog.form.technical.language.options.go') }}
445+ </SelectItem >
446+ <SelectItem value =" C#" >
447+ {{ t('mcpCatalog.form.technical.language.options.csharp') }}
448+ </SelectItem >
449+ <SelectItem value =" C++" >
450+ {{ t('mcpCatalog.form.technical.language.options.cpp') }}
451+ </SelectItem >
452+ </SelectContent >
453+ </Select >
454+ <p class =" text-xs text-muted-foreground mt-1" >
455+ {{ t('mcpCatalog.form.technical.language.description') }}
456+ </p >
457+ </dd >
458+ </div >
459+
400460 <!-- Transport Type -->
401461 <div class =" px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0" >
402462 <dt class =" text-sm/6 font-medium text-gray-900" >{{ t('mcpCatalog.form.technical.transportType.label') }}</dt >
0 commit comments