From 84fadad662de13b5b06a5c2b73bf5d176d0f3408 Mon Sep 17 00:00:00 2001 From: Simos Mikelatos Date: Tue, 30 Jun 2026 21:30:05 +0000 Subject: [PATCH] fix(skills): use shared dialog for add flow --- src/components/skills/view/ProviderSkills.tsx | 224 +++++++++--------- src/shared/view/ui/Dialog.tsx | 16 +- 2 files changed, 126 insertions(+), 114 deletions(-) diff --git a/src/components/skills/view/ProviderSkills.tsx b/src/components/skills/view/ProviderSkills.tsx index 9dbf41ce..33c42e98 100644 --- a/src/components/skills/view/ProviderSkills.tsx +++ b/src/components/skills/view/ProviderSkills.tsx @@ -26,6 +26,9 @@ import { CardDescription, CardHeader, CardTitle, + Dialog, + DialogContent, + DialogTitle, Input, } from '../../../shared/view/ui'; import { useProviderSkills } from '../hooks/useProviderSkills'; @@ -525,7 +528,7 @@ export default function ProviderSkills({ selectedProvider, currentProjects }: Pr ); const hermesHubPanel = selectedProvider === 'hermes' ? ( -
+
@@ -556,37 +559,8 @@ export default function ProviderSkills({ selectedProvider, currentProjects }: Pr
-
-
- - Hub Maintenance -
-
- {HERMES_SKILL_ACTIONS.map((action) => { - const Icon = action.icon; - return ( - - ); - })} -
-
- {registryResults.length > 0 && ( -
+
{registryResults.map((result) => (
)} + + {registryResults.length === 0 && ( +
+
+ +
Search the Hermes Skills Hub
+
+ Find installable Hermes skills by name, provider, source, or task. +
+
+
+ )} + +
+
+ + Hub Maintenance +
+
+ {HERMES_SKILL_ACTIONS.map((action) => { + const Icon = action.icon; + return ( + + ); + })} +
+
) : null; @@ -667,94 +682,81 @@ export default function ProviderSkills({ selectedProvider, currentProjects }: Pr
- {isAddDialogOpen && ( -
- +
+ + {selectedProvider === 'hermes' && ( +
+
- - {selectedProvider === 'hermes' && ( -
- - -
- )} -
- -
- {addMode === 'hub' && hermesHubPanel ? hermesHubPanel : uploadPanel} - - {(submitError || loadError || registryError || registryStatus || saveStatus === 'success') && ( -
- {submitError || loadError || registryError || registryStatus || 'Skills saved successfully.'} -
- )} -
+ )}
-
- )} + +
+ {addMode === 'hub' && hermesHubPanel ? hermesHubPanel : uploadPanel} +
+ +
+ {(submitError || loadError || registryError || registryStatus || saveStatus === 'success') && ( +
+ {submitError || loadError || registryError || registryStatus || 'Skills saved successfully.'} +
+ )} +
+ + {saveStatus === 'success' && !isAddDialogOpen && (
diff --git a/src/shared/view/ui/Dialog.tsx b/src/shared/view/ui/Dialog.tsx index a3fb3740..18f2922a 100644 --- a/src/shared/view/ui/Dialog.tsx +++ b/src/shared/view/ui/Dialog.tsx @@ -92,12 +92,22 @@ DialogTrigger.displayName = 'DialogTrigger'; interface DialogContentProps extends React.HTMLAttributes { onEscapeKeyDown?: () => void; onPointerDownOutside?: () => void; + overlayClassName?: string; + wrapperClassName?: string; } const FOCUSABLE_SELECTOR = 'a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])'; const DialogContent = React.forwardRef( - ({ className, children, onEscapeKeyDown, onPointerDownOutside, ...props }, ref) => { + ({ + className, + children, + onEscapeKeyDown, + onPointerDownOutside, + overlayClassName, + wrapperClassName, + ...props + }, ref) => { const { open, onOpenChange, triggerRef } = useDialog(); const contentRef = React.useRef(null); const previousFocusRef = React.useRef(null); @@ -171,10 +181,10 @@ const DialogContent = React.forwardRef( if (!open) return null; return createPortal( -
+
{/* Overlay */}
{ onPointerDownOutside?.(); onOpenChange(false);