Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(web): set app card dropdown menu to non-modal (#35302)

yyhc3eff6abdced
diff --git a/web/app/components/apps/__tests__/app-card.spec.tsx b/web/app/components/apps/__tests__/app-card.spec.tsx
index 2d01dfb3209..84f8b87fa7e 100644
--- a/web/app/components/apps/__tests__/app-card.spec.tsx
+++ b/web/app/components/apps/__tests__/app-card.spec.tsx
@@ -208,14 +208,16 @@ vi.mock('@/app/components/base/ui/dropdown-menu', () => {
DropdownMenu: ({
children,
open = false,
+ modal,
onOpenChange,
}: {
children: React.ReactNode
open?: boolean
+ modal?: boolean
onOpenChange?: (open: boolean) => void
}) => (
<DropdownMenuContext value={{ isOpen: open, setOpen: onOpenChange ?? vi.fn() }}>
- <div data-testid="dropdown-menu" data-open={open}>
+ <div data-testid="dropdown-menu" data-open={open} data-modal={modal}>
{children}
</div>
</DropdownMenuContext>
@@ -461,6 +463,11 @@ describe('AppCard', () => {
expect(screen.getByTestId('dropdown-menu')).toBeInTheDocument()
})
+ it('should render dropdown menu as non-modal', () => {
+ render(<AppCard app={mockApp} />)
+ expect(screen.getByTestId('dropdown-menu')).toHaveAttribute('data-modal', 'false')
+ })
+
it('should show edit option when dropdown menu is opened', async () => {
render(<AppCard app={mockApp} />)
diff --git a/web/app/components/apps/app-card.tsx b/web/app/components/apps/app-card.tsx
index fe3e67b577e..ba85ce51788 100644
--- a/web/app/components/apps/app-card.tsx
+++ b/web/app/components/apps/app-card.tsx
@@ -514,7 +514,7 @@ const AppCard = ({ app, onlineUsers = [], onRefresh }: AppCardProps) => {
)}
>
<div className="mx-1 h-[14px] w-px shrink-0 bg-divider-regular" />
- <DropdownMenu open={isOperationsMenuOpen} onOpenChange={setIsOperationsMenuOpen}>
+ <DropdownMenu modal={false} open={isOperationsMenuOpen} onOpenChange={setIsOperationsMenuOpen}>
<DropdownMenuTrigger
aria-label={t('operation.more', { ns: 'common' })}
className={cn(