chore: unified plugin status icon position (#36816)

This commit is contained in:
Joel 2026-05-29 14:45:25 +08:00 committed by GitHub
parent c530a5d272
commit 24715a9570
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 7 deletions

View File

@ -121,7 +121,7 @@ describe('PluginItem', () => {
plugin={createPlugin({ icon: '' })}
getIconUrl={mockGetIconUrl}
language="en_US"
statusIcon={<span />}
statusIcon={<span data-testid="status-icon" />}
statusText="status"
/>,
)
@ -129,6 +129,7 @@ describe('PluginItem', () => {
expect(mockGetIconUrl).not.toHaveBeenCalled()
expect(screen.queryByTestId('card-icon')).not.toBeInTheDocument()
expect(container.querySelector('[data-testid="magic-box-icon"]')).toHaveClass('size-8', 'text-text-tertiary')
expect(screen.getByTestId('status-icon').parentElement).toHaveClass('absolute', '-bottom-0.5', '-right-0.5', 'z-10')
})
})

View File

@ -1,7 +1,6 @@
import type { FC, ReactNode } from 'react'
import type { PluginStatus } from '@/app/components/plugins/types'
import type { Locale } from '@/i18n-config'
import { cn } from '@langgenius/dify-ui/cn'
import { MagicBox } from '@/app/components/base/icons/src/vender/solid/mediaAndDevices'
import CardIcon from '@/app/components/plugins/card/base/card-icon'
@ -40,11 +39,7 @@ const PluginItem: FC<PluginItemProps> = ({
)
// eslint-disable-next-line hyoban/prefer-tailwind-icons -- Reuse the same MagicBox component as the marketplace install button.
: <MagicBox className="size-8 text-text-tertiary" />}
<div className={cn(
'absolute z-10',
hasPluginIcon ? '-right-0.5 -bottom-0.5' : '-right-1 -bottom-1',
)}
>
<div className="absolute -right-0.5 -bottom-0.5 z-10">
{statusIcon}
</div>
</div>