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: prevent sidebar footer actions from triggering hover preview (#41230)

Joel370efc493c11
diff --git a/web/app/components/detail-sidebar/__tests__/index.spec.tsx b/web/app/components/detail-sidebar/__tests__/index.spec.tsx
index 72666a9b5cd..d333b2f5b61 100644
--- a/web/app/components/detail-sidebar/__tests__/index.spec.tsx
+++ b/web/app/components/detail-sidebar/__tests__/index.spec.tsx
@@ -111,6 +111,16 @@ describe('DetailSidebarFrame', () => {
expect(localStorage.getItem(DETAIL_SIDEBAR_STORAGE_KEY)).toBe('collapse')
})
+ it('keeps collapsed bottom actions in place when they are hovered', () => {
+ renderDetailSidebarFrame()
+ fireEvent.click(screen.getByTestId('detail-toggle'))
+ fireEvent.mouseEnter(screen.getByRole('button', { name: 'help' }))
+
+ expect(screen.getByTestId('detail-top')).toHaveAttribute('data-expand', 'false')
+ expect(screen.getByRole('button', { name: 'account' })).toHaveTextContent('Compact account')
+ expect(localStorage.getItem(DETAIL_SIDEBAR_STORAGE_KEY)).toBe('collapse')
+ })
+
it('persists expansion when the hovered preview toggle is clicked', () => {
renderDetailSidebarFrame()
fireEvent.click(screen.getByTestId('detail-toggle'))
diff --git a/web/app/components/detail-sidebar/index.tsx b/web/app/components/detail-sidebar/index.tsx
index a9cbf208bef..7b4bc886772 100644
--- a/web/app/components/detail-sidebar/index.tsx
+++ b/web/app/components/detail-sidebar/index.tsx
@@ -135,10 +135,12 @@ export function DetailSidebarFrame({
: 'overflow-hidden rounded-lg bg-components-panel-bg',
detailNavigationVisibleExpanded ? 'w-60' : 'w-14',
)}
- onMouseEnter={!detailNavigationExpanded ? openDetailNavigationHoverPreview : undefined}
onMouseLeave={!detailNavigationExpanded ? closeDetailNavigationHoverPreview : undefined}
>
- <div className="flex min-h-0 flex-1 flex-col">
+ <div
+ className="flex min-h-0 flex-1 flex-col"
+ onMouseEnter={!detailNavigationExpanded ? openDetailNavigationHoverPreview : undefined}
+ >
{renderTop({
expand: detailNavigationVisibleExpanded,
onToggle: handleToggleDetailNavigation,