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.

refactor(ui): align floating positioning with Base UI (#44588)

yyh3d97949e70ff
diff --git a/packages/dify-ui/docs/overlays.md b/packages/dify-ui/docs/overlays.md
index 881f82cc017..27ed53fae59 100644
--- a/packages/dify-ui/docs/overlays.md
+++ b/packages/dify-ui/docs/overlays.md
@@ -89,8 +89,7 @@ clipped, `display: none` or unmounted, and the shared positioner class turns tha
touch or with assistive technology.
Use a real `<button type="button">` for button-like triggers. If a Base UI trigger intentionally
-renders a non-button element, set `nativeButton={false}`. Let the primitive own placement and
-spacing unless its API documents a measured exception.
+renders a non-button element, set `nativeButton={false}`.
[Base UI Portal]: https://base-ui.com/react/overview/quick-start#portals
[Infotip contract]: ../src/infotip/README.md
diff --git a/packages/dify-ui/src/autocomplete/__tests__/index.spec.tsx b/packages/dify-ui/src/autocomplete/__tests__/index.spec.tsx
index 0b05010dad0..df860c2d61a 100644
--- a/packages/dify-ui/src/autocomplete/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/autocomplete/__tests__/index.spec.tsx
@@ -264,7 +264,8 @@ describe('Autocomplete wrappers', () => {
</AutocompleteInputGroup>
<AutocompletePortal>
<AutocompletePositioner
- placement="top-end"
+ side="top"
+ align="end"
sideOffset={12}
alignOffset={6}
role="group"
diff --git a/packages/dify-ui/src/autocomplete/index.tsx b/packages/dify-ui/src/autocomplete/index.tsx
index ae33ce983b3..8bc6b4d8c95 100644
--- a/packages/dify-ui/src/autocomplete/index.tsx
+++ b/packages/dify-ui/src/autocomplete/index.tsx
@@ -2,7 +2,6 @@
import type { VariantProps } from 'class-variance-authority'
import type * as React from 'react'
-import type { Placement } from '../internal/placement'
import { Autocomplete as BaseAutocomplete } from '@base-ui/react/autocomplete'
import { cva } from 'class-variance-authority'
import { cn } from '../cn'
@@ -15,7 +14,6 @@ import {
floatingSeparatorClassName,
positionerClassName,
} from '../internal/overlay'
-import { parsePlacement } from '../internal/placement'
import { resolveClassName } from '../internal/resolve-class-name'
type AutocompleteActions = BaseAutocomplete.Root.Actions
@@ -267,21 +265,16 @@ function AutocompleteIcon({ className, children, ...props }: AutocompleteIconPro
const AutocompletePortal = BaseAutocomplete.Portal
type AutocompletePortalProps = BaseAutocomplete.Portal.Props
-type AutocompletePositionerProps = Omit<BaseAutocomplete.Positioner.Props, 'side' | 'align'> & {
- placement?: Placement
-}
+type AutocompletePositionerProps = BaseAutocomplete.Positioner.Props
function AutocompletePositioner({
className,
- placement = 'bottom-start',
+ align = 'start',
sideOffset = 4,
...props
}: AutocompletePositionerProps) {
- const { side, align } = parsePlacement(placement)
-
return (
<BaseAutocomplete.Positioner
- side={side}
align={align}
sideOffset={sideOffset}
className={(state) => cn(positionerClassName, resolveClassName(className, state))}
diff --git a/packages/dify-ui/src/combobox/__tests__/index.spec.tsx b/packages/dify-ui/src/combobox/__tests__/index.spec.tsx
index 443b5a7be87..c93475a62c0 100644
--- a/packages/dify-ui/src/combobox/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/combobox/__tests__/index.spec.tsx
@@ -382,7 +382,8 @@ describe('Combobox wrappers', () => {
</ComboboxTrigger>
<ComboboxPortal>
<ComboboxPositioner
- placement="top-end"
+ side="top"
+ align="end"
sideOffset={12}
alignOffset={6}
data-testid="combobox-positioner"
diff --git a/packages/dify-ui/src/combobox/index.stories.tsx b/packages/dify-ui/src/combobox/index.stories.tsx
index 932746d38db..637e8665674 100644
--- a/packages/dify-ui/src/combobox/index.stories.tsx
+++ b/packages/dify-ui/src/combobox/index.stories.tsx
@@ -598,7 +598,7 @@ function InlinePopoverDemo() {
}}
>
<PopoverTrigger render={<Button variant="secondary" />}>Choose reviewer</PopoverTrigger>
- <PopoverContent placement="bottom-start" sideOffset={4} className="w-80 p-0">
+ <PopoverContent side="bottom" align="start" sideOffset={4} className="w-80 p-0">
<PopoverTitle className="sr-only">Choose reviewer</PopoverTitle>
<Combobox
inline
diff --git a/packages/dify-ui/src/combobox/index.tsx b/packages/dify-ui/src/combobox/index.tsx
index cf428734d12..5fd7d056679 100644
--- a/packages/dify-ui/src/combobox/index.tsx
+++ b/packages/dify-ui/src/combobox/index.tsx
@@ -2,7 +2,6 @@
import type { VariantProps } from 'class-variance-authority'
import type * as React from 'react'
-import type { Placement } from '../internal/placement'
import { Combobox as BaseCombobox } from '@base-ui/react/combobox'
import { cva } from 'class-variance-authority'
import { cn } from '../cn'
@@ -15,7 +14,6 @@ import {
floatingSeparatorClassName,
positionerClassName,
} from '../internal/overlay'
-import { parsePlacement } from '../internal/placement'
import { resolveClassName } from '../internal/resolve-class-name'
type ComboboxActions = BaseCombobox.Root.Actions
@@ -289,21 +287,16 @@ function ComboboxIcon({ className, children, ...props }: ComboboxIconProps) {
const ComboboxPortal = BaseCombobox.Portal
type ComboboxPortalProps = BaseCombobox.Portal.Props
-type ComboboxPositionerProps = Omit<BaseCombobox.Positioner.Props, 'side' | 'align'> & {
- placement?: Placement
-}
+type ComboboxPositionerProps = BaseCombobox.Positioner.Props
function ComboboxPositioner({
className,
- placement = 'bottom-start',
+ align = 'start',
sideOffset = 4,
...props
}: ComboboxPositionerProps) {
- const { side, align } = parsePlacement(placement)
-
return (
<BaseCombobox.Positioner
- side={side}
align={align}
sideOffset={sideOffset}
className={(state) => cn(positionerClassName, resolveClassName(className, state))}
diff --git a/packages/dify-ui/src/context-menu/__tests__/index.spec.tsx b/packages/dify-ui/src/context-menu/__tests__/index.spec.tsx
index f8f2d841586..070167a6e8c 100644
--- a/packages/dify-ui/src/context-menu/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/context-menu/__tests__/index.spec.tsx
@@ -41,6 +41,14 @@ describe('context-menu wrapper', () => {
await expect.element(screen.getByRole('menu')).toHaveAttribute('data-side', 'bottom')
await expect.element(screen.getByRole('menu')).toHaveAttribute('data-align', 'start')
+ const triggerRect = screen.getByLabelText('context trigger').element().getBoundingClientRect()
+ await expect
+ .poll(() => screen.getByRole('menu').element().getBoundingClientRect().left)
+ .toBeCloseTo(triggerRect.left + 8, 0)
+ await expect
+ .poll(() => screen.getByRole('menu').element().getBoundingClientRect().top)
+ .toBeCloseTo(triggerRect.top + 8, 0)
+
await expect
.element(screen.getByRole('menuitem', { name: 'Content action' }))
.toBeInTheDocument()
@@ -50,7 +58,7 @@ describe('context-menu wrapper', () => {
const screen = await renderWithRoomAround(
<ContextMenu>
<ContextMenuTrigger aria-label="context trigger">Open</ContextMenuTrigger>
- <ContextMenuContent placement="top-end" sideOffset={12} alignOffset={-3}>
+ <ContextMenuContent side="top" align="end" sideOffset={12} alignOffset={-3}>
<ContextMenuItem>Custom content</ContextMenuItem>
</ContextMenuContent>
</ContextMenu>,
@@ -86,7 +94,7 @@ describe('context-menu wrapper', () => {
})
describe('ContextMenuSubContent', () => {
- it('should place sub-content inline-end-start when placement is omitted', async () => {
+ it('should place sub-content inline-end-start when side and align are omitted', async () => {
const screen = await renderWithRoomAround(
<ContextMenu>
<ContextMenuTrigger aria-label="context trigger">Open</ContextMenuTrigger>
diff --git a/packages/dify-ui/src/context-menu/index.tsx b/packages/dify-ui/src/context-menu/index.tsx
index 2c9f8dac269..f47666fb3eb 100644
--- a/packages/dify-ui/src/context-menu/index.tsx
+++ b/packages/dify-ui/src/context-menu/index.tsx
@@ -2,7 +2,6 @@
import type * as React from 'react'
import type { MenuItemVariant } from '../internal/menu'
-import type { Placement } from '../internal/placement'
import { ContextMenu as BaseContextMenu } from '@base-ui/react/context-menu'
import { cn } from '../cn'
import {
@@ -18,7 +17,6 @@ import {
floatingSeparatorClassName,
positionerClassName,
} from '../internal/overlay'
-import { parsePlacement } from '../internal/placement'
import { resolveClassName } from '../internal/resolve-class-name'
const ContextMenu = BaseContextMenu.Root
@@ -54,21 +52,19 @@ function ContextMenuRadioGroup<Value = unknown>(
}
type ContextMenuContentProps = Omit<BaseContextMenu.Popup.Props, 'children'> &
- Pick<BaseContextMenu.Positioner.Props, 'sideOffset' | 'alignOffset'> & {
+ Pick<BaseContextMenu.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset'> & {
children: React.ReactNode
- placement?: Placement
}
function ContextMenuContent({
children,
- placement = 'bottom-start',
+ side,
+ align,
sideOffset = 0,
alignOffset = 0,
className,
...props
}: ContextMenuContentProps) {
- const { side, align } = parsePlacement(placement)
-
return (
<BaseContextMenu.Portal>
<BaseContextMenu.Positioner
@@ -227,17 +223,15 @@ function ContextMenuSubTrigger({
type ContextMenuSubContentProps = ContextMenuContentProps
-// Base UI's own submenu default: it opens away from the trigger and follows the text direction.
function ContextMenuSubContent({
children,
- placement = 'inline-end-start',
+ side,
+ align,
sideOffset = 4,
- alignOffset = 0,
+ alignOffset,
className,
...props
}: ContextMenuSubContentProps) {
- const { side, align } = parsePlacement(placement)
-
return (
<BaseContextMenu.Portal>
<BaseContextMenu.Positioner
diff --git a/packages/dify-ui/src/date-time/internal/picker-parts.tsx b/packages/dify-ui/src/date-time/internal/picker-parts.tsx
index eed9eb3d5e9..1968450beeb 100644
--- a/packages/dify-ui/src/date-time/internal/picker-parts.tsx
+++ b/packages/dify-ui/src/date-time/internal/picker-parts.tsx
@@ -361,7 +361,8 @@ function PickerContent({
const mergedRef = useMergedRefs(popupRef, ref)
return (
<PopoverContent
- placement="bottom-start"
+ side="bottom"
+ align="start"
aria-label={ariaLabel}
aria-labelledby={ariaLabelledBy ?? (ariaLabel ? undefined : labelId)}
dir={direction}
diff --git a/packages/dify-ui/src/dropdown-menu/__tests__/index.spec.tsx b/packages/dify-ui/src/dropdown-menu/__tests__/index.spec.tsx
index 7676f5cafaa..de76beb8711 100644
--- a/packages/dify-ui/src/dropdown-menu/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/dropdown-menu/__tests__/index.spec.tsx
@@ -161,7 +161,7 @@ describe('dropdown-menu wrapper', () => {
const screen = await renderWithSafeViewport(
<DropdownMenu open>
<DropdownMenuTrigger aria-label="menu trigger">Open</DropdownMenuTrigger>
- <DropdownMenuContent placement="top-start" sideOffset={12} alignOffset={-3}>
+ <DropdownMenuContent side="top" align="start" sideOffset={12} alignOffset={-3}>
<DropdownMenuItem>Custom content</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>,
@@ -197,7 +197,7 @@ describe('dropdown-menu wrapper', () => {
<DropdownMenu open>
<DropdownMenuTrigger aria-label="menu trigger">Open</DropdownMenuTrigger>
<DropdownMenuPortal>
- <DropdownMenuPositioner data-testid="custom-positioner" placement="top-start">
+ <DropdownMenuPositioner data-testid="custom-positioner" side="top" align="start">
<DropdownMenuPopup>
<DropdownMenuItem>Anatomy action</DropdownMenuItem>
</DropdownMenuPopup>
@@ -216,7 +216,7 @@ describe('dropdown-menu wrapper', () => {
})
describe('DropdownMenuSubContent', () => {
- it('should place sub-content inline-end-start when placement is omitted', async () => {
+ it('should place sub-content inline-end-start when side and align are omitted', async () => {
const screen = await renderWithSafeViewport(
<DropdownMenu open>
<DropdownMenuTrigger aria-label="menu trigger">Open</DropdownMenuTrigger>
@@ -257,7 +257,8 @@ describe('dropdown-menu wrapper', () => {
<DropdownMenuSub open>
<DropdownMenuSubTrigger>More actions</DropdownMenuSubTrigger>
<DropdownMenuSubContent
- placement="right-end"
+ side="right"
+ align="end"
sideOffset={6}
alignOffset={2}
id="dropdown-sub-popup"
diff --git a/packages/dify-ui/src/dropdown-menu/__tests__/types.tsx b/packages/dify-ui/src/dropdown-menu/__tests__/types.tsx
index 5d1cdb722bf..e7c5693b98f 100644
--- a/packages/dify-ui/src/dropdown-menu/__tests__/types.tsx
+++ b/packages/dify-ui/src/dropdown-menu/__tests__/types.tsx
@@ -1,11 +1,15 @@
+import type { Menu } from '@base-ui/react/menu'
import type {
DropdownMenuActions,
+ DropdownMenuContentProps,
DropdownMenuHandle,
DropdownMenuProps,
+ DropdownMenuSubContentProps,
} from '@langgenius/dify-ui/dropdown-menu'
import {
createDropdownMenuHandle,
DropdownMenu,
+ DropdownMenuSubContent,
DropdownMenuTrigger,
} from '@langgenius/dify-ui/dropdown-menu'
import * as React from 'react'
@@ -45,3 +49,22 @@ export function dropdownMenuActionsTypeContract() {
>()
return <DropdownMenu actionsRef={actionsRef} />
}
+
+export function dropdownMenuPositioningTypeContracts() {
+ type Positioning = 'side' | 'align' | 'sideOffset' | 'alignOffset'
+ expectTypeOf<Pick<DropdownMenuContentProps, Positioning>>().toEqualTypeOf<
+ Pick<Menu.Positioner.Props, Positioning>
+ >()
+ expectTypeOf<Pick<DropdownMenuSubContentProps, Positioning>>().toEqualTypeOf<
+ Pick<Menu.Positioner.Props, Positioning>
+ >()
+ const inherited = <DropdownMenuSubContent>Actions</DropdownMenuSubContent>
+ const independent = <DropdownMenuSubContent align="end">Actions</DropdownMenuSubContent>
+ const invalidSide = (
+ // @ts-expect-error Combined placement strings are not valid sides.
+ <DropdownMenuSubContent side="inline-end-start">Actions</DropdownMenuSubContent>
+ )
+ // @ts-expect-error Logical sides are not alignments.
+ const invalidAlign = <DropdownMenuSubContent align="inline-end">Actions</DropdownMenuSubContent>
+ return { inherited, independent, invalidSide, invalidAlign }
+}
diff --git a/packages/dify-ui/src/dropdown-menu/index.tsx b/packages/dify-ui/src/dropdown-menu/index.tsx
index 9184d11220a..218b251ed35 100644
--- a/packages/dify-ui/src/dropdown-menu/index.tsx
+++ b/packages/dify-ui/src/dropdown-menu/index.tsx
@@ -3,7 +3,6 @@
import type * as React from 'react'
import type { InputGroupProps } from '../input-group'
import type { MenuItemVariant } from '../internal/menu'
-import type { Placement } from '../internal/placement'
import { Menu } from '@base-ui/react/menu'
import { cn } from '../cn'
import { InputGroup } from '../input-group'
@@ -22,7 +21,6 @@ import {
floatingSeparatorClassName,
positionerClassName,
} from '../internal/overlay'
-import { parsePlacement } from '../internal/placement'
import { resolveClassName } from '../internal/resolve-class-name'
const DropdownMenu = Menu.Root
@@ -248,25 +246,16 @@ function DropdownMenuGroupLabel({ className, ...props }: DropdownMenuGroupLabelP
)
}
-type DropdownMenuPositionerProps = Omit<Menu.Positioner.Props, 'side' | 'align'> & {
- placement: Placement
-}
+type DropdownMenuPositionerProps = Menu.Positioner.Props
function DropdownMenuPositioner({
className,
- placement,
sideOffset = 4,
- alignOffset = 0,
...props
}: DropdownMenuPositionerProps) {
- const { side, align } = parsePlacement(placement)
-
return (
<Menu.Positioner
- side={side}
- align={align}
sideOffset={sideOffset}
- alignOffset={alignOffset}
className={(state) => cn(positionerClassName, resolveClassName(className, state))}
{...props}
/>
@@ -294,23 +283,24 @@ function DropdownMenuPopup({ className, ...props }: DropdownMenuPopupProps) {
}
type DropdownMenuContentProps = Omit<DropdownMenuPopupProps, 'children'> &
- Pick<DropdownMenuPositionerProps, 'alignOffset' | 'sideOffset'> & {
+ Pick<DropdownMenuPositionerProps, 'side' | 'align' | 'alignOffset' | 'sideOffset'> & {
children: React.ReactNode
- placement?: Placement
}
function DropdownMenuContent({
children,
- placement = 'bottom-end',
- sideOffset = 4,
- alignOffset = 0,
+ side,
+ align = 'end',
+ sideOffset,
+ alignOffset,
className,
...props
}: DropdownMenuContentProps) {
return (
<DropdownMenuPortal>
<DropdownMenuPositioner
- placement={placement}
+ side={side}
+ align={align}
sideOffset={sideOffset}
alignOffset={alignOffset}
>
@@ -354,19 +344,20 @@ function DropdownMenuSubTrigger({
type DropdownMenuSubContentProps = DropdownMenuContentProps
-// Base UI's own submenu default: it opens away from the trigger and follows the text direction.
function DropdownMenuSubContent({
children,
- placement = 'inline-end-start',
- sideOffset = 4,
- alignOffset = 0,
+ side,
+ align,
+ sideOffset,
+ alignOffset,
className,
...props
}: DropdownMenuSubContentProps) {
return (
<DropdownMenuPortal>
<DropdownMenuPositioner
- placement={placement}
+ side={side}
+ align={align}
sideOffset={sideOffset}
alignOffset={alignOffset}
>
diff --git a/packages/dify-ui/src/infotip/__tests__/types.tsx b/packages/dify-ui/src/infotip/__tests__/types.tsx
index 0de6a6db160..6dc8490cbf2 100644
--- a/packages/dify-ui/src/infotip/__tests__/types.tsx
+++ b/packages/dify-ui/src/infotip/__tests__/types.tsx
@@ -23,7 +23,8 @@ export function infotipTypeContracts(
<InfotipContent
ref={popupRef}
aria-label="Details"
- placement="bottom-start"
+ side="bottom"
+ align="start"
sideOffset={({ side }) => (side === 'top' ? 4 : 8)}
className={(state) => (state.open ? 'w-60' : undefined)}
style={(state) => ({ opacity: state.open ? 1 : 0 })}
diff --git a/packages/dify-ui/src/infotip/index.tsx b/packages/dify-ui/src/infotip/index.tsx
index ea17469f26e..32d79c7cb64 100644
--- a/packages/dify-ui/src/infotip/index.tsx
+++ b/packages/dify-ui/src/infotip/index.tsx
@@ -1,12 +1,10 @@
'use client'
import type * as React from 'react'
-import type { Placement } from '../internal/placement'
import { Popover as BasePopover } from '@base-ui/react/popover'
import { cn } from '../cn'
import { iconButtonVariants } from '../icon-button'
import { hintPopupClassName, positionerClassName } from '../internal/overlay'
-import { parsePlacement } from '../internal/placement'
import { resolveClassName } from '../internal/resolve-class-name'
const iconClassNames = {
@@ -76,19 +74,18 @@ function InfotipTrigger<Payload = unknown>({
}
type InfotipContentProps = Omit<BasePopover.Popup.Props, 'children'> &
- Pick<BasePopover.Positioner.Props, 'sideOffset' | 'alignOffset'> & {
+ Pick<BasePopover.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset'> & {
children: React.ReactNode
- placement?: Placement
}
function InfotipContent({
- placement = 'top',
+ side = 'top',
+ align,
sideOffset = 8,
- alignOffset = 0,
+ alignOffset,
className,
...props
}: InfotipContentProps) {
- const { side, align } = parsePlacement(placement)
return (
<BasePopover.Portal>
<BasePopover.Positioner
diff --git a/packages/dify-ui/src/input-group/index.stories.tsx b/packages/dify-ui/src/input-group/index.stories.tsx
index 1b7280396d3..519edb51276 100644
--- a/packages/dify-ui/src/input-group/index.stories.tsx
+++ b/packages/dify-ui/src/input-group/index.stories.tsx
@@ -154,7 +154,7 @@ function InputGroupDropdownDemo() {
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={8}>
+ <DropdownMenuContent side="bottom" align="end" sideOffset={8}>
<DropdownMenuItem>Settings</DropdownMenuItem>
<DropdownMenuItem>Copy path</DropdownMenuItem>
</DropdownMenuContent>
diff --git a/packages/dify-ui/src/internal/placement.ts b/packages/dify-ui/src/internal/placement.ts
deleted file mode 100644
index c3c021adfa0..00000000000
--- a/packages/dify-ui/src/internal/placement.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-// Base UI positions a popup with `side` and `align`; a placement joins the two in Floating UI's
-// `side-align` notation, with the `center` alignment left off. The inline sides follow the text
-// direction, so `inline-end` is right in LTR and left in RTL.
-
-const PLACEMENT_PARTS = {
- top: { side: 'top', align: 'center' },
- 'top-start': { side: 'top', align: 'start' },
- 'top-end': { side: 'top', align: 'end' },
- right: { side: 'right', align: 'center' },
- 'right-start': { side: 'right', align: 'start' },
- 'right-end': { side: 'right', align: 'end' },
- bottom: { side: 'bottom', align: 'center' },
- 'bottom-start': { side: 'bottom', align: 'start' },
- 'bottom-end': { side: 'bottom', align: 'end' },
- left: { side: 'left', align: 'center' },
- 'left-start': { side: 'left', align: 'start' },
- 'left-end': { side: 'left', align: 'end' },
- 'inline-start': { side: 'inline-start', align: 'center' },
- 'inline-start-start': { side: 'inline-start', align: 'start' },
- 'inline-start-end': { side: 'inline-start', align: 'end' },
- 'inline-end': { side: 'inline-end', align: 'center' },
- 'inline-end-start': { side: 'inline-end', align: 'start' },
- 'inline-end-end': { side: 'inline-end', align: 'end' },
-} as const satisfies Record<string, { side: string; align: string }>
-
-export type Placement = keyof typeof PLACEMENT_PARTS
-
-export function parsePlacement(placement: Placement) {
- return PLACEMENT_PARTS[placement]
-}
diff --git a/packages/dify-ui/src/popover/__tests__/index.spec.tsx b/packages/dify-ui/src/popover/__tests__/index.spec.tsx
index 4c90391215c..cc2ef9c2491 100644
--- a/packages/dify-ui/src/popover/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/popover/__tests__/index.spec.tsx
@@ -125,7 +125,7 @@ describe('Popover anatomy', () => {
</DropdownMenuItem>
<PopoverPortal>
<PopoverBackdrop ref={backdropRef} />
- <PopoverPositioner placement="right-start">
+ <PopoverPositioner side="right" align="start">
<PopoverPopup>
<PopoverTitle>More options</PopoverTitle>
<input aria-label="Filter options" />
@@ -177,7 +177,7 @@ describe('Popover anatomy', () => {
<Popover open>
<PopoverTrigger>Open</PopoverTrigger>
<PopoverPortal>
- <PopoverPositioner placement="top-end" data-testid="anatomy-positioner">
+ <PopoverPositioner side="top" align="end" data-testid="anatomy-positioner">
<PopoverPopup>
<PopoverTitle>Anatomy popover</PopoverTitle>
<PopoverDescription>Anatomy content</PopoverDescription>
diff --git a/packages/dify-ui/src/popover/__tests__/types.tsx b/packages/dify-ui/src/popover/__tests__/types.tsx
index a204ab1e398..b10d1566bde 100644
--- a/packages/dify-ui/src/popover/__tests__/types.tsx
+++ b/packages/dify-ui/src/popover/__tests__/types.tsx
@@ -1,5 +1,5 @@
-import type { PopoverActions, PopoverProps } from '@langgenius/dify-ui/popover'
-import { Popover } from '@langgenius/dify-ui/popover'
+import type { PopoverActions, PopoverContentProps, PopoverProps } from '@langgenius/dify-ui/popover'
+import { Popover, PopoverContent } from '@langgenius/dify-ui/popover'
import * as React from 'react'
import { expectTypeOf } from 'vite-plus/test'
@@ -10,3 +10,21 @@ export function popoverActionsTypeContract() {
>()
return <Popover actionsRef={actionsRef} />
}
+
+export function popoverPositioningTypeContract() {
+ const position: Pick<PopoverContentProps, 'side' | 'align' | 'sideOffset'> = {
+ side: 'inline-end',
+ align: 'start',
+ sideOffset: ({ side, align, anchor }) => {
+ expectTypeOf(side).toEqualTypeOf<NonNullable<PopoverContentProps['side']>>()
+ expectTypeOf(align).toEqualTypeOf<NonNullable<PopoverContentProps['align']>>()
+ return anchor.width / 2
+ },
+ }
+ const content = <PopoverContent {...position}>Details</PopoverContent>
+ // @ts-expect-error Combined placement strings are no longer part of the public API.
+ const legacy = <PopoverContent placement="bottom-start">Details</PopoverContent>
+ // @ts-expect-error Alignment is independent of the side.
+ const invalid = <PopoverContent align="bottom">Details</PopoverContent>
+ return { content, legacy, invalid }
+}
diff --git a/packages/dify-ui/src/popover/index.stories.tsx b/packages/dify-ui/src/popover/index.stories.tsx
index c06069908d5..4e11a12868f 100644
--- a/packages/dify-ui/src/popover/index.stories.tsx
+++ b/packages/dify-ui/src/popover/index.stories.tsx
@@ -24,7 +24,7 @@ const meta = {
docs: {
description: {
component:
- 'Compound popover built on Base UI Popover. Use it for contextual affordances, overflow menus, filters, and forms that anchor to a trigger. Control placement via the `placement` prop on `PopoverContent` and compose arbitrary children inside the popup.\n\nPass `openOnHover` on `PopoverTrigger` when the popup should also reveal on hover (see the **Infotip** story). Unlike `Tooltip` and `PreviewCard`, hover on `Popover` still falls back to tap/focus, so touch and screen-reader users can reach the content.',
+ 'Compound popover built on Base UI Popover. Use it for contextual affordances, overflow menus, filters, and forms that anchor to a trigger.\n\nPass `openOnHover` on `PopoverTrigger` when the popup should also reveal on hover (see the **Infotip** story). Unlike `Tooltip` and `PreviewCard`, hover on `Popover` still falls back to tap/focus, so touch and screen-reader users can reach the content.',
},
},
},
@@ -180,7 +180,8 @@ export const Infotip: Story = {
}
/>
<PopoverContent
- placement="top"
+ side="top"
+ align="center"
className="max-w-75 px-3 py-2 system-xs-regular text-text-tertiary"
>
Set which resource to use first when running models. The Trial quota will be used after
@@ -191,45 +192,43 @@ export const Infotip: Story = {
),
}
-type PopoverPlacement = NonNullable<PopoverContentProps['placement']>
-
-const PLACEMENTS: PopoverPlacement[] = [
- 'top-start',
- 'top',
- 'top-end',
- 'right-start',
- 'right',
- 'right-end',
- 'bottom-start',
- 'bottom',
- 'bottom-end',
- 'left-start',
- 'left',
- 'left-end',
- 'inline-start-start',
- 'inline-start',
- 'inline-start-end',
- 'inline-end-start',
- 'inline-end',
- 'inline-end-end',
-]
+const POSITIONS = [
+ { side: 'top', align: 'start' },
+ { side: 'top', align: 'center' },
+ { side: 'top', align: 'end' },
+ { side: 'right', align: 'start' },
+ { side: 'right', align: 'center' },
+ { side: 'right', align: 'end' },
+ { side: 'bottom', align: 'start' },
+ { side: 'bottom', align: 'center' },
+ { side: 'bottom', align: 'end' },
+ { side: 'left', align: 'start' },
+ { side: 'left', align: 'center' },
+ { side: 'left', align: 'end' },
+ { side: 'inline-start', align: 'start' },
+ { side: 'inline-start', align: 'center' },
+ { side: 'inline-start', align: 'end' },
+ { side: 'inline-end', align: 'start' },
+ { side: 'inline-end', align: 'center' },
+ { side: 'inline-end', align: 'end' },
+] satisfies Array<Pick<PopoverContentProps, 'side' | 'align'>>
function PlacementsDemo() {
- const [placement, setPlacement] = React.useState<PopoverPlacement>('bottom')
+ const [position, setPosition] = React.useState(POSITIONS[7]!)
return (
<div className="flex flex-col items-center gap-4 p-20">
<div className="grid grid-cols-3 gap-2 text-xs">
- {PLACEMENTS.map((value) => (
+ {POSITIONS.map((value) => (
<button
- key={value}
+ key={`${value.side}-${value.align}`}
type="button"
- onClick={() => setPlacement(value)}
+ onClick={() => setPosition(value)}
className={`rounded-md border border-divider-subtle px-2 py-1 text-text-secondary focus-visible:ring-2 focus-visible:ring-state-accent-solid focus-visible:outline-hidden ${
- placement === value ? 'bg-state-base-hover' : 'bg-components-button-secondary-bg'
+ position === value ? 'bg-state-base-hover' : 'bg-components-button-secondary-bg'
}`}
>
- {value}
+ {value.side} / {value.align}
</button>
))}
</div>
@@ -237,11 +236,10 @@ function PlacementsDemo() {
<PopoverTrigger render={<button type="button" className={triggerButtonClassName} />}>
Anchored trigger
</PopoverTrigger>
- <PopoverContent placement={placement}>
+ <PopoverContent side={position.side} align={position.align}>
<div className="flex w-56 flex-col gap-1 p-3">
<PopoverTitle className="text-sm font-semibold text-text-primary">
- placement="
- {placement}"
+ {`side="${position.side}" align="${position.align}"`}
</PopoverTitle>
<PopoverDescription className="text-xs text-text-secondary">
Popover positions itself relative to the trigger using the selected placement.
diff --git a/packages/dify-ui/src/popover/index.tsx b/packages/dify-ui/src/popover/index.tsx
index 079c42b9d6a..29effcabe08 100644
--- a/packages/dify-ui/src/popover/index.tsx
+++ b/packages/dify-ui/src/popover/index.tsx
@@ -1,12 +1,10 @@
'use client'
import type * as React from 'react'
-import type { Placement } from '../internal/placement'
import { Popover as BasePopover } from '@base-ui/react/popover'
import { cn } from '../cn'
import { focusRingClassName } from '../internal/focus'
import { floatingPopupAnimationClassName, positionerClassName } from '../internal/overlay'
-import { parsePlacement } from '../internal/placement'
import { resolveClassName } from '../internal/resolve-class-name'
const Popover = BasePopover.Root
@@ -53,25 +51,12 @@ function PopoverBackdrop({ className, ...props }: PopoverBackdropProps) {
)
}
-type PopoverPositionerProps = Omit<BasePopover.Positioner.Props, 'side' | 'align'> & {
- placement?: Placement
-}
-
-function PopoverPositioner({
- className,
- placement = 'bottom',
- sideOffset = 8,
- alignOffset = 0,
- ...props
-}: PopoverPositionerProps) {
- const { side, align } = parsePlacement(placement)
+type PopoverPositionerProps = BasePopover.Positioner.Props
+function PopoverPositioner({ className, sideOffset = 8, ...props }: PopoverPositionerProps) {
return (
<BasePopover.Positioner
- side={side}
- align={align}
sideOffset={sideOffset}
- alignOffset={alignOffset}
className={(state) => cn(positionerClassName, resolveClassName(className, state))}
{...props}
/>
@@ -96,21 +81,27 @@ function PopoverPopup({ className, ...props }: PopoverPopupProps) {
}
type PopoverContentProps = Omit<PopoverPopupProps, 'children'> &
- Pick<PopoverPositionerProps, 'alignOffset' | 'placement' | 'sideOffset'> & {
+ Pick<PopoverPositionerProps, 'alignOffset' | 'side' | 'align' | 'sideOffset'> & {
children: React.ReactNode
}
function PopoverContent({
children,
- placement = 'bottom',
- sideOffset = 8,
- alignOffset = 0,
+ side,
+ align,
+ sideOffset,
+ alignOffset,
className,
...props
}: PopoverContentProps) {
return (
<PopoverPortal>
- <PopoverPositioner placement={placement} sideOffset={sideOffset} alignOffset={alignOffset}>
+ <PopoverPositioner
+ side={side}
+ align={align}
+ sideOffset={sideOffset}
+ alignOffset={alignOffset}
+ >
<PopoverPopup
className={(state) =>
cn(
diff --git a/packages/dify-ui/src/preview-card/__tests__/index.spec.tsx b/packages/dify-ui/src/preview-card/__tests__/index.spec.tsx
index 2b6470fa73f..0235b9c109e 100644
--- a/packages/dify-ui/src/preview-card/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/preview-card/__tests__/index.spec.tsx
@@ -14,7 +14,7 @@ const renderWithSafeViewport = (ui: React.ReactNode) =>
describe('PreviewCardContent', () => {
describe('Placement', () => {
- it('should use bottom placement and default offsets when placement props are not provided', async () => {
+ it('should use bottom placement and default offsets when positioning props are not provided', async () => {
const screen = await renderWithSafeViewport(
<PreviewCard open>
<PreviewCardTrigger href="#default-preview">Open</PreviewCardTrigger>
@@ -30,11 +30,11 @@ describe('PreviewCardContent', () => {
.toHaveAttribute('data-align', 'center')
})
- it('should apply parsed custom placement and custom offsets when placement props are provided', async () => {
+ it('should apply custom side and alignment and custom offsets when positioning props are provided', async () => {
const screen = await renderWithSafeViewport(
<PreviewCard open>
<PreviewCardTrigger href="#custom-preview">Open</PreviewCardTrigger>
- <PreviewCardContent placement="top-end" sideOffset={14} alignOffset={6}>
+ <PreviewCardContent side="top" align="end" sideOffset={14} alignOffset={6}>
Custom placement content
</PreviewCardContent>
</PreviewCard>,
@@ -90,7 +90,7 @@ describe('PreviewCard anatomy', () => {
<PreviewCard open>
<PreviewCardTrigger href="#anatomy-preview">Open</PreviewCardTrigger>
<PreviewCardPortal>
- <PreviewCardPositioner placement="top-end" data-testid="preview-positioner">
+ <PreviewCardPositioner side="top" align="end" data-testid="preview-positioner">
<PreviewCardPopup>Anatomy surface</PreviewCardPopup>
</PreviewCardPositioner>
</PreviewCardPortal>
diff --git a/packages/dify-ui/src/preview-card/index.stories.tsx b/packages/dify-ui/src/preview-card/index.stories.tsx
index dde91c11927..a7864dcbf4d 100644
--- a/packages/dify-ui/src/preview-card/index.stories.tsx
+++ b/packages/dify-ui/src/preview-card/index.stories.tsx
@@ -109,45 +109,43 @@ export const LinkPreview: Story = {
render: () => <LinkPreviewDemo />,
}
-type PreviewCardPlacement = NonNullable<PreviewCardContentProps['placement']>
-
-const PLACEMENTS: PreviewCardPlacement[] = [
- 'top-start',
- 'top',
- 'top-end',
- 'right-start',
- 'right',
- 'right-end',
- 'bottom-start',
- 'bottom',
- 'bottom-end',
- 'left-start',
- 'left',
- 'left-end',
- 'inline-start-start',
- 'inline-start',
- 'inline-start-end',
- 'inline-end-start',
- 'inline-end',
- 'inline-end-end',
-]
+const POSITIONS = [
+ { side: 'top', align: 'start' },
+ { side: 'top', align: 'center' },
+ { side: 'top', align: 'end' },
+ { side: 'right', align: 'start' },
+ { side: 'right', align: 'center' },
+ { side: 'right', align: 'end' },
+ { side: 'bottom', align: 'start' },
+ { side: 'bottom', align: 'center' },
+ { side: 'bottom', align: 'end' },
+ { side: 'left', align: 'start' },
+ { side: 'left', align: 'center' },
+ { side: 'left', align: 'end' },
+ { side: 'inline-start', align: 'start' },
+ { side: 'inline-start', align: 'center' },
+ { side: 'inline-start', align: 'end' },
+ { side: 'inline-end', align: 'start' },
+ { side: 'inline-end', align: 'center' },
+ { side: 'inline-end', align: 'end' },
+] satisfies Array<Pick<PreviewCardContentProps, 'side' | 'align'>>
function PlacementsDemo() {
- const [placement, setPlacement] = React.useState<PreviewCardPlacement>('bottom')
+ const [position, setPosition] = React.useState(POSITIONS[7]!)
return (
<div className="flex flex-col items-center gap-4 p-20">
<div className="grid grid-cols-3 gap-2 text-xs">
- {PLACEMENTS.map((value) => (
+ {POSITIONS.map((value) => (
<button
- key={value}
+ key={`${value.side}-${value.align}`}
type="button"
- onClick={() => setPlacement(value)}
+ onClick={() => setPosition(value)}
className={`rounded-md border border-divider-subtle px-2 py-1 text-text-secondary focus-visible:ring-2 focus-visible:ring-state-accent-solid focus-visible:outline-hidden ${
- placement === value ? 'bg-state-base-hover' : 'bg-components-button-secondary-bg'
+ position === value ? 'bg-state-base-hover' : 'bg-components-button-secondary-bg'
}`}
>
- {value}
+ {value.side} / {value.align}
</button>
))}
</div>
@@ -155,11 +153,10 @@ function PlacementsDemo() {
<PreviewCardTrigger href="#preview-card-placement" className={triggerButtonClassName}>
Hover me
</PreviewCardTrigger>
- <PreviewCardContent placement={placement} className="w-56 p-3">
+ <PreviewCardContent side={position.side} align={position.align} className="w-56 p-3">
<div className="flex flex-col gap-1">
<div className="text-sm font-semibold text-text-primary">
- placement="
- {placement}"
+ {`side="${position.side}" align="${position.align}"`}
</div>
<div className="text-xs text-text-secondary">
Preview positions itself relative to the trigger.
diff --git a/packages/dify-ui/src/preview-card/index.tsx b/packages/dify-ui/src/preview-card/index.tsx
index 0641874df4d..0308651a09c 100644
--- a/packages/dify-ui/src/preview-card/index.tsx
+++ b/packages/dify-ui/src/preview-card/index.tsx
@@ -1,11 +1,9 @@
'use client'
import type * as React from 'react'
-import type { Placement } from '../internal/placement'
import { PreviewCard as BasePreviewCard } from '@base-ui/react/preview-card'
import { cn } from '../cn'
import { floatingPopupAnimationClassName, positionerClassName } from '../internal/overlay'
-import { parsePlacement } from '../internal/placement'
import { resolveClassName } from '../internal/resolve-class-name'
/**
@@ -36,25 +34,16 @@ type PreviewCardTriggerProps<Payload = unknown> = BasePreviewCard.Trigger.Props<
type PreviewCardPortalProps = BasePreviewCard.Portal.Props
type PreviewCardViewportProps = BasePreviewCard.Viewport.Props
-type PreviewCardPositionerProps = Omit<BasePreviewCard.Positioner.Props, 'side' | 'align'> & {
- placement?: Placement
-}
+type PreviewCardPositionerProps = BasePreviewCard.Positioner.Props
function PreviewCardPositioner({
className,
- placement = 'bottom',
sideOffset = 8,
- alignOffset = 0,
...props
}: PreviewCardPositionerProps) {
- const { side, align } = parsePlacement(placement)
-
return (
<BasePreviewCard.Positioner
- side={side}
- align={align}
sideOffset={sideOffset}
- alignOffset={alignOffset}
className={(state) => cn(positionerClassName, resolveClassName(className, state))}
{...props}
/>
@@ -73,22 +62,24 @@ function PreviewCardPopup({ className, ...props }: PreviewCardPopupProps) {
}
type PreviewCardContentProps = Omit<PreviewCardPopupProps, 'children'> &
- Pick<PreviewCardPositionerProps, 'alignOffset' | 'placement' | 'sideOffset'> & {
+ Pick<PreviewCardPositionerProps, 'alignOffset' | 'side' | 'align' | 'sideOffset'> & {
children: React.ReactNode
}
function PreviewCardContent({
children,
- placement = 'bottom',
- sideOffset = 8,
- alignOffset = 0,
+ side,
+ align,
+ sideOffset,
+ alignOffset,
className,
...props
}: PreviewCardContentProps) {
return (
<PreviewCardPortal>
<PreviewCardPositioner
- placement={placement}
+ side={side}
+ align={align}
sideOffset={sideOffset}
alignOffset={alignOffset}
>
diff --git a/packages/dify-ui/src/select/__tests__/index.spec.tsx b/packages/dify-ui/src/select/__tests__/index.spec.tsx
index f4e33d1f23a..3922896dbce 100644
--- a/packages/dify-ui/src/select/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/select/__tests__/index.spec.tsx
@@ -1,3 +1,8 @@
+import type {
+ SelectContentProps,
+ SelectProps,
+ SelectTriggerProps,
+} from '@langgenius/dify-ui/select'
import * as React from 'react'
import { page } from 'vite-plus/test/browser'
import { render } from 'vitest-browser-react'
@@ -43,9 +48,9 @@ const renderOpenSelect = ({
contentProps = {},
onValueChange,
}: {
- rootProps?: Record<string, unknown>
- triggerProps?: Record<string, unknown>
- contentProps?: Record<string, unknown>
+ rootProps?: SelectProps<string>
+ triggerProps?: SelectTriggerProps
+ contentProps?: Omit<SelectContentProps, 'children'>
onValueChange?: (value: string | null) => void
} = {}) => {
return renderWithSafeViewport(
@@ -319,7 +324,7 @@ describe('Select wrappers', () => {
await expect.element(screen.getByText('Popular cities')).toBeInTheDocument()
})
- it('should use positioning attributes when placement is not provided', async () => {
+ it('should use positioning attributes when side and align are not provided', async () => {
const screen = await renderOpenSelect()
await vi.waitFor(() => {
@@ -329,10 +334,11 @@ describe('Select wrappers', () => {
})
})
- it('should preserve positioning attributes when placement props are provided', async () => {
+ it('should preserve positioning attributes when positioning props are provided', async () => {
const screen = await renderOpenSelect({
contentProps: {
- placement: 'top-end',
+ side: 'top',
+ align: 'end',
sideOffset: 12,
alignOffset: 6,
},
diff --git a/packages/dify-ui/src/select/index.tsx b/packages/dify-ui/src/select/index.tsx
index c96a5749859..1e40d6166c4 100644
--- a/packages/dify-ui/src/select/index.tsx
+++ b/packages/dify-ui/src/select/index.tsx
@@ -3,7 +3,6 @@
import type { ComponentRenderFn, HTMLProps } from '@base-ui/react/types'
import type { VariantProps } from 'class-variance-authority'
import type * as React from 'react'
-import type { Placement } from '../internal/placement'
import { Select as BaseSelect } from '@base-ui/react/select'
import { cva } from 'class-variance-authority'
import { cn } from '../cn'
@@ -16,7 +15,6 @@ import {
floatingSeparatorClassName,
positionerClassName,
} from '../internal/overlay'
-import { parsePlacement } from '../internal/placement'
import { resolveClassName } from '../internal/resolve-class-name'
type SelectActions = BaseSelect.Root.Actions
@@ -156,26 +154,19 @@ function SelectSeparator({ className, ...props }: SelectSeparatorProps) {
const SelectPortal = BaseSelect.Portal
type SelectPortalProps = BaseSelect.Portal.Props
-type SelectPositionerProps = Omit<BaseSelect.Positioner.Props, 'side' | 'align'> & {
- placement?: Placement
-}
+type SelectPositionerProps = BaseSelect.Positioner.Props
function SelectPositioner({
- placement = 'bottom-start',
+ align = 'start',
sideOffset = 4,
- alignOffset = 0,
alignItemWithTrigger = false,
className,
...props
}: SelectPositionerProps) {
- const { side, align } = parsePlacement(placement)
-
return (
<BaseSelect.Positioner
- side={side}
align={align}
sideOffset={sideOffset}
- alignOffset={alignOffset}
alignItemWithTrigger={alignItemWithTrigger}
className={(state) => cn(positionerClassName, resolveClassName(className, state))}
{...props}
@@ -217,21 +208,22 @@ function SelectList({ className, ...props }: SelectListProps) {
}
type SelectContentProps = Omit<SelectPopupProps, 'children'> &
- Pick<SelectPositionerProps, 'alignOffset' | 'placement' | 'sideOffset'> & {
+ Pick<SelectPositionerProps, 'alignOffset' | 'side' | 'align' | 'sideOffset'> & {
children: React.ReactNode
}
function SelectContent({
children,
- placement = 'bottom-start',
- sideOffset = 4,
- alignOffset = 0,
+ side,
+ align,
+ sideOffset,
+ alignOffset,
className,
...props
}: SelectContentProps) {
return (
<SelectPortal>
- <SelectPositioner placement={placement} sideOffset={sideOffset} alignOffset={alignOffset}>
+ <SelectPositioner side={side} align={align} sideOffset={sideOffset} alignOffset={alignOffset}>
<SelectPopup className={className} {...props}>
<SelectList>{children}</SelectList>
</SelectPopup>
diff --git a/packages/dify-ui/src/tooltip/__tests__/index.spec.tsx b/packages/dify-ui/src/tooltip/__tests__/index.spec.tsx
index 242e81dfeff..ac31129a343 100644
--- a/packages/dify-ui/src/tooltip/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/tooltip/__tests__/index.spec.tsx
@@ -7,7 +7,7 @@ const renderWithSafeViewport = (ui: React.ReactNode) =>
describe('TooltipContent', () => {
describe('Placement and offsets', () => {
- it('should use default top placement when placement is not provided', async () => {
+ it('should use default top placement when side and align are not provided', async () => {
const screen = await renderWithSafeViewport(
<Tooltip open>
<TooltipTrigger aria-label="tooltip trigger">Trigger</TooltipTrigger>
@@ -19,11 +19,11 @@ describe('TooltipContent', () => {
await expect.element(screen.getByText('Tooltip body')).toHaveAttribute('data-align', 'center')
})
- it('should apply custom placement when placement props are provided', async () => {
+ it('should apply custom placement when positioning props are provided', async () => {
const screen = await renderWithSafeViewport(
<Tooltip open>
<TooltipTrigger aria-label="tooltip trigger">Trigger</TooltipTrigger>
- <TooltipContent placement="bottom-start" sideOffset={16} alignOffset={6}>
+ <TooltipContent side="bottom" align="start" sideOffset={16} alignOffset={6}>
Custom tooltip body
</TooltipContent>
</Tooltip>,
diff --git a/packages/dify-ui/src/tooltip/index.stories.tsx b/packages/dify-ui/src/tooltip/index.stories.tsx
index ec27c474d97..cefcf4ec640 100644
--- a/packages/dify-ui/src/tooltip/index.stories.tsx
+++ b/packages/dify-ui/src/tooltip/index.stories.tsx
@@ -22,7 +22,7 @@ const meta = {
docs: {
description: {
component:
- 'Compound tooltip built on Base UI Tooltip. Wrap the app in `TooltipProvider` so nested tooltips share open and close delays. Each tooltip pairs a `TooltipTrigger` with `TooltipContent` and supports placement and offsets.',
+ 'Compound tooltip built on Base UI Tooltip. Wrap the app in `TooltipProvider` so nested tooltips share open and close delays. Each tooltip pairs a `TooltipTrigger` with `TooltipContent`.',
},
},
},
@@ -89,45 +89,43 @@ export const KeyboardShortcut: Story = {
),
}
-type TooltipPlacement = NonNullable<TooltipContentProps['placement']>
-
-const PLACEMENTS: TooltipPlacement[] = [
- 'top-start',
- 'top',
- 'top-end',
- 'right-start',
- 'right',
- 'right-end',
- 'bottom-start',
- 'bottom',
- 'bottom-end',
- 'left-start',
- 'left',
- 'left-end',
- 'inline-start-start',
- 'inline-start',
- 'inline-start-end',
- 'inline-end-start',
- 'inline-end',
- 'inline-end-end',
-]
+const POSITIONS = [
+ { side: 'top', align: 'start' },
+ { side: 'top', align: 'center' },
+ { side: 'top', align: 'end' },
+ { side: 'right', align: 'start' },
+ { side: 'right', align: 'center' },
+ { side: 'right', align: 'end' },
+ { side: 'bottom', align: 'start' },
+ { side: 'bottom', align: 'center' },
+ { side: 'bottom', align: 'end' },
+ { side: 'left', align: 'start' },
+ { side: 'left', align: 'center' },
+ { side: 'left', align: 'end' },
+ { side: 'inline-start', align: 'start' },
+ { side: 'inline-start', align: 'center' },
+ { side: 'inline-start', align: 'end' },
+ { side: 'inline-end', align: 'start' },
+ { side: 'inline-end', align: 'center' },
+ { side: 'inline-end', align: 'end' },
+] satisfies Array<Pick<TooltipContentProps, 'side' | 'align'>>
function PlacementsDemo() {
- const [placement, setPlacement] = React.useState<TooltipPlacement>('top')
+ const [position, setPosition] = React.useState(POSITIONS[1]!)
return (
<div className="flex flex-col items-center gap-4 p-24">
<div className="grid grid-cols-3 gap-2 text-xs">
- {PLACEMENTS.map((value) => (
+ {POSITIONS.map((value) => (
<button
- key={value}
+ key={`${value.side}-${value.align}`}
type="button"
- onClick={() => setPlacement(value)}
+ onClick={() => setPosition(value)}
className={`rounded-md border border-divider-subtle px-2 py-1 text-text-secondary focus-visible:ring-2 focus-visible:ring-state-accent-solid focus-visible:outline-hidden ${
- placement === value ? 'bg-state-base-hover' : 'bg-components-button-secondary-bg'
+ position === value ? 'bg-state-base-hover' : 'bg-components-button-secondary-bg'
}`}
>
- {value}
+ {value.side} / {value.align}
</button>
))}
</div>
@@ -139,7 +137,10 @@ function PlacementsDemo() {
</DifyIconButton>
}
/>
- <TooltipContent placement={placement}>{`placement="${placement}"`}</TooltipContent>
+ <TooltipContent
+ side={position.side}
+ align={position.align}
+ >{`side="${position.side}" align="${position.align}"`}</TooltipContent>
</Tooltip>
</div>
)
@@ -148,12 +149,6 @@ function PlacementsDemo() {
export const Placements: Story = {
parameters: {
layout: 'fullscreen',
- docs: {
- description: {
- story:
- 'Placement reference. `placement` accepts the 12 standard side/align combinations; Base UI flips automatically if the tooltip would overflow the viewport.',
- },
- },
},
render: () => <PlacementsDemo />,
}
diff --git a/packages/dify-ui/src/tooltip/index.tsx b/packages/dify-ui/src/tooltip/index.tsx
index 8ea6fbf536e..9140ad95b6a 100644
--- a/packages/dify-ui/src/tooltip/index.tsx
+++ b/packages/dify-ui/src/tooltip/index.tsx
@@ -1,11 +1,9 @@
'use client'
import type * as React from 'react'
-import type { Placement } from '../internal/placement'
import { Tooltip as BaseTooltip } from '@base-ui/react/tooltip'
import { cn } from '../cn'
import { hintPopupClassName, positionerClassName } from '../internal/overlay'
-import { parsePlacement } from '../internal/placement'
import { resolveClassName } from '../internal/resolve-class-name'
const TooltipProvider = BaseTooltip.Provider
@@ -21,21 +19,19 @@ type TooltipProps<Payload = unknown> = BaseTooltip.Root.Props<Payload>
type TooltipTriggerProps<Payload = unknown> = BaseTooltip.Trigger.Props<Payload>
type TooltipContentProps = Omit<BaseTooltip.Popup.Props, 'children'> &
- Pick<BaseTooltip.Positioner.Props, 'sideOffset' | 'alignOffset'> & {
+ Pick<BaseTooltip.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset'> & {
children: React.ReactNode
- placement?: Placement
}
function TooltipContent({
children,
- placement = 'top',
+ side,
+ align,
sideOffset = 8,
- alignOffset = 0,
+ alignOffset,
className,
...props
}: TooltipContentProps) {
- const { side, align } = parsePlacement(placement)
-
return (
<BaseTooltip.Portal>
<BaseTooltip.Positioner
diff --git a/web/app/account/(commonLayout)/avatar.tsx b/web/app/account/(commonLayout)/avatar.tsx
index 4fa8730bb86..c4c371f2a93 100644
--- a/web/app/account/(commonLayout)/avatar.tsx
+++ b/web/app/account/(commonLayout)/avatar.tsx
@@ -50,11 +50,7 @@ export default function AppSelector() {
<AvatarImage src={userProfile.avatar_url || undefined} alt="" />
</Avatar>
</DropdownMenuTrigger>
- <DropdownMenuContent
- placement="bottom-end"
- sideOffset={4}
- className="w-60 max-w-80 divide-y divide-divider-subtle bg-components-panel-bg-blur p-0"
- >
+ <DropdownMenuContent className="w-60 max-w-80 divide-y divide-divider-subtle bg-components-panel-bg-blur p-0">
<div className="p-1">
<div className="flex flex-nowrap items-center px-3 py-2">
<div className="min-w-0 grow">
diff --git a/web/app/components/access-rules-editor/add-access-subject-menu.tsx b/web/app/components/access-rules-editor/add-access-subject-menu.tsx
index 4b0facdd7e0..6e59eb2811a 100644
--- a/web/app/components/access-rules-editor/add-access-subject-menu.tsx
+++ b/web/app/components/access-rules-editor/add-access-subject-menu.tsx
@@ -154,7 +154,6 @@ function AddAccessSubjectMenu({
<span>{t(($) => $['operation.add'], { ns: 'common' })}</span>
</DropdownMenuTrigger>
<DropdownMenuContent
- placement="bottom-end"
sideOffset={8}
aria-label={t(($) => $['accessRule.addMembersTitle'], { ns: 'permission' })}
className="w-86 max-w-[calc(100vw-32px)]"
diff --git a/web/app/components/api-key/dataset-scope-dialog.tsx b/web/app/components/api-key/dataset-scope-dialog.tsx
index 338dd872cfd..50201b615f0 100644
--- a/web/app/components/api-key/dataset-scope-dialog.tsx
+++ b/web/app/components/api-key/dataset-scope-dialog.tsx
@@ -388,7 +388,7 @@ function DatasetScopeContent({
{addLabel}
</ComboboxTrigger>
<ComboboxPortal>
- <ComboboxPositioner placement="bottom">
+ <ComboboxPositioner align="center">
<ComboboxPopup
aria-label={searchLabel}
className="w-[min(20rem,var(--available-width))]"
diff --git a/web/app/components/app-sidebar/app-detail-top.tsx b/web/app/components/app-sidebar/app-detail-top.tsx
index b91824a2f53..c78818f21f3 100644
--- a/web/app/components/app-sidebar/app-detail-top.tsx
+++ b/web/app/components/app-sidebar/app-detail-top.tsx
@@ -90,7 +90,7 @@ export function AppDetailTop({ expand = true, onToggle }: AppDetailTopProps) {
/>
}
/>
- <TooltipContent placement="bottom" className="flex items-center gap-1">
+ <TooltipContent side="bottom" className="flex items-center gap-1">
<span className="px-0.5">{t(($) => $['gotoAnything.quickAction'], { ns: 'app' })}</span>
<KbdGroup>
{formatForDisplay(GOTO_ANYTHING_HOTKEY, { parts: true }).map((key) => (
diff --git a/web/app/components/app-sidebar/app-info/app-operations.tsx b/web/app/components/app-sidebar/app-info/app-operations.tsx
index b866e81b945..df6bff53cca 100644
--- a/web/app/components/app-sidebar/app-info/app-operations.tsx
+++ b/web/app/components/app-sidebar/app-info/app-operations.tsx
@@ -47,7 +47,7 @@ const AppOperations = ({ appName, operationGroups }: AppOperationsProps) => {
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="min-w-40">
+ <DropdownMenuContent className="min-w-40">
{visibleGroups.map((group, groupIndex) => (
<Fragment key={group.map((operation) => operation.id).join('-')}>
{groupIndex > 0 && <DropdownMenuSeparator />}
diff --git a/web/app/components/app-sidebar/dataset-detail-top.tsx b/web/app/components/app-sidebar/dataset-detail-top.tsx
index 950d6a81329..becd1caa7cf 100644
--- a/web/app/components/app-sidebar/dataset-detail-top.tsx
+++ b/web/app/components/app-sidebar/dataset-detail-top.tsx
@@ -91,7 +91,7 @@ export function DatasetDetailTop({ expand = true, onToggle }: DatasetDetailTopPr
/>
}
/>
- <TooltipContent placement="bottom" className="flex items-center gap-1">
+ <TooltipContent side="bottom" className="flex items-center gap-1">
<span className="px-0.5">{t(($) => $['gotoAnything.quickAction'], { ns: 'app' })}</span>
<KbdGroup>
{formatForDisplay(GOTO_ANYTHING_HOTKEY, { parts: true }).map((key) => (
diff --git a/web/app/components/app-sidebar/dataset-info/dropdown.tsx b/web/app/components/app-sidebar/dataset-info/dropdown.tsx
index 8e26f148fcc..edf0364bb9f 100644
--- a/web/app/components/app-sidebar/dataset-info/dropdown.tsx
+++ b/web/app/components/app-sidebar/dataset-info/dropdown.tsx
@@ -173,8 +173,8 @@ const DropDown = ({ expand, triggerClassName }: DropDownProps) => {
}
/>
<DropdownMenuContent
- placement={expand ? 'bottom-end' : 'right-start'}
- sideOffset={4}
+ side={expand ? 'bottom' : 'right'}
+ align={expand ? 'end' : 'start'}
className="w-50"
>
{datasetACLCapabilities.canEdit && (
diff --git a/web/app/components/app-sidebar/snippet-info/dropdown.tsx b/web/app/components/app-sidebar/snippet-info/dropdown.tsx
index 820dccc955a..61c99d8daa7 100644
--- a/web/app/components/app-sidebar/snippet-info/dropdown.tsx
+++ b/web/app/components/app-sidebar/snippet-info/dropdown.tsx
@@ -134,7 +134,7 @@ const SnippetInfoDropdown = ({ snippet }: SnippetInfoDropdownProps) => {
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-45 p-1">
+ <DropdownMenuContent className="w-45 p-1">
{canCreateAndModifySnippet && (
<>
<DropdownMenuItem className="mx-0 gap-2" onClick={handleOpenEditDialog}>
diff --git a/web/app/components/app/annotation/header-opts/index.tsx b/web/app/components/app/annotation/header-opts/index.tsx
index ed5e91206ec..b62ba5f92ea 100644
--- a/web/app/components/app/annotation/header-opts/index.tsx
+++ b/web/app/components/app/annotation/header-opts/index.tsx
@@ -95,7 +95,7 @@ const OperationsMenu: FC<OperationsMenuProps> = ({
/>
{t(($) => $['table.header.bulkExport'], { ns: 'appAnnotation' })}
</DropdownMenuSubTrigger>
- <DropdownMenuSubContent placement="left-start" sideOffset={4} className="min-w-25">
+ <DropdownMenuSubContent side="left" className="min-w-25">
<DropdownMenuItem
disabled={annotationUnavailable}
onClick={() => {
@@ -181,7 +181,7 @@ const HeaderOptions: FC<Props> = ({ appId, onAdd, onAdded, controlUpdateList })
>
<span aria-hidden className="i-ri-more-fill size-4" />
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-38.75">
+ <DropdownMenuContent className="w-38.75">
<OperationsMenu
list={list}
onBulkImport={handleShowBulkImportModal}
diff --git a/web/app/components/app/app-access-control/add-member-or-group-pop/index.tsx b/web/app/components/app/app-access-control/add-member-or-group-pop/index.tsx
index eb2f3d31657..dcc6c5ee04d 100644
--- a/web/app/components/app/app-access-control/add-member-or-group-pop/index.tsx
+++ b/web/app/components/app/app-access-control/add-member-or-group-pop/index.tsx
@@ -131,7 +131,7 @@ export default function AddMemberOrGroupDialog({
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
alignOffset={300}
className="relative w-100 overflow-hidden bg-components-panel-bg-blur p-0 backdrop-blur-[5px]"
onClick={(event) => event.stopPropagation()}
diff --git a/web/app/components/app/app-publisher/environment-tabs/index.tsx b/web/app/components/app/app-publisher/environment-tabs/index.tsx
index ad898950dae..3ba5ae27667 100644
--- a/web/app/components/app/app-publisher/environment-tabs/index.tsx
+++ b/web/app/components/app/app-publisher/environment-tabs/index.tsx
@@ -167,7 +167,7 @@ export function PublisherEnvironmentTabs({
</button>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-42 p-0">
+ <DropdownMenuContent className="w-42 p-0">
{overflowEnvironments.length > 0 && (
<DropdownMenuGroup className="p-1">
{overflowEnvironments.map((environment) => (
diff --git a/web/app/components/app/app-publisher/publish-with-multiple-model.tsx b/web/app/components/app/app-publisher/publish-with-multiple-model.tsx
index 3386fe7add3..0b5f8336c1a 100644
--- a/web/app/components/app/app-publisher/publish-with-multiple-model.tsx
+++ b/web/app/components/app/app-publisher/publish-with-multiple-model.tsx
@@ -76,7 +76,7 @@ const PublishWithMultipleModel: FC<PublishWithMultipleModelProps> = ({
<RiArrowDownSLine className="size-3" />
</>
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-[288px] p-1">
+ <DropdownMenuContent className="w-[288px] p-1">
<div className="flex h-5.5 items-center px-3 text-xs font-medium text-text-tertiary">
{t(($) => $.publishAs, { ns: 'appDebug' })}
</div>
diff --git a/web/app/components/app/app-publisher/publisher-content/index.tsx b/web/app/components/app/app-publisher/publisher-content/index.tsx
index 97200e34cad..3fe38823494 100644
--- a/web/app/components/app/app-publisher/publisher-content/index.tsx
+++ b/web/app/components/app/app-publisher/publisher-content/index.tsx
@@ -43,7 +43,7 @@ type PublisherContentProps = AppPublisherProps & {
export function PublisherContent({
appDetail,
canViewAccessPoint,
- crossAxisOffset = 0,
+ alignOffset,
debugWithMultipleModel = false,
disabled = false,
draftUpdatedAt,
@@ -233,7 +233,7 @@ export function PublisherContent({
onPublishToMarketplace: marketplace.publish,
},
}}
- crossAxisOffset={crossAxisOffset}
+ alignOffset={alignOffset}
disabled={disabled}
environmentPublisher={{
appId: appDetail.id,
diff --git a/web/app/components/app/app-publisher/publisher-content/publisher-panel/index.tsx b/web/app/components/app/app-publisher/publisher-content/publisher-panel/index.tsx
index 3d82fbe2f58..40686637037 100644
--- a/web/app/components/app/app-publisher/publisher-content/publisher-panel/index.tsx
+++ b/web/app/components/app/app-publisher/publisher-content/publisher-panel/index.tsx
@@ -9,7 +9,7 @@ import { WorkflowLaunchDialog } from '@/app/components/app/overview/workflow-lau
import { BuiltInPublisher } from '../../built-in-publisher'
import { PublisherEnvironmentFlow } from '../../environment-deployment-flow'
-type PublisherPanelProps = Pick<AppPublisherProps, 'crossAxisOffset' | 'disabled'> & {
+type PublisherPanelProps = Pick<AppPublisherProps, 'alignOffset' | 'disabled'> & {
builtInPublisher: Omit<ComponentProps<typeof BuiltInPublisher>, 'keyboardTarget'>
environmentPublisher: Omit<
ComponentProps<typeof PublisherEnvironmentFlow>,
@@ -24,7 +24,7 @@ type PublisherPanelProps = Pick<AppPublisherProps, 'crossAxisOffset' | 'disabled
export function PublisherPanel({
builtInPublisher,
- crossAxisOffset = 0,
+ alignOffset,
disabled = false,
environmentPublisher,
environmentPublisherKey,
@@ -60,9 +60,9 @@ export function PublisherPanel({
/>
<PopoverContent
ref={popupRef}
- placement="bottom-end"
+ align="end"
sideOffset={4}
- alignOffset={crossAxisOffset}
+ alignOffset={alignOffset}
className="border-none bg-transparent shadow-none"
>
<div className="flex max-h-[calc(100dvh-32px)] w-88 flex-col overflow-hidden rounded-2xl border-[0.5px] border-components-panel-border bg-components-panel-bg shadow-xl shadow-shadow-shadow-5">
diff --git a/web/app/components/app/app-publisher/types.ts b/web/app/components/app/app-publisher/types.ts
index 12c29893b18..30215c48bad 100644
--- a/web/app/components/app/app-publisher/types.ts
+++ b/web/app/components/app/app-publisher/types.ts
@@ -1,3 +1,4 @@
+import type { PopoverContentProps } from '@langgenius/dify-ui/popover'
import type { ModelAndParameter } from '../configuration/debug/types'
import type { WorkflowToolOutputVariable } from '@/app/components/tools/types'
import type { InputVar } from '@/app/components/workflow/types'
@@ -18,7 +19,7 @@ type AppPublisherPublishHandler =
type AppPublisherRestoreHandler = () => Promise<unknown> | unknown
-export type AppPublisherProps = {
+export type AppPublisherProps = Pick<PopoverContentProps, 'alignOffset'> & {
appId: string
disabled?: boolean
publishDisabled?: boolean
@@ -31,7 +32,6 @@ export type AppPublisherProps = {
onPublish?: AppPublisherPublishHandler
onRestore?: AppPublisherRestoreHandler
onToggle?: (state: boolean) => void
- crossAxisOffset?: number
toolPublished?: boolean
inputs?: InputVar[]
outputs?: WorkflowToolOutputVariable[]
diff --git a/web/app/components/app/configuration/config-var/config-modal/type-select.tsx b/web/app/components/app/configuration/config-var/config-modal/type-select.tsx
index 9012c4eef79..b4d529a75b7 100644
--- a/web/app/components/app/configuration/config-var/config-modal/type-select.tsx
+++ b/web/app/components/app/configuration/config-var/config-modal/type-select.tsx
@@ -88,7 +88,7 @@ const TypeSelector: FC<Props> = ({
</div>
</SelectTrigger>
<SelectPortal>
- <SelectPositioner sideOffset={4}>
+ <SelectPositioner>
<SelectPopup
className={cn(
'w-(--anchor-width) rounded-md px-1 py-1 text-base sm:text-sm',
diff --git a/web/app/components/app/configuration/config-var/select-var-type.tsx b/web/app/components/app/configuration/config-var/select-var-type.tsx
index 46d0c462e86..080948ae6a3 100644
--- a/web/app/components/app/configuration/config-var/select-var-type.tsx
+++ b/web/app/components/app/configuration/config-var/select-var-type.tsx
@@ -52,7 +52,6 @@ const SelectVarType: FC<Props> = ({ onChange }) => {
<DropdownMenu>
<DropdownMenuTrigger render={<OperationButton operation="add" />} />
<DropdownMenuContent
- placement="bottom-end"
sideOffset={8}
alignOffset={-2}
className="min-w-48 rounded-lg border bg-components-panel-bg-blur p-0 backdrop-blur-xs"
diff --git a/web/app/components/app/configuration/config-vision/param-config.tsx b/web/app/components/app/configuration/config-vision/param-config.tsx
index cf1218bfc17..6a1a0ca2a38 100644
--- a/web/app/components/app/configuration/config-vision/param-config.tsx
+++ b/web/app/components/app/configuration/config-vision/param-config.tsx
@@ -20,11 +20,7 @@ const ParamsConfig: FC = () => {
</Button>
}
/>
- <PopoverContent
- placement="bottom-end"
- sideOffset={4}
- className="border-none bg-transparent shadow-none"
- >
+ <PopoverContent align="end" sideOffset={4} className="border-none bg-transparent shadow-none">
<div className="w-80 rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg p-4 shadow-lg sm:w-103">
<PopoverTitle className="text-base/6 font-semibold text-text-primary">
{t(($) => $['vision.visionSettings.title'], { ns: 'fileUpload' })}
diff --git a/web/app/components/app/configuration/config/automatic/version-selector.tsx b/web/app/components/app/configuration/config/automatic/version-selector.tsx
index bc075ceade3..205004bbab5 100644
--- a/web/app/components/app/configuration/config/automatic/version-selector.tsx
+++ b/web/app/components/app/configuration/config/automatic/version-selector.tsx
@@ -39,12 +39,7 @@ function VersionSelector({ versionLen, value, onChange }: VersionSelectorProps)
</div>
{moreThanOneVersion && <RiArrowDownSLine className="size-3" />}
</DropdownMenuTrigger>
- <DropdownMenuContent
- placement="bottom-start"
- sideOffset={4}
- alignOffset={-12}
- className="w-52 p-1"
- >
+ <DropdownMenuContent align="start" alignOffset={-12} className="w-52 p-1">
<DropdownMenuRadioGroup
value={value}
onValueChange={(nextValue) => {
diff --git a/web/app/components/app/configuration/configuration-view/legacy-agent-badge.tsx b/web/app/components/app/configuration/configuration-view/legacy-agent-badge.tsx
index 27ccddc906a..eb66ae704fa 100644
--- a/web/app/components/app/configuration/configuration-view/legacy-agent-badge.tsx
+++ b/web/app/components/app/configuration/configuration-view/legacy-agent-badge.tsx
@@ -21,7 +21,7 @@ export function LegacyAgentBadge() {
{t(($) => $['legacyAgentBadge.label'], { ns: 'appDebug' })}
</PopoverTrigger>
<PopoverContent
- placement="bottom-start"
+ align="start"
sideOffset={6}
className="max-w-75 px-3 py-2 system-xs-regular text-text-tertiary"
>
diff --git a/web/app/components/app/configuration/dataset-config/context-var/var-picker.tsx b/web/app/components/app/configuration/dataset-config/context-var/var-picker.tsx
index f508da842ad..7c9e95b387e 100644
--- a/web/app/components/app/configuration/dataset-config/context-var/var-picker.tsx
+++ b/web/app/components/app/configuration/dataset-config/context-var/var-picker.tsx
@@ -77,8 +77,7 @@ const VarPicker: FC<Props> = ({
}
/>
<PopoverContent
- placement="bottom-end"
- sideOffset={8}
+ align="end"
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
>
{options.length > 0 ? (
diff --git a/web/app/components/app/configuration/debug/debug-with-multiple-model/debug-item.tsx b/web/app/components/app/configuration/debug/debug-with-multiple-model/debug-item.tsx
index f93ccd94d86..4f101bc8173 100644
--- a/web/app/components/app/configuration/debug/debug-with-multiple-model/debug-item.tsx
+++ b/web/app/components/app/configuration/debug/debug-with-multiple-model/debug-item.tsx
@@ -96,7 +96,7 @@ const DebugItem: FC<DebugItemProps> = ({ modelAndParameter, className, style })
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="min-w-40">
+ <DropdownMenuContent className="min-w-40">
{showDuplicate && (
<DropdownMenuItem className="system-md-regular" onClick={handleDuplicate}>
{t(($) => $.duplicateModel, { ns: 'appDebug' })}
diff --git a/web/app/components/app/create-app-dropdown.tsx b/web/app/components/app/create-app-dropdown.tsx
index 40ebc6d640e..49caa0e626c 100644
--- a/web/app/components/app/create-app-dropdown.tsx
+++ b/web/app/components/app/create-app-dropdown.tsx
@@ -54,8 +54,6 @@ export function CreateAppDropdown({
}
/>
<DropdownMenuContent
- placement="bottom-end"
- sideOffset={4}
{...getStepByStepTourDropdownMenuContentProps({
disableMotion: menu.controlled,
highlightPart: menu.controlled ? stepByStepTourHighlightPart : undefined,
diff --git a/web/app/components/app/deploy/environment-table/deploy-menu/index.tsx b/web/app/components/app/deploy/environment-table/deploy-menu/index.tsx
index 115d091d0f5..c204438e283 100644
--- a/web/app/components/app/deploy/environment-table/deploy-menu/index.tsx
+++ b/web/app/components/app/deploy/environment-table/deploy-menu/index.tsx
@@ -57,12 +57,7 @@ export function EnvironmentDeployMenu({
</Button>
}
/>
- <DropdownMenuContent
- aria-busy={isLoading || isRetrying}
- placement="bottom-end"
- sideOffset={4}
- className="w-42 p-1"
- >
+ <DropdownMenuContent aria-busy={isLoading || isRetrying} className="w-42 p-1">
<DropdownMenuGroup>
<DropdownMenuGroupLabel className="px-2 py-1">
{t(($) => $['card.notDeployed'])}
diff --git a/web/app/components/app/deploy/environment-table/row-actions.tsx b/web/app/components/app/deploy/environment-table/row-actions.tsx
index 8a10a56721c..69ead5a16c7 100644
--- a/web/app/components/app/deploy/environment-table/row-actions.tsx
+++ b/web/app/components/app/deploy/environment-table/row-actions.tsx
@@ -159,7 +159,7 @@ export function EnvironmentRowActions({
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-50">
+ <DropdownMenuContent className="w-50">
{moreActions.map((action, index) => (
<Fragment key={action.kind}>
{action.kind === 'undeploy' && index > 0 && <DropdownMenuSeparator />}
diff --git a/web/app/components/app/deploy/shared/deployment-configuration/environment-variable-field.tsx b/web/app/components/app/deploy/shared/deployment-configuration/environment-variable-field.tsx
index 0fe106e3919..8606a55df7d 100644
--- a/web/app/components/app/deploy/shared/deployment-configuration/environment-variable-field.tsx
+++ b/web/app/components/app/deploy/shared/deployment-configuration/environment-variable-field.tsx
@@ -190,7 +190,7 @@ export const EnvironmentVariableField = memo(
>
{sourceLabel}
</SelectTrigger>
- <SelectContent placement="bottom-end" className="w-52">
+ <SelectContent align="end" className="w-52">
{availableSources.map((option) => (
<SelectItem key={option} value={option}>
<SelectItemText>{sourceLabels[option]}</SelectItemText>
diff --git a/web/app/components/app/deploy/shared/deployment-configuration/workflow-source-popover.tsx b/web/app/components/app/deploy/shared/deployment-configuration/workflow-source-popover.tsx
index e410e37e6f6..23ab56632e9 100644
--- a/web/app/components/app/deploy/shared/deployment-configuration/workflow-source-popover.tsx
+++ b/web/app/components/app/deploy/shared/deployment-configuration/workflow-source-popover.tsx
@@ -62,7 +62,8 @@ function WorkflowPathLink({ path }: { path: WorkflowPath }) {
function WorkflowSourceContent({ paths, title }: { paths: WorkflowPath[]; title: string }) {
return (
<PopoverContent
- placement="top-end"
+ side="top"
+ align="end"
sideOffset={4}
className="w-max max-w-[min(30rem,calc(100vw-32px))] bg-components-panel-bg-blur p-1 shadow-lg backdrop-blur-[5px]"
>
diff --git a/web/app/components/app/deploy/shared/version-label.tsx b/web/app/components/app/deploy/shared/version-label.tsx
index bdad078a3ca..006f6926822 100644
--- a/web/app/components/app/deploy/shared/version-label.tsx
+++ b/web/app/components/app/deploy/shared/version-label.tsx
@@ -56,7 +56,7 @@ export function VersionLabel({
}
/>
<PopoverContent
- placement="top"
+ side="top"
className="w-74 max-w-[calc(100vw-32px)] border-0 bg-components-tooltip-bg px-4 py-3.5 text-start inset-ring-[0.5px] inset-ring-components-panel-border backdrop-blur-[5px]"
>
<div className="flex flex-col gap-1">
diff --git a/web/app/components/app/log/model-info.tsx b/web/app/components/app/log/model-info.tsx
index d49ab71baa5..28cc7f60103 100644
--- a/web/app/components/app/log/model-info.tsx
+++ b/web/app/components/app/log/model-info.tsx
@@ -70,7 +70,7 @@ const ModelInfo: FC<Props> = ({ model }) => {
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={4}
className="border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/app/tracing/configuration.tsx b/web/app/components/app/tracing/configuration.tsx
index b33e543085f..2e06d69d4a2 100644
--- a/web/app/components/app/tracing/configuration.tsx
+++ b/web/app/components/app/tracing/configuration.tsx
@@ -226,7 +226,7 @@ export function TracingConfiguration({ resource, readOnly }: TracingConfiguratio
)}
</PopoverTrigger>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={12}
className="border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/app/type-selector/index.tsx b/web/app/components/app/type-selector/index.tsx
index e097b141086..e821eb50e42 100644
--- a/web/app/components/app/type-selector/index.tsx
+++ b/web/app/components/app/type-selector/index.tsx
@@ -48,7 +48,7 @@ const AppTypeSelector = ({ value, onChange }: AppSelectorProps) => {
</button>
)}
<PopoverContent
- placement="bottom-start"
+ align="start"
sideOffset={4}
className="w-60 rounded-xl border border-components-panel-border bg-components-panel-bg-blur shadow-lg backdrop-blur-[5px]"
>
diff --git a/web/app/components/apps/app-card/interactions.tsx b/web/app/components/apps/app-card/interactions.tsx
index c6ff72ee9cc..9c8d67971ef 100644
--- a/web/app/components/apps/app-card/interactions.tsx
+++ b/web/app/components/apps/app-card/interactions.tsx
@@ -599,8 +599,6 @@ export function AppCardInteractions({
}
/>
<DropdownMenuContent
- placement="bottom-end"
- sideOffset={4}
{...getStepByStepTourDropdownMenuContentProps({
highlightPart: stepByStepTourActionMenuHighlightPart,
interactionMode: operationsMenu.controlled ? 'presentation' : 'interactive',
diff --git a/web/app/components/apps/creators-filter.tsx b/web/app/components/apps/creators-filter.tsx
index d94d78b6ed8..4fefcfb4b7d 100644
--- a/web/app/components/apps/creators-filter.tsx
+++ b/web/app/components/apps/creators-filter.tsx
@@ -167,7 +167,7 @@ const CreatorsFilter = ({ value, onChange }: CreatorsFilterProps) => {
)}
</div>
<ComboboxPortal>
- <ComboboxPositioner placement="bottom-start" sideOffset={4}>
+ <ComboboxPositioner>
<ComboboxPopup
aria-label={t(($) => $['studio.filters.creators'], { ns: 'app' })}
className="w-[min(280px,var(--available-width))] min-w-[min(var(--anchor-width),var(--available-width))] bg-components-panel-bg-blur text-sm text-text-secondary backdrop-blur-[5px]"
diff --git a/web/app/components/base/chat/chat-with-history/header/mobile-operation-dropdown.tsx b/web/app/components/base/chat/chat-with-history/header/mobile-operation-dropdown.tsx
index 29404d4b7a3..e1ac9d46e42 100644
--- a/web/app/components/base/chat/chat-with-history/header/mobile-operation-dropdown.tsx
+++ b/web/app/components/base/chat/chat-with-history/header/mobile-operation-dropdown.tsx
@@ -36,7 +36,7 @@ const MobileOperationDropdown = ({
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="min-w-40">
+ <DropdownMenuContent className="min-w-40">
<DropdownMenuItem
className="system-md-regular"
onClick={() => handleMenuAction(handleResetChat)}
diff --git a/web/app/components/base/chat/chat-with-history/header/operation.tsx b/web/app/components/base/chat/chat-with-history/header/operation.tsx
index fcb7045ee8d..fb92116d757 100644
--- a/web/app/components/base/chat/chat-with-history/header/operation.tsx
+++ b/web/app/components/base/chat/chat-with-history/header/operation.tsx
@@ -40,7 +40,7 @@ const Operation: FC<Props> = ({
<span className="system-md-semibold">{title}</span>
<span aria-hidden className="i-ri-arrow-down-s-line size-4" />
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-start" sideOffset={4} className="min-w-30">
+ <DropdownMenuContent align="start" className="min-w-30">
<DropdownMenuItem className="system-md-regular" onClick={togglePin}>
<span className="grow">
{isPinned
diff --git a/web/app/components/base/chat/chat-with-history/inputs-form/view-form-dropdown.tsx b/web/app/components/base/chat/chat-with-history/inputs-form/view-form-dropdown.tsx
index cb37c562d8c..d2e5a175541 100644
--- a/web/app/components/base/chat/chat-with-history/inputs-form/view-form-dropdown.tsx
+++ b/web/app/components/base/chat/chat-with-history/inputs-form/view-form-dropdown.tsx
@@ -19,7 +19,7 @@ const ViewFormDropdown = () => {
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={4}
alignOffset={4}
className="border-none bg-transparent shadow-none"
diff --git a/web/app/components/base/chat/chat-with-history/sidebar/index.tsx b/web/app/components/base/chat/chat-with-history/sidebar/index.tsx
index 1b4bd46d0b1..e3df3404352 100644
--- a/web/app/components/base/chat/chat-with-history/sidebar/index.tsx
+++ b/web/app/components/base/chat/chat-with-history/sidebar/index.tsx
@@ -162,7 +162,7 @@ const Sidebar = ({ isPanel, toggleButtonRef }: Props) => {
)}
</div>
<div className="flex shrink-0 items-center justify-between p-3">
- <MenuDropdown hideLogout={isInstalledApp} placement="top-start" data={appData?.site} />
+ <MenuDropdown hideLogout={isInstalledApp} side="top" align="start" data={appData?.site} />
{/* powered by */}
<div className="shrink-0">
{!appData?.custom_config?.remove_webapp_brand && (
diff --git a/web/app/components/base/chat/chat-with-history/sidebar/operation.tsx b/web/app/components/base/chat/chat-with-history/sidebar/operation.tsx
index b9194e3e7a0..f2a22812857 100644
--- a/web/app/components/base/chat/chat-with-history/sidebar/operation.tsx
+++ b/web/app/components/base/chat/chat-with-history/sidebar/operation.tsx
@@ -55,12 +55,7 @@ const Operation: FC<Props> = ({
}
onClick={(e) => e.stopPropagation()}
/>
- <DropdownMenuContent
- placement="bottom-end"
- sideOffset={4}
- className="min-w-30"
- onClick={(e) => e.stopPropagation()}
- >
+ <DropdownMenuContent className="min-w-30" onClick={(e) => e.stopPropagation()}>
<DropdownMenuItem
className="gap-2 px-2 system-md-regular"
onClick={(e) => {
diff --git a/web/app/components/base/chat/chat/citation/popup.tsx b/web/app/components/base/chat/chat/citation/popup.tsx
index dc6391e0457..9d9284c8ab0 100644
--- a/web/app/components/base/chat/chat/citation/popup.tsx
+++ b/web/app/components/base/chat/chat/citation/popup.tsx
@@ -148,8 +148,8 @@ const Popup: FC<PopupProps> = ({ data, showHitInfo = false }) => {
}
/>
<PopoverContent
- placement="top-start"
- sideOffset={8}
+ side="top"
+ align="start"
alignOffset={-2}
className="border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/base/chat/chat/citation/progress-tooltip.tsx b/web/app/components/base/chat/chat/citation/progress-tooltip.tsx
index 8fca1459771..2c116df7942 100644
--- a/web/app/components/base/chat/chat/citation/progress-tooltip.tsx
+++ b/web/app/components/base/chat/chat/citation/progress-tooltip.tsx
@@ -24,7 +24,7 @@ const ProgressTooltip: FC<ProgressTooltipProps> = ({ data }) => {
</div>
{data}
</TooltipTrigger>
- <TooltipContent data-testid="progress-tooltip-popup" placement="top-start">
+ <TooltipContent data-testid="progress-tooltip-popup" align="start">
{t(($) => $['chat.citation.hitScore'], { ns: 'common' })} {data}
</TooltipContent>
</Tooltip>
diff --git a/web/app/components/base/chat/chat/citation/tooltip.tsx b/web/app/components/base/chat/chat/citation/tooltip.tsx
index 17cf8dbbc0c..1802fe9fa63 100644
--- a/web/app/components/base/chat/chat/citation/tooltip.tsx
+++ b/web/app/components/base/chat/chat/citation/tooltip.tsx
@@ -18,7 +18,7 @@ const CitationTooltip: FC<CitationTooltipProps> = ({ data, text, icon }) => {
{icon}
{data}
</TooltipTrigger>
- <TooltipContent data-testid="tooltip-popup" placement="top-start">
+ <TooltipContent data-testid="tooltip-popup" align="start">
{text} {data}
</TooltipContent>
</Tooltip>
diff --git a/web/app/components/base/chat/embedded-chatbot/inputs-form/view-form-dropdown.tsx b/web/app/components/base/chat/embedded-chatbot/inputs-form/view-form-dropdown.tsx
index 24c7afff537..51e8ac1627f 100644
--- a/web/app/components/base/chat/embedded-chatbot/inputs-form/view-form-dropdown.tsx
+++ b/web/app/components/base/chat/embedded-chatbot/inputs-form/view-form-dropdown.tsx
@@ -28,7 +28,7 @@ const ViewFormDropdown = ({ iconColor }: Props) => {
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={4}
alignOffset={4}
className="border-none bg-transparent shadow-none"
diff --git a/web/app/components/base/chip/index.tsx b/web/app/components/base/chip/index.tsx
index ff1a450b152..5297becfc30 100644
--- a/web/app/components/base/chip/index.tsx
+++ b/web/app/components/base/chip/index.tsx
@@ -147,7 +147,7 @@ function Chip<T extends ItemValue>({
</button>
)}
<SelectPortal>
- <SelectPositioner placement="bottom-start" sideOffset={4}>
+ <SelectPositioner>
<SelectPopup
className={cn(
'relative w-60 rounded-xl border-[0.5px] bg-components-panel-bg-blur p-0 text-sm text-text-secondary shadow-lg outline-hidden backdrop-blur-[5px] focus:outline-hidden focus-visible:outline-hidden',
diff --git a/web/app/components/base/features/new-feature-panel/file-upload/setting-modal.tsx b/web/app/components/base/features/new-feature-panel/file-upload/setting-modal.tsx
index 86657dd6ae8..4b21676386e 100644
--- a/web/app/components/base/features/new-feature-panel/file-upload/setting-modal.tsx
+++ b/web/app/components/base/features/new-feature-panel/file-upload/setting-modal.tsx
@@ -31,7 +31,7 @@ const FileUploadSettings = ({
>
<PopoverTrigger disabled={disabled} render={children} />
<PopoverContent
- placement="left"
+ side="left"
sideOffset={32}
className="border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/base/features/new-feature-panel/text-to-speech/voice-settings.tsx b/web/app/components/base/features/new-feature-panel/text-to-speech/voice-settings.tsx
index 0eea347b05b..2a507d848dc 100644
--- a/web/app/components/base/features/new-feature-panel/text-to-speech/voice-settings.tsx
+++ b/web/app/components/base/features/new-feature-panel/text-to-speech/voice-settings.tsx
@@ -37,7 +37,7 @@ const VoiceSettings = ({
render={trigger ?? <div className="flex">{children}</div>}
/>
<PopoverContent
- placement={placementLeft ? 'left' : 'top'}
+ side={placementLeft ? 'left' : 'top'}
sideOffset={placementLeft ? 32 : 4}
className="border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/base/file-thumb/index.tsx b/web/app/components/base/file-thumb/index.tsx
index 62047ccf575..eae1ba9a829 100644
--- a/web/app/components/base/file-thumb/index.tsx
+++ b/web/app/components/base/file-thumb/index.tsx
@@ -76,7 +76,7 @@ const FileThumb = ({ file, size, className, onClick, onError }: FileThumbProps)
</button>
}
/>
- <TooltipContent placement="top">{name}</TooltipContent>
+ <TooltipContent>{name}</TooltipContent>
</Tooltip>
)
}
diff --git a/web/app/components/base/file-uploader/file-from-link-or-local/index.tsx b/web/app/components/base/file-uploader/file-from-link-or-local/index.tsx
index d009eeaeb2f..f99d862c195 100644
--- a/web/app/components/base/file-uploader/file-from-link-or-local/index.tsx
+++ b/web/app/components/base/file-uploader/file-from-link-or-local/index.tsx
@@ -50,11 +50,7 @@ const FileFromLinkOrLocal = ({
return (
<Popover>
<PopoverTrigger render={trigger} />
- <PopoverContent
- placement="top"
- sideOffset={4}
- className="border-none bg-transparent shadow-none"
- >
+ <PopoverContent side="top" sideOffset={4} className="border-none bg-transparent shadow-none">
<div className="w-70 rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur p-3 shadow-lg">
{showFromLink && (
<>
diff --git a/web/app/components/base/image-uploader/text-generation-image-uploader.tsx b/web/app/components/base/image-uploader/text-generation-image-uploader.tsx
index 62299a39e92..42ddd32433f 100644
--- a/web/app/components/base/image-uploader/text-generation-image-uploader.tsx
+++ b/web/app/components/base/image-uploader/text-generation-image-uploader.tsx
@@ -43,7 +43,8 @@ const PasteImageLinkButton: FC<PasteImageLinkButtonProps> = ({ onUpload, disable
}
/>
<PopoverContent
- placement="top-start"
+ side="top"
+ align="start"
sideOffset={0}
className="border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/base/prompt-editor/plugins/context-block/component.tsx b/web/app/components/base/prompt-editor/plugins/context-block/component.tsx
index 3254293f1fc..737db8985b9 100644
--- a/web/app/components/base/prompt-editor/plugins/context-block/component.tsx
+++ b/web/app/components/base/prompt-editor/plugins/context-block/component.tsx
@@ -63,7 +63,7 @@ const ContextBlockComponent: FC<ContextBlockComponentProps> = ({
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={3}
alignOffset={-147}
className="border-none bg-transparent shadow-none"
diff --git a/web/app/components/base/prompt-editor/plugins/history-block/component.tsx b/web/app/components/base/prompt-editor/plugins/history-block/component.tsx
index b3b047c486b..ba4d37b4951 100644
--- a/web/app/components/base/prompt-editor/plugins/history-block/component.tsx
+++ b/web/app/components/base/prompt-editor/plugins/history-block/component.tsx
@@ -65,7 +65,8 @@ const HistoryBlockComponent: FC<HistoryBlockComponentProps> = ({
}
/>
<PopoverContent
- placement="top-end"
+ side="top"
+ align="end"
sideOffset={4}
alignOffset={-148}
className="border-none bg-transparent shadow-none"
diff --git a/web/app/components/base/qrcode/index.tsx b/web/app/components/base/qrcode/index.tsx
index 605d551237e..62cd61a2055 100644
--- a/web/app/components/base/qrcode/index.tsx
+++ b/web/app/components/base/qrcode/index.tsx
@@ -50,7 +50,7 @@ const ShareQRCode = ({ content, downloadLabel, scanLabel, triggerLabel }: Props)
</Tooltip>
<PopoverContent
ref={qrCodeRef}
- placement="bottom-end"
+ align="end"
className="flex w-58 flex-col items-center rounded-lg p-4 shadow-xs"
>
<PopoverTitle className="sr-only">{safeTooltipText}</PopoverTitle>
diff --git a/web/app/components/base/sort/index.tsx b/web/app/components/base/sort/index.tsx
index 23164a8e9cc..2bf03287432 100644
--- a/web/app/components/base/sort/index.tsx
+++ b/web/app/components/base/sort/index.tsx
@@ -57,11 +57,7 @@ export function Sort<const Field extends string | number>({
className="i-ri-arrow-down-s-line size-4 shrink-0 text-text-tertiary forced-colors:text-[ButtonText] forced-colors:forced-color-adjust-none"
/>
</DropdownMenuTrigger>
- <DropdownMenuContent
- placement="bottom-start"
- sideOffset={4}
- className="relative w-60 p-0"
- >
+ <DropdownMenuContent align="start" className="relative w-60 p-0">
<DropdownMenuRadioGroup<Field>
value={value.field}
onValueChange={(field) => onValueChange({ field, order: value.order })}
diff --git a/web/app/components/base/theme-selector.tsx b/web/app/components/base/theme-selector.tsx
index 53380205a3b..913bf1c47d5 100644
--- a/web/app/components/base/theme-selector.tsx
+++ b/web/app/components/base/theme-selector.tsx
@@ -48,7 +48,7 @@ export default function ThemeSelector() {
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={6} className="w-36">
+ <DropdownMenuContent sideOffset={6} className="w-36">
<DropdownMenuRadioGroup<Theme>
value={currentTheme}
onValueChange={(nextTheme) => setTheme(nextTheme)}
diff --git a/web/app/components/billing/pricing/plans/cloud-plan-item/list/item/infotip.tsx b/web/app/components/billing/pricing/plans/cloud-plan-item/list/item/infotip.tsx
index 08e26715510..53c5b470326 100644
--- a/web/app/components/billing/pricing/plans/cloud-plan-item/list/item/infotip.tsx
+++ b/web/app/components/billing/pricing/plans/cloud-plan-item/list/item/infotip.tsx
@@ -25,7 +25,8 @@ export function PlanFeatureInfotip({ label, content }: { label: string; content:
}
/>
<PopoverContent
- placement="top-end"
+ side="top"
+ align="end"
className="w-65 rounded-none border-0 bg-saas-dify-blue-static px-5 py-4.5 system-xs-regular text-text-primary-on-surface shadow-none"
>
<PopoverTitle className="sr-only">{label}</PopoverTitle>
diff --git a/web/app/components/datasets/common/document-picker/index.tsx b/web/app/components/datasets/common/document-picker/index.tsx
index 1e9ecacb049..bae2e4757cc 100644
--- a/web/app/components/datasets/common/document-picker/index.tsx
+++ b/web/app/components/datasets/common/document-picker/index.tsx
@@ -173,7 +173,7 @@ export function DocumentPicker({ datasetId, value, parentMode, onChange }: Props
</ComboboxValue>
</ComboboxTrigger>
<ComboboxPortal>
- <ComboboxPositioner placement="bottom-start" sideOffset={0}>
+ <ComboboxPositioner sideOffset={0}>
<ComboboxPopup
aria-label={t(($) => $['operation.search'], { ns: 'common' })}
className="w-90 rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur shadow-lg backdrop-blur-[5px]"
diff --git a/web/app/components/datasets/common/document-picker/preview-document-picker.tsx b/web/app/components/datasets/common/document-picker/preview-document-picker.tsx
index c49a994d814..d5a4c0fc6d5 100644
--- a/web/app/components/datasets/common/document-picker/preview-document-picker.tsx
+++ b/web/app/components/datasets/common/document-picker/preview-document-picker.tsx
@@ -61,7 +61,7 @@ const PreviewDocumentPicker: FC<Props> = ({ className, value, files, onChange })
}
/>
<PopoverContent
- placement="bottom-start"
+ align="start"
sideOffset={4}
className="border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/datasets/create-from-pipeline/list/template-card/actions.tsx b/web/app/components/datasets/create-from-pipeline/list/template-card/actions.tsx
index a113bdfb000..40e9fbe0d88 100644
--- a/web/app/components/datasets/create-from-pipeline/list/template-card/actions.tsx
+++ b/web/app/components/datasets/create-from-pipeline/list/template-card/actions.tsx
@@ -54,7 +54,7 @@ const Actions = ({
>
<span aria-hidden className="i-ri-more-fill size-4 text-text-tertiary" />
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="min-w-40">
+ <DropdownMenuContent className="min-w-40">
<DropdownMenuItem
onClick={() => {
openEditModal()
diff --git a/web/app/components/datasets/create/step-two/language-select/index.tsx b/web/app/components/datasets/create/step-two/language-select/index.tsx
index 1e488d932d6..7b8b6bf2256 100644
--- a/web/app/components/datasets/create/step-two/language-select/index.tsx
+++ b/web/app/components/datasets/create/step-two/language-select/index.tsx
@@ -41,7 +41,7 @@ const LanguageSelect: FC<ILanguageSelectProps> = ({ currentLanguage, onSelect, d
>
<SelectValue placeholder={<span>&nbsp;</span>} />
</SelectTrigger>
- <SelectContent placement="bottom-start" sideOffset={4} className="w-max">
+ <SelectContent className="w-max">
{supportedLanguages.map(({ prompt_name }) => (
<SelectItem key={prompt_name} value={prompt_name}>
<SelectItemText>{prompt_name}</SelectItemText>
diff --git a/web/app/components/datasets/creator-filter.tsx b/web/app/components/datasets/creator-filter.tsx
index bcec3ed8583..a61d59bc3f7 100644
--- a/web/app/components/datasets/creator-filter.tsx
+++ b/web/app/components/datasets/creator-filter.tsx
@@ -135,7 +135,7 @@ export function CreatorFilter({ value, onChange }: CreatorFilterProps) {
)}
</div>
<ComboboxPortal>
- <ComboboxPositioner placement="bottom-start" sideOffset={4}>
+ <ComboboxPositioner>
<ComboboxPopup
aria-label={label}
className="w-[min(17.5rem,var(--available-width))] min-w-[min(var(--anchor-width),var(--available-width))]"
diff --git a/web/app/components/datasets/documents/components/operations.tsx b/web/app/components/datasets/documents/components/operations.tsx
index 55ec7a075a0..cc164a14559 100644
--- a/web/app/components/datasets/documents/components/operations.tsx
+++ b/web/app/components/datasets/documents/components/operations.tsx
@@ -395,11 +395,7 @@ const Operations = ({
/>
</div>
</DropdownMenuTrigger>
- <DropdownMenuContent
- placement="bottom-end"
- sideOffset={4}
- className={cn('w-50', className)}
- >
+ <DropdownMenuContent className={cn('w-50', className)}>
{canShowPrimarySection && (
<>
{canShowRenameAction && (
diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/base/credential-selector/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/base/credential-selector/index.tsx
index 24a3b23d8f5..a71744ffa98 100644
--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/base/credential-selector/index.tsx
+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/base/credential-selector/index.tsx
@@ -50,7 +50,7 @@ const CredentialSelector = ({
)}
/>
<PopoverContent
- placement="bottom-start"
+ align="start"
sideOffset={4}
className="border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/dropdown/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/dropdown/index.tsx
index ec9c8076e24..f21ee9d17e1 100644
--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/dropdown/index.tsx
+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/dropdown/index.tsx
@@ -32,7 +32,7 @@ const Dropdown = ({ startIndex, breadcrumbs, onBreadcrumbClick }: DropdownProps)
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-start" className="w-34 px-1">
+ <DropdownMenuContent align="start" className="w-34 px-1">
{breadcrumbs.map((breadcrumb, index) => (
<DropdownMenuItem
key={breadcrumbs.slice(0, index + 1).join('/')}
diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/list/item.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/list/item.tsx
index 4649c801ac7..e83fdcd2eea 100644
--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/list/item.tsx
+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/list/item.tsx
@@ -89,7 +89,8 @@ const Item = ({
)}
</PopoverTrigger>
<PopoverContent
- placement="top-end"
+ side="top"
+ align="end"
className="px-3 py-2 system-xs-regular text-text-tertiary"
>
{disabledTip}
diff --git a/web/app/components/datasets/documents/detail/segment-add/index.tsx b/web/app/components/datasets/documents/detail/segment-add/index.tsx
index 21679ca38f7..80bb0b63e1d 100644
--- a/web/app/components/datasets/documents/detail/segment-add/index.tsx
+++ b/web/app/components/datasets/documents/detail/segment-add/index.tsx
@@ -152,7 +152,7 @@ export function SegmentAdd({
>
<span aria-hidden className={cn('i-ri-arrow-down-s-line size-4', textColor)} />
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="min-w-30">
+ <DropdownMenuContent className="min-w-30">
<DropdownMenuItem
className="system-md-regular"
onClick={() => openSegmentDialog(showBatchModal)}
diff --git a/web/app/components/datasets/external-api/external-api-modal/index.tsx b/web/app/components/datasets/external-api/external-api-modal/index.tsx
index e9fd49dca49..72cc12ee308 100644
--- a/web/app/components/datasets/external-api/external-api-modal/index.tsx
+++ b/web/app/components/datasets/external-api/external-api-modal/index.tsx
@@ -192,10 +192,7 @@ const AddExternalAPIModal: FC<AddExternalAPIModalProps> = ({
</button>
}
/>
- <PopoverContent
- placement="bottom"
- className="flex w-[320px] items-center self-stretch px-3 py-2"
- >
+ <PopoverContent className="flex w-[320px] items-center self-stretch px-3 py-2">
<div className="p-1">
<div className="flex items-start self-stretch pt-1 pr-3 pb-0.5 pl-2">
<div className="system-xs-medium-uppercase text-text-tertiary">{`${datasetBindings?.length} ${t(($) => $.editExternalAPITooltipTitle, { ns: 'dataset' })}`}</div>
diff --git a/web/app/components/datasets/extra-info/api-access/index.tsx b/web/app/components/datasets/extra-info/api-access/index.tsx
index 0821af1dd75..27c7621aa0f 100644
--- a/web/app/components/datasets/extra-info/api-access/index.tsx
+++ b/web/app/components/datasets/extra-info/api-access/index.tsx
@@ -54,7 +54,8 @@ const ApiAccess = ({ expand, apiEnabled }: ApiAccessProps) => {
)}
/>
<PopoverContent
- placement="top-start"
+ side="top"
+ align="start"
sideOffset={4}
alignOffset={-4}
className="border-none bg-transparent shadow-none"
diff --git a/web/app/components/datasets/extra-info/service-api/index.tsx b/web/app/components/datasets/extra-info/service-api/index.tsx
index abb1b905dfb..0a461fded93 100644
--- a/web/app/components/datasets/extra-info/service-api/index.tsx
+++ b/web/app/components/datasets/extra-info/service-api/index.tsx
@@ -50,7 +50,8 @@ export function ServiceApi({ apiBaseUrl, apiReferenceUrl }: ServiceApiProps) {
)}
/>
<PopoverContent
- placement="top-start"
+ side="top"
+ align="start"
sideOffset={4}
alignOffset={-4}
className="border-none bg-transparent shadow-none"
diff --git a/web/app/components/datasets/extra-info/statistics.tsx b/web/app/components/datasets/extra-info/statistics.tsx
index 079ca211f97..c3273dc6a74 100644
--- a/web/app/components/datasets/extra-info/statistics.tsx
+++ b/web/app/components/datasets/extra-info/statistics.tsx
@@ -51,7 +51,11 @@ const Statistics = ({ expand, documentCount, relatedApps }: StatisticsProps) =>
</button>
}
/>
- <PopoverContent placement="top-start" className="border-0 bg-transparent p-0 shadow-none">
+ <PopoverContent
+ side="top"
+ align="start"
+ className="border-0 bg-transparent p-0 shadow-none"
+ >
{hasRelatedApps ? (
<LinkedAppsPanel relatedApps={relatedApps.data} isMobile={!expand} />
) : (
diff --git a/web/app/components/datasets/list/dataset-card/components/operations-dropdown.tsx b/web/app/components/datasets/list/dataset-card/components/operations-dropdown.tsx
index b0caaeb7ac3..70b35d7d4fc 100644
--- a/web/app/components/datasets/list/dataset-card/components/operations-dropdown.tsx
+++ b/web/app/components/datasets/list/dataset-card/components/operations-dropdown.tsx
@@ -111,7 +111,6 @@ const OperationsDropdown = ({
<span aria-hidden className="i-ri-more-fill size-5 text-text-tertiary" />
</DropdownMenuTrigger>
<DropdownMenuContent
- placement="bottom-end"
{...getStepByStepTourDropdownMenuContentProps({
highlightPart: stepByStepTourHighlightPart,
interactionMode: operationsMenu.controlled ? 'presentation' : 'interactive',
diff --git a/web/app/components/datasets/list/header.tsx b/web/app/components/datasets/list/header.tsx
index 89923591ef7..8c0c72a6506 100644
--- a/web/app/components/datasets/list/header.tsx
+++ b/web/app/components/datasets/list/header.tsx
@@ -155,8 +155,6 @@ const DatasetListHeader = ({
}
/>
<DropdownMenuContent
- placement="bottom-end"
- sideOffset={4}
{...getStepByStepTourDropdownMenuContentProps({
disableMotion: createMenu.controlled,
highlightPart: createMenu.controlled
diff --git a/web/app/components/datasets/metadata/edit-metadata-batch/modal.tsx b/web/app/components/datasets/metadata/edit-metadata-batch/modal.tsx
index 65d31c25625..68d7664a340 100644
--- a/web/app/components/datasets/metadata/edit-metadata-batch/modal.tsx
+++ b/web/app/components/datasets/metadata/edit-metadata-batch/modal.tsx
@@ -181,7 +181,7 @@ const EditMetadataBatchModal: FC<Props> = ({
<div className="mt-3">
<DatasetMetadataPicker
datasetId={datasetId}
- placement="top-start"
+ side="top"
sideOffset={4}
alignOffset={0}
onCreateMetadata={handleAddMetaData}
diff --git a/web/app/components/datasets/metadata/metadata-dataset/create-metadata-modal.tsx b/web/app/components/datasets/metadata/metadata-dataset/create-metadata-modal.tsx
index 7ec38525f4b..680243b9729 100644
--- a/web/app/components/datasets/metadata/metadata-dataset/create-metadata-modal.tsx
+++ b/web/app/components/datasets/metadata/metadata-dataset/create-metadata-modal.tsx
@@ -29,7 +29,8 @@ export function CreateMetadataModal({
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger render={triggerElement} />
<PopoverContent
- placement="left-start"
+ side="left"
+ align="start"
sideOffset={popupLeft}
alignOffset={-38}
className="w-[320px]"
diff --git a/web/app/components/datasets/metadata/metadata-dataset/dataset-metadata-picker.tsx b/web/app/components/datasets/metadata/metadata-dataset/dataset-metadata-picker.tsx
index 65a2df81bc9..3d7fa86d13b 100644
--- a/web/app/components/datasets/metadata/metadata-dataset/dataset-metadata-picker.tsx
+++ b/web/app/components/datasets/metadata/metadata-dataset/dataset-metadata-picker.tsx
@@ -33,7 +33,7 @@ type PickerView = (typeof PickerView)[keyof typeof PickerView]
export type DatasetMetadataPickerProps = Pick<
PopoverContentProps,
- 'placement' | 'sideOffset' | 'alignOffset'
+ 'side' | 'align' | 'sideOffset' | 'alignOffset'
> & {
datasetId: string
onSelectMetadata: (metadata: MetadataItem) => void
@@ -51,7 +51,8 @@ function metadataFilter(metadata: MetadataItem, query: string) {
export function DatasetMetadataPicker({
datasetId,
- placement = 'left-start',
+ side = 'left',
+ align = 'start',
sideOffset = -38,
alignOffset = 4,
onSelectMetadata,
@@ -122,7 +123,8 @@ export function DatasetMetadataPicker({
}
/>
<PopoverContent
- placement={placement}
+ side={side}
+ align={align}
sideOffset={sideOffset}
alignOffset={alignOffset}
className="w-[320px] bg-components-panel-bg-blur backdrop-blur-[5px]"
diff --git a/web/app/components/datasets/settings/permission-selector/index.tsx b/web/app/components/datasets/settings/permission-selector/index.tsx
index 4668e70698c..5995a4d54bb 100644
--- a/web/app/components/datasets/settings/permission-selector/index.tsx
+++ b/web/app/components/datasets/settings/permission-selector/index.tsx
@@ -190,7 +190,7 @@ const PermissionSelector = ({
/>
</PopoverTrigger>
<PopoverContent
- placement="bottom-start"
+ align="start"
sideOffset={4}
className="max-w-(--available-width) border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/detail-sidebar/toggle-button.tsx b/web/app/components/detail-sidebar/toggle-button.tsx
index b857892cd80..2d3728db4f8 100644
--- a/web/app/components/detail-sidebar/toggle-button.tsx
+++ b/web/app/components/detail-sidebar/toggle-button.tsx
@@ -40,7 +40,7 @@ export function DetailSidebarToggleButton({
</IconButton>
}
/>
- <TooltipContent placement="right" className="flex items-center gap-1">
+ <TooltipContent side="right" className="flex items-center gap-1">
<span className="px-0.5">{label}</span>
<KbdGroup>
{formatForDisplay(DETAIL_SIDEBAR_TOGGLE_HOTKEY, { parts: true }).map((key) => (
diff --git a/web/app/components/explore/item-operation/index.tsx b/web/app/components/explore/item-operation/index.tsx
index ca6e403c417..8cbe7771936 100644
--- a/web/app/components/explore/item-operation/index.tsx
+++ b/web/app/components/explore/item-operation/index.tsx
@@ -47,7 +47,7 @@ function ItemOperation({
className="i-ri-more-fill size-4 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 group-focus-visible/operation:opacity-100 group-data-popup-open/operation:opacity-100"
/>
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="min-w-30">
+ <DropdownMenuContent className="min-w-30">
<DropdownMenuItem
className={cn(s.actionItem, 'gap-2 px-3')}
onClick={(e) => {
diff --git a/web/app/components/header/account-dropdown/index.tsx b/web/app/components/header/account-dropdown/index.tsx
index e59d7005929..bf3b34b336d 100644
--- a/web/app/components/header/account-dropdown/index.tsx
+++ b/web/app/components/header/account-dropdown/index.tsx
@@ -84,11 +84,7 @@ function AppearanceSubmenu() {
label={t(($) => $['account.appearanceLabel'], { ns: 'accountSettings' })}
/>
</DropdownMenuSubTrigger>
- <DropdownMenuSubContent
- placement="right-start"
- sideOffset={6}
- className="max-h-90 w-34.75 px-1"
- >
+ <DropdownMenuSubContent side="right" sideOffset={6} className="max-h-90 w-34.75 px-1">
<DropdownMenuRadioGroup<Theme>
value={currentTheme}
onValueChange={(nextTheme) => setTheme(nextTheme)}
@@ -279,7 +275,8 @@ export default function AccountDropdown({ trigger }: AccountDropdownProps) {
})
return false
}}
- placement="top-start"
+ side="top"
+ align="start"
sideOffset={6}
alignOffset={4}
className={mainNavMenuPopupClassName}
diff --git a/web/app/components/header/account-setting/access-rules-page/access-rule-row-menu.tsx b/web/app/components/header/account-setting/access-rules-page/access-rule-row-menu.tsx
index 49b619b3c3d..4cf8068bb6a 100644
--- a/web/app/components/header/account-setting/access-rules-page/access-rule-row-menu.tsx
+++ b/web/app/components/header/account-setting/access-rules-page/access-rule-row-menu.tsx
@@ -88,7 +88,7 @@ const AccessRuleRowMenu = ({ rule, onView, onEdit }: AccessRuleRowMenuProps) =>
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="min-w-35">
+ <DropdownMenuContent className="min-w-35">
{isBuiltIn ? (
<DropdownMenuItem
className="system-sm-semibold text-text-secondary"
diff --git a/web/app/components/header/account-setting/api-based-extension-page/selector.tsx b/web/app/components/header/account-setting/api-based-extension-page/selector.tsx
index 7ab3465ea37..f24a9e349b6 100644
--- a/web/app/components/header/account-setting/api-based-extension-page/selector.tsx
+++ b/web/app/components/header/account-setting/api-based-extension-page/selector.tsx
@@ -88,11 +88,7 @@ export function ApiBasedExtensionSelector({ value, onChange }: ApiBasedExtension
)}
/>
<PopoverPortal>
- <PopoverPositioner
- placement="bottom-start"
- sideOffset={4}
- className="w-[calc(100%-32px)] max-w-xl"
- >
+ <PopoverPositioner align="start" sideOffset={4} className="w-[calc(100%-32px)] max-w-xl">
<PopoverPopup className="rounded-xl border-0 bg-transparent p-0 shadow-none backdrop-blur-none">
<div className="z-10 w-full rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg shadow-lg">
<div className="p-1">
diff --git a/web/app/components/header/account-setting/data-source-page-new/configure.tsx b/web/app/components/header/account-setting/data-source-page-new/configure.tsx
index 041450788ff..55f66c8369c 100644
--- a/web/app/components/header/account-setting/data-source-page-new/configure.tsx
+++ b/web/app/components/header/account-setting/data-source-page-new/configure.tsx
@@ -66,7 +66,7 @@ const Configure = ({ item, pluginPayload, onUpdate, disabled }: ConfigureProps)
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={4}
alignOffset={-4}
className="border-none bg-transparent shadow-none"
diff --git a/web/app/components/header/account-setting/data-source-page-new/operator.tsx b/web/app/components/header/account-setting/data-source-page-new/operator.tsx
index 7f36e698902..dd5cb600774 100644
--- a/web/app/components/header/account-setting/data-source-page-new/operator.tsx
+++ b/web/app/components/header/account-setting/data-source-page-new/operator.tsx
@@ -59,7 +59,7 @@ const Operator = ({
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="min-w-50">
+ <DropdownMenuContent className="min-w-50">
<DropdownMenuItem
disabled={!canUseCredential}
className="h-auto gap-2 py-2"
diff --git a/web/app/components/header/account-setting/data-source-page-new/plugin-actions.tsx b/web/app/components/header/account-setting/data-source-page-new/plugin-actions.tsx
index dd6d6b6e870..8c29e9267a7 100644
--- a/web/app/components/header/account-setting/data-source-page-new/plugin-actions.tsx
+++ b/web/app/components/header/account-setting/data-source-page-new/plugin-actions.tsx
@@ -160,7 +160,7 @@ const DataSourcePluginActions = ({ detail, onUpdate }: Props) => {
)}
<DropdownMenuContent
className="max-h-[min(16rem,var(--available-height))]"
- placement="bottom-start"
+ align="start"
aria-labelledby={versionMenuLabelId}
>
<DropdownMenuGroup>
diff --git a/web/app/components/header/account-setting/ip-policies-page/policy-item.tsx b/web/app/components/header/account-setting/ip-policies-page/policy-item.tsx
index e4ae3d909bf..46d90b1df61 100644
--- a/web/app/components/header/account-setting/ip-policies-page/policy-item.tsx
+++ b/web/app/components/header/account-setting/ip-policies-page/policy-item.tsx
@@ -145,7 +145,7 @@ export function PolicyItem({ group, canMutate, onView, onEdit }: PolicyItemProps
{t(($) => $['settings.ipPolicyMore'], { ns: 'common' })}
</TooltipContent>
</Tooltip>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="min-w-35">
+ <DropdownMenuContent className="min-w-35">
<DropdownMenuItem
disabled={!canMutate}
className="system-sm-semibold text-text-secondary"
diff --git a/web/app/components/header/account-setting/members-page/invited-modal/index.tsx b/web/app/components/header/account-setting/members-page/invited-modal/index.tsx
index 29da4a672ac..0cfad42394b 100644
--- a/web/app/components/header/account-setting/members-page/invited-modal/index.tsx
+++ b/web/app/components/header/account-setting/members-page/invited-modal/index.tsx
@@ -143,7 +143,7 @@ const InvitedModal = ({ invitationResults, onCancel }: IInvitedModalProps) => {
/>
</PopoverTrigger>
<PopoverContent
- placement="top"
+ side="top"
aria-labelledby={`${failedEmailId}-${index}`}
className="max-w-75 p-2 system-xs-medium wrap-break-word text-text-secondary"
>
diff --git a/web/app/components/header/account-setting/members-page/member-details-modal/permission-role-chip.tsx b/web/app/components/header/account-setting/members-page/member-details-modal/permission-role-chip.tsx
index 4ba06f6b19d..89efdf8fb3c 100644
--- a/web/app/components/header/account-setting/members-page/member-details-modal/permission-role-chip.tsx
+++ b/web/app/components/header/account-setting/members-page/member-details-modal/permission-role-chip.tsx
@@ -104,8 +104,7 @@ const PermissionRoleChip = ({
<Popover>
{chip}
<PopoverContent
- placement="bottom-start"
- sideOffset={8}
+ align="start"
className="overflow-hidden border-components-panel-border bg-components-tooltip-bg p-0 shadow-lg backdrop-blur-[5px]"
>
{permissionSummary}
diff --git a/web/app/components/header/account-setting/members-page/member-menu.tsx b/web/app/components/header/account-setting/members-page/member-menu.tsx
index f6b367965c4..c9b0a37ea3a 100644
--- a/web/app/components/header/account-setting/members-page/member-menu.tsx
+++ b/web/app/components/header/account-setting/members-page/member-menu.tsx
@@ -131,7 +131,7 @@ const MemberMenu = ({
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="min-w-45 rounded-xl">
+ <DropdownMenuContent className="min-w-45 rounded-xl">
{canAssignRoles && (
<DropdownMenuItem
className="system-sm-medium text-text-secondary"
diff --git a/web/app/components/header/account-setting/members-page/transfer-ownership-modal/member-selector.tsx b/web/app/components/header/account-setting/members-page/transfer-ownership-modal/member-selector.tsx
index 82df103d9d7..4a503dd3ec4 100644
--- a/web/app/components/header/account-setting/members-page/transfer-ownership-modal/member-selector.tsx
+++ b/web/app/components/header/account-setting/members-page/transfer-ownership-modal/member-selector.tsx
@@ -78,7 +78,6 @@ const MemberSelector: FC<Props> = ({ value, onSelect, exclude = [] }) => {
/>
</PopoverTrigger>
<PopoverContent
- placement="bottom"
sideOffset={4}
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
>
diff --git a/web/app/components/header/account-setting/model-provider-page/model-auth/add-credential-in-load-balancing.tsx b/web/app/components/header/account-setting/model-provider-page/model-auth/add-credential-in-load-balancing.tsx
index c569af6b6c3..d3deafd0932 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-auth/add-credential-in-load-balancing.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-auth/add-credential-in-load-balancing.tsx
@@ -102,7 +102,7 @@ const AddCredentialInLoadBalancing = ({
currentCustomConfigurationModelFixedFields={currentCustomConfigurationModelFixedFields}
onItemClick={onSelectCredential}
hideAddAction={!canCreateCredential}
- placement="bottom-start"
+ align="start"
popupTitle={
isCustomModel
? t(($) => $['modelProvider.auth.modelCredentials'], { ns: 'modelProvider' })
diff --git a/web/app/components/header/account-setting/model-provider-page/model-auth/add-custom-model.tsx b/web/app/components/header/account-setting/model-provider-page/model-auth/add-custom-model.tsx
index 70b44c13f2e..d74cc5270d4 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-auth/add-custom-model.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-auth/add-custom-model.tsx
@@ -112,7 +112,7 @@ const AddCustomModel = ({
)}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={4}
className="border-0 bg-transparent p-0 shadow-none backdrop-blur-none"
>
diff --git a/web/app/components/header/account-setting/model-provider-page/model-auth/authorized/index.tsx b/web/app/components/header/account-setting/model-provider-page/model-auth/authorized/index.tsx
index 75f9a106e0e..b779a2030e6 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-auth/authorized/index.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-auth/authorized/index.tsx
@@ -26,13 +26,7 @@ import { useCredentialPermissions } from '@/hooks/use-credential-permissions'
import { useAuth } from '../hooks'
import AuthorizedItem from './authorized-item'
-type PopoverOffsetOptions = {
- mainAxis?: number
- crossAxis?: number
- alignmentAxis?: number
-}
-
-type AuthorizedProps = Pick<PopoverContentProps, 'placement'> & {
+type AuthorizedProps = Pick<PopoverContentProps, 'side' | 'align'> & {
provider: ModelProvider
configurationMethod: ConfigurationMethodEnum
currentCustomConfigurationModelFixedFields?: CustomConfigurationModelFixedFields
@@ -52,7 +46,6 @@ type AuthorizedProps = Pick<PopoverContentProps, 'placement'> & {
renderTrigger: (open: boolean, props: ComponentPropsWithRef<'button'>) => ReactElement
isOpen?: boolean
onOpenChange?: (open: boolean) => void
- offset?: number | PopoverOffsetOptions
popupClassName?: string
showItemSelectedIcon?: boolean
onItemClick?: (credential: Credential, model?: CustomModel) => void
@@ -75,8 +68,8 @@ const Authorized = ({
renderTrigger,
isOpen,
onOpenChange,
- offset = 8,
- placement = 'bottom-end',
+ side,
+ align = 'end',
popupClassName,
showItemSelectedIcon,
onItemClick,
@@ -149,12 +142,6 @@ const Authorized = ({
[canUseCredential, handleActiveCredential, onItemClick, setMergedIsOpen, disableItemClick],
)
const notAllowCustomCredential = provider.allow_custom_token === false
- const resolvedOffset = typeof offset === 'number' ? undefined : offset
- const sideOffset = typeof offset === 'number' ? offset : (resolvedOffset?.mainAxis ?? 0)
- const alignOffset =
- typeof offset === 'number'
- ? 0
- : (resolvedOffset?.crossAxis ?? resolvedOffset?.alignmentAxis ?? 0)
const handleTriggerClick = useCallback(
(event: MouseEvent<HTMLElement>) => {
if (!triggerOnlyOpenModal) return
@@ -182,9 +169,8 @@ const Authorized = ({
onClick={handleTriggerClick}
/>
<PopoverContent
- placement={placement}
- sideOffset={sideOffset}
- alignOffset={alignOffset}
+ side={side}
+ align={align}
className="border-0 bg-transparent p-0 shadow-none backdrop-blur-none"
>
<div
diff --git a/web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx b/web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx
index 8678173617a..1311111b542 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx
@@ -546,7 +546,7 @@ function Form<
}
if (formSchema.type === FormTypeEnum.appSelector) {
- const { variable, label, required, scope } = formSchema as
+ const { variable, label, required } = formSchema as
| CredentialFormSchemaTextInput
| CredentialFormSchemaSecretInput
@@ -564,7 +564,6 @@ function Form<
</div>
<AppSelector
disabled={readonly}
- scope={scope}
value={value[variable]}
onSelect={(item) =>
handleFormChange(variable, { ...item, type: FormTypeEnum.appSelector })
diff --git a/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/index.tsx b/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/index.tsx
index 7e462e0b871..98d867236f2 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/index.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/index.tsx
@@ -31,7 +31,7 @@ import ParameterItem from './parameter-item'
import PresetsParameter from './presets-parameter'
import { getSupportedPresetConfig } from './presets-parameter-utils'
-export type ModelParameterModalProps = Pick<PopoverContentProps, 'placement'> & {
+export type ModelParameterModalProps = Pick<PopoverContentProps, 'side' | 'align'> & {
trigger?: ReactElement<ComponentPropsWithRef<'button'>>
triggerContainerClassName?: string
popupClassName?: string
@@ -69,7 +69,8 @@ const ModelParameterModal: FC<ModelParameterModalProps> = ({
triggerContainerClassName,
popupClassName,
modelSelectorPopupClassName,
- placement,
+ side,
+ align,
isAdvancedMode,
modelId,
provider,
@@ -195,7 +196,8 @@ const ModelParameterModal: FC<ModelParameterModalProps> = ({
</div>
)}
<PopoverContent
- placement={placement ?? (isInWorkflow ? 'left' : trigger ? 'bottom-end' : 'left-start')}
+ side={side ?? (isInWorkflow ? 'left' : trigger ? 'bottom' : 'left')}
+ align={align ?? (isInWorkflow ? 'center' : trigger ? 'end' : 'start')}
sideOffset={4}
className={cn(popupClassName, 'w-100 rounded-2xl')}
>
diff --git a/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/model-settings-trigger.tsx b/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/model-settings-trigger.tsx
index 6c56ededee8..831142060a5 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/model-settings-trigger.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/model-settings-trigger.tsx
@@ -34,7 +34,7 @@ function ModelSettingsTrigger({ disabled, surface = 'default' }: ModelSettingsTr
/>
}
/>
- <TooltipContent placement="top">{label}</TooltipContent>
+ <TooltipContent>{label}</TooltipContent>
</Tooltip>
)
}
diff --git a/web/app/components/header/account-setting/model-provider-page/model-selector/index.tsx b/web/app/components/header/account-setting/model-provider-page/model-selector/index.tsx
index dcd9c7e724f..2e2d35f59ed 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-selector/index.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-selector/index.tsx
@@ -191,10 +191,7 @@ function ModelSelectorRoot({
}
/>
<PopoverPortal>
- <PopoverPositioner
- placement="bottom-start"
- collisionAvoidance={MODEL_SELECTOR_COLLISION_AVOIDANCE}
- >
+ <PopoverPositioner align="start" collisionAvoidance={MODEL_SELECTOR_COLLISION_AVOIDANCE}>
<PopoverPopup
className={cn(
'flex max-h-[min(624px,var(--available-height,624px))] w-(--anchor-width) max-w-[min(28rem,var(--available-width))] flex-col overflow-hidden rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg shadow-lg',
diff --git a/web/app/components/header/account-setting/model-provider-page/model-selector/model-selector-trigger.tsx b/web/app/components/header/account-setting/model-provider-page/model-selector/model-selector-trigger.tsx
index 1ddf5f6742e..9bfb969ba50 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-selector/model-selector-trigger.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-selector/model-selector-trigger.tsx
@@ -272,9 +272,7 @@ function ModelSelectorTrigger({
</PopoverTrigger>
}
/>
- {triggerTooltipLabel && (
- <TooltipContent placement="top">{triggerTooltipLabel}</TooltipContent>
- )}
+ {triggerTooltipLabel && <TooltipContent>{triggerTooltipLabel}</TooltipContent>}
</Tooltip>
)
diff --git a/web/app/components/header/account-setting/model-provider-page/model-selector/popup-item.tsx b/web/app/components/header/account-setting/model-provider-page/model-selector/popup-item.tsx
index 4a9587b6d9c..64c7f234c02 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-selector/popup-item.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-selector/popup-item.tsx
@@ -194,7 +194,7 @@ function PopupItem({
</Button>
}
/>
- <PopoverContent placement="bottom-end">
+ <PopoverContent align="end">
<PopoverTitle className="sr-only">{providerLabel}</PopoverTitle>
{providerDetail && (
<DropdownContent
@@ -250,7 +250,7 @@ function PopupItem({
</span>
}
/>
- <TooltipContent placement="top">{suggestionTip}</TooltipContent>
+ <TooltipContent>{suggestionTip}</TooltipContent>
</Tooltip>
)}
</ModelName>
diff --git a/web/app/components/header/account-setting/model-provider-page/model-selector/popup.tsx b/web/app/components/header/account-setting/model-provider-page/model-selector/popup.tsx
index 5664a02b364..e9e07a06871 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-selector/popup.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-selector/popup.tsx
@@ -361,7 +361,7 @@ function ModelSelectorPreviewCard({
return (
<PreviewCardContent
- placement="right"
+ side="right"
className="w-51.5 bg-components-panel-bg-blur p-3 shadow-none backdrop-blur-xs"
>
<div className="flex flex-col gap-1">
diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-auth-dropdown/index.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-auth-dropdown/index.tsx
index 3437a8cd0f6..0d5f815fc7d 100644
--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-auth-dropdown/index.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-auth-dropdown/index.tsx
@@ -54,7 +54,7 @@ function ModelAuthDropdown({
</Button>
}
/>
- <PopoverContent placement="bottom-end">
+ <PopoverContent align="end">
<PopoverTitle className="sr-only">{buttonConfig.text}</PopoverTitle>
{currentProvider ? (
<DropdownContent
diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/provider-card-actions.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/provider-card-actions.tsx
index 576fb539187..2123fe0569b 100644
--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/provider-card-actions.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/provider-card-actions.tsx
@@ -254,7 +254,7 @@ function ProviderCardActions(props: Props) {
))}
<DropdownMenuContent
className="max-h-[min(16rem,var(--available-height))]"
- placement="bottom-start"
+ align="start"
aria-labelledby={versionMenuLabelId}
>
<DropdownMenuGroup>
@@ -338,7 +338,7 @@ function ProviderCardActions(props: Props) {
onCheckVersion={handleUpdate}
onRemove={() => setShowDeleteConfirm(true)}
detailUrl={detailUrl}
- placement="bottom-start"
+ align="start"
destructiveRemove
showCheckVersion={canUpdatePlugin}
showRemove={canDeletePlugin}
diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/quota-panel.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/quota-panel.tsx
index 4e4da9e85a4..8d26cbf91a2 100644
--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/quota-panel.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/quota-panel.tsx
@@ -60,7 +60,7 @@ const QuotaInfotip: FC<QuotaInfotipProps> = ({ tipText }) => {
/>
</PopoverTrigger>
<PopoverContent
- placement="top"
+ side="top"
className="max-w-75 rounded-md px-3 py-2 system-xs-regular text-text-tertiary"
>
{tipText}
diff --git a/web/app/components/header/account-setting/permissions-page/role-list/row-menu.tsx b/web/app/components/header/account-setting/permissions-page/role-list/row-menu.tsx
index 56b8a34e70b..dde29457f78 100644
--- a/web/app/components/header/account-setting/permissions-page/role-list/row-menu.tsx
+++ b/web/app/components/header/account-setting/permissions-page/role-list/row-menu.tsx
@@ -117,7 +117,7 @@ const RowMenu = ({ roleCategory, role, onView, onEdit }: RowMenuProps) => {
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="min-w-40">
+ <DropdownMenuContent className="min-w-40">
{hasViewAction && (
<DropdownMenuItem
className="system-sm-semibold text-text-secondary"
diff --git a/web/app/components/integrations/sidebar-actions.tsx b/web/app/components/integrations/sidebar-actions.tsx
index a29fbd85af8..ffc917223f1 100644
--- a/web/app/components/integrations/sidebar-actions.tsx
+++ b/web/app/components/integrations/sidebar-actions.tsx
@@ -26,7 +26,6 @@ type PermissionTooltipWrapperProps = {
children: ReactNode
className?: string
content: string
- placement: 'top' | 'bottom'
show: boolean
}
@@ -34,7 +33,6 @@ function PermissionTooltipWrapper({
children,
className,
content,
- placement,
show,
}: PermissionTooltipWrapperProps) {
const trigger = (
@@ -49,9 +47,7 @@ function PermissionTooltipWrapper({
return (
<Tooltip>
<TooltipTrigger render={trigger} />
- <TooltipContent placement={placement} sideOffset={8}>
- {content}
- </TooltipContent>
+ <TooltipContent side="bottom">{content}</TooltipContent>
</Tooltip>
)
}
@@ -98,7 +94,6 @@ function IntegrationSidebarInstallActions({
<PermissionTooltipWrapper
show={!canManagement}
content={permissionTooltip}
- placement="bottom"
className="min-w-0 flex-1"
>
<InstallPluginDropdown
@@ -113,7 +108,7 @@ function IntegrationSidebarInstallActions({
onSwitchToMarketplaceTab={onSwitchToMarketplace}
/>
</PermissionTooltipWrapper>
- <PluginTasks animatedSlot anchor={() => actionRowRef.current} placement="bottom-start" />
+ <PluginTasks animatedSlot anchor={() => actionRowRef.current} />
</div>
)
}
@@ -143,7 +138,6 @@ export function IntegrationSidebarUtilityActions({
<div className="flex w-46 shrink-0 flex-col gap-px pt-2 pb-2.5">
{canDebugger && (
<DebugInfo
- popupPlacement="top-start"
triggerVariant="ghost"
triggerClassName={sidebarUtilityActionClassName}
triggerContent={
@@ -169,7 +163,8 @@ export function IntegrationSidebarUtilityActions({
}
/>
<PopoverContent
- placement="top-start"
+ side="top"
+ align="start"
sideOffset={4}
className="border-0 bg-transparent p-0 shadow-none"
>
diff --git a/web/app/components/main-nav/components/help-menu.tsx b/web/app/components/main-nav/components/help-menu.tsx
index cf473c165c0..fbd6b3e4e57 100644
--- a/web/app/components/main-nav/components/help-menu.tsx
+++ b/web/app/components/main-nav/components/help-menu.tsx
@@ -181,7 +181,7 @@ const HelpMenu = ({ triggerIcon, triggerClassName, triggerRef, triggerSize }: He
}
/>
<DropdownMenuContent
- placement="top-end"
+ side="top"
sideOffset={8}
className="w-60 overflow-hidden bg-components-panel-bg-blur! p-0! backdrop-blur-[5px]"
>
diff --git a/web/app/components/main-nav/components/workspace-card.tsx b/web/app/components/main-nav/components/workspace-card.tsx
index 02bbc7b57ed..006b062711f 100644
--- a/web/app/components/main-nav/components/workspace-card.tsx
+++ b/web/app/components/main-nav/components/workspace-card.tsx
@@ -330,7 +330,7 @@ export function WorkspaceCard() {
onPlanClick={() => setPricing('open')}
/>
<PopoverContent
- placement="bottom-start"
+ align="start"
sideOffset={-workspaceMenuTriggerHeight}
alignOffset={workspaceMenuAlignOffset}
className="w-70 overflow-hidden bg-components-panel-bg-blur! p-0! backdrop-blur-[5px]"
diff --git a/web/app/components/main-nav/components/workspace-switcher.tsx b/web/app/components/main-nav/components/workspace-switcher.tsx
index b26c083c95b..d3269c62598 100644
--- a/web/app/components/main-nav/components/workspace-switcher.tsx
+++ b/web/app/components/main-nav/components/workspace-switcher.tsx
@@ -85,11 +85,7 @@ function WorkspaceSwitchControls({
</IconButton>
}
/>
- <DropdownMenuContent
- placement="bottom-end"
- sideOffset={4}
- className="w-40 bg-components-panel-bg-blur! p-1! backdrop-blur-[5px]"
- >
+ <DropdownMenuContent className="w-40 bg-components-panel-bg-blur! p-1! backdrop-blur-[5px]">
<DropdownMenuRadioGroup<WorkspaceSort> value={sort} onValueChange={onSortChange}>
{sortOptions.map((option) => (
<DropdownMenuRadioItem<WorkspaceSort>
diff --git a/web/app/components/plugins/base/key-value-item.tsx b/web/app/components/plugins/base/key-value-item.tsx
index 7d2fc5b954b..c0f42426937 100644
--- a/web/app/components/plugins/base/key-value-item.tsx
+++ b/web/app/components/plugins/base/key-value-item.tsx
@@ -81,7 +81,7 @@ function KeyValueItem({
</IconButton>
}
/>
- <TooltipContent placement="top">{tooltipLabel}</TooltipContent>
+ <TooltipContent>{tooltipLabel}</TooltipContent>
</Tooltip>
</div>
<span role="status" aria-atomic="true" className="sr-only">
diff --git a/web/app/components/plugins/marketplace/creator-profile/creator-content.tsx b/web/app/components/plugins/marketplace/creator-profile/creator-content.tsx
index 0cc10e7678d..697ead61cb4 100644
--- a/web/app/components/plugins/marketplace/creator-profile/creator-content.tsx
+++ b/web/app/components/plugins/marketplace/creator-profile/creator-content.tsx
@@ -172,11 +172,7 @@ export default function CreatorContent({
<span className="system-sm-medium text-text-secondary">{selectedSort.label}</span>
<span aria-hidden className="ml-1 i-ri-arrow-down-s-line size-4 text-text-tertiary" />
</DropdownMenuTrigger>
- <DropdownMenuContent
- placement="bottom-end"
- sideOffset={4}
- className="min-w-[176px] p-1"
- >
+ <DropdownMenuContent className="min-w-[176px] p-1">
<DropdownMenuRadioGroup<CreatorSortField>
value={sortField}
onValueChange={(nextField) => {
diff --git a/web/app/components/plugins/marketplace/home/catalog-languages-filter.tsx b/web/app/components/plugins/marketplace/home/catalog-languages-filter.tsx
index 3e6f3e38041..eb9a01fd3d2 100644
--- a/web/app/components/plugins/marketplace/home/catalog-languages-filter.tsx
+++ b/web/app/components/plugins/marketplace/home/catalog-languages-filter.tsx
@@ -122,7 +122,7 @@ export default function CatalogLanguagesFilter() {
)}
</div>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={4}
alignOffset={-6}
className="border-none bg-transparent shadow-none"
diff --git a/web/app/components/plugins/marketplace/sort-dropdown/index.tsx b/web/app/components/plugins/marketplace/sort-dropdown/index.tsx
index dfe428beecf..2512b363331 100644
--- a/web/app/components/plugins/marketplace/sort-dropdown/index.tsx
+++ b/web/app/components/plugins/marketplace/sort-dropdown/index.tsx
@@ -48,7 +48,7 @@ const SortDropdown = () => {
<span className="system-sm-medium text-text-primary">{selectedOption.text}</span>
<span aria-hidden className="i-ri-arrow-down-s-line size-4 text-text-tertiary" />
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-start" sideOffset={4} className="px-1">
+ <DropdownMenuContent align="start" className="px-1">
<DropdownMenuRadioGroup
value={`${selectedOption.value}-${selectedOption.order}`}
onValueChange={(nextValue) => {
diff --git a/web/app/components/plugins/plugin-auth/authorize/permission-selector.tsx b/web/app/components/plugins/plugin-auth/authorize/permission-selector.tsx
index eedf233355b..a439ebf3cd0 100644
--- a/web/app/components/plugins/plugin-auth/authorize/permission-selector.tsx
+++ b/web/app/components/plugins/plugin-auth/authorize/permission-selector.tsx
@@ -74,11 +74,7 @@ const PermissionSelector = ({ disabled, permission, onChange }: PermissionSelect
className="i-ri-arrow-down-s-line size-4 shrink-0 text-text-quaternary group-data-disabled/permission-trigger:text-components-input-text-placeholder! group-data-popup-open/permission-trigger:text-text-secondary"
/>
</DropdownMenuTrigger>
- <DropdownMenuContent
- placement="bottom-start"
- sideOffset={4}
- className="w-(--anchor-width) max-w-(--available-width)"
- >
+ <DropdownMenuContent align="start" className="w-(--anchor-width) max-w-(--available-width)">
<DropdownMenuRadioGroup<CredentialPermission>
value={permission}
onValueChange={onChange}
diff --git a/web/app/components/plugins/plugin-auth/authorized-in-node.tsx b/web/app/components/plugins/plugin-auth/authorized-in-node.tsx
index c22f75aecc2..7167c564950 100644
--- a/web/app/components/plugins/plugin-auth/authorized-in-node.tsx
+++ b/web/app/components/plugins/plugin-auth/authorized-in-node.tsx
@@ -136,7 +136,7 @@ const AuthorizedInNode = ({
isOpen={isOpen}
onOpenChange={setIsOpen}
sideOffset={4}
- placement="bottom-end"
+ align="end"
triggerPopupSameWidth={false}
popupClassName="w-[360px]"
disableSetDefault
diff --git a/web/app/components/plugins/plugin-auth/authorized/index.tsx b/web/app/components/plugins/plugin-auth/authorized/index.tsx
index b7b7fa21a12..923f173ec65 100644
--- a/web/app/components/plugins/plugin-auth/authorized/index.tsx
+++ b/web/app/components/plugins/plugin-auth/authorized/index.tsx
@@ -28,7 +28,7 @@ import {
import { CredentialTypeEnum } from '../types'
import Item from './item'
-type AuthorizedProps = Pick<PopoverContentProps, 'placement' | 'sideOffset'> & {
+type AuthorizedProps = Pick<PopoverContentProps, 'side' | 'align' | 'sideOffset'> & {
pluginPayload: PluginPayload
credentials: Credential[]
canOAuth?: boolean
@@ -54,8 +54,9 @@ const Authorized = ({
renderTrigger,
isOpen,
onOpenChange,
- sideOffset = 8,
- placement = 'bottom-start',
+ sideOffset,
+ side,
+ align = 'start',
triggerPopupSameWidth = true,
popupClassName,
disableSetDefault,
@@ -223,7 +224,8 @@ const Authorized = ({
/>
<PopoverContent
aria-label={t(($) => $['auth.authorizations'], { ns: 'plugin' })}
- placement={placement}
+ side={side}
+ align={align}
sideOffset={sideOffset}
className={cn(
'border-0 bg-transparent p-0 shadow-none backdrop-blur-none',
diff --git a/web/app/components/plugins/plugin-detail-panel/app-selector/app-picker.tsx b/web/app/components/plugins/plugin-detail-panel/app-selector/app-picker.tsx
index 0ba830899c1..6cd11801238 100644
--- a/web/app/components/plugins/plugin-detail-panel/app-selector/app-picker.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/app-selector/app-picker.tsx
@@ -1,7 +1,6 @@
'use client'
import type { AppPartial } from '@dify/contracts/api/console/apps/types.gen'
-import type { ComboboxPositionerProps } from '@langgenius/dify-ui/combobox'
import type { ReactNode } from 'react'
import { Button } from '@langgenius/dify-ui/button'
import {
@@ -29,11 +28,9 @@ import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import AppIcon from '@/app/components/base/app-icon'
-type AppPickerProps = Pick<ComboboxPositionerProps, 'placement'> & {
- scope?: string
+type AppPickerProps = {
disabled: boolean
trigger: ReactNode
- offset?: number
isShow: boolean
onShowChange: (isShow: boolean) => void
onSelect: (app: AppPartial) => void
@@ -90,8 +87,6 @@ function AppPickerOption({ app }: { app: AppPartial }) {
export function AppPicker({
disabled,
trigger,
- placement = 'right-start',
- offset = 0,
isShow,
onShowChange,
onSelect,
@@ -133,7 +128,7 @@ export function AppPicker({
{trigger}
</ComboboxTrigger>
<ComboboxPortal>
- <ComboboxPositioner placement={placement} sideOffset={offset}>
+ <ComboboxPositioner align="center">
<ComboboxPopup
aria-label={t(($) => $['appSelector.label'], { ns: 'app' })}
className="border-0 bg-transparent p-0 shadow-none backdrop-blur-none"
diff --git a/web/app/components/plugins/plugin-detail-panel/app-selector/index.tsx b/web/app/components/plugins/plugin-detail-panel/app-selector/index.tsx
index 21bc56b0afc..71889be5aef 100644
--- a/web/app/components/plugins/plugin-detail-panel/app-selector/index.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/app-selector/index.tsx
@@ -21,13 +21,11 @@ export type AppSelectorValue = {
type AppSelectorProps = {
value?: AppSelectorValue
- scope?: string
disabled?: boolean
- offset?: number
onSelect: (app: AppSelectorValue) => void
}
-export function AppSelector({ value, disabled, offset = 4, onSelect }: AppSelectorProps) {
+export function AppSelector({ value, disabled, onSelect }: AppSelectorProps) {
const { t } = useTranslation(['app'])
const [isShowChooseApp, setIsShowChooseApp] = useState(false)
const [searchText, setSearchText] = useState('')
@@ -131,7 +129,7 @@ export function AppSelector({ value, disabled, offset = 4, onSelect }: AppSelect
)}
/>
<PopoverContent
- sideOffset={offset}
+ sideOffset={4}
className="border-0 bg-transparent p-0 shadow-none backdrop-blur-none"
>
<div className="relative min-h-20 w-97.25 rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur shadow-lg backdrop-blur-xs">
@@ -140,8 +138,6 @@ export function AppSelector({ value, disabled, offset = 4, onSelect }: AppSelect
{t(($) => $['appSelector.label'], { ns: 'app' })}
</div>
<AppPicker
- placement="bottom"
- offset={offset}
trigger={<AppTrigger open={isShowChooseApp} appDetail={currentAppInfo} />}
isShow={isShowChooseApp}
onShowChange={setIsShowChooseApp}
diff --git a/web/app/components/plugins/plugin-detail-panel/detail-header/index.tsx b/web/app/components/plugins/plugin-detail-panel/detail-header/index.tsx
index 21c8fb0f7c5..a62a681ec01 100644
--- a/web/app/components/plugins/plugin-detail-panel/detail-header/index.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/detail-header/index.tsx
@@ -274,7 +274,7 @@ const DetailHeader = ({
)}
<DropdownMenuContent
className="max-h-[min(16rem,var(--available-height))]"
- placement="bottom-start"
+ align="start"
aria-labelledby={versionMenuLabelId}
>
<DropdownMenuGroup>
diff --git a/web/app/components/plugins/plugin-detail-panel/endpoint-card.tsx b/web/app/components/plugins/plugin-detail-panel/endpoint-card.tsx
index 14edd80270c..cbc7bacd60f 100644
--- a/web/app/components/plugins/plugin-detail-panel/endpoint-card.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/endpoint-card.tsx
@@ -176,7 +176,7 @@ const EndpointCard = ({ pluginDetail, data }: Props) => {
</IconButton>
}
/>
- <TooltipContent placement="top">{copyLabel}</TooltipContent>
+ <TooltipContent>{copyLabel}</TooltipContent>
</Tooltip>
</div>
</div>
diff --git a/web/app/components/plugins/plugin-detail-panel/endpoint-list.tsx b/web/app/components/plugins/plugin-detail-panel/endpoint-list.tsx
index 22a364a3727..53a590cd720 100644
--- a/web/app/components/plugins/plugin-detail-panel/endpoint-list.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/endpoint-list.tsx
@@ -68,7 +68,7 @@ const EndpointListContent = ({ declaration, detail }: EndpointListContentProps)
}
/>
<PopoverContent
- placement="right"
+ side="right"
className="w-60 rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur p-4"
>
<div className="flex flex-col gap-2">
diff --git a/web/app/components/plugins/plugin-detail-panel/model-selector/index.tsx b/web/app/components/plugins/plugin-detail-panel/model-selector/index.tsx
index 41c22c7c649..15e3d314ce6 100644
--- a/web/app/components/plugins/plugin-detail-panel/model-selector/index.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/model-selector/index.tsx
@@ -238,7 +238,8 @@ const ModelParameterModal: FC<ModelParameterModalProps> = ({
/>
</div>
<PopoverContent
- placement={isInWorkflow ? 'left' : 'bottom-end'}
+ side={isInWorkflow ? 'left' : 'bottom'}
+ align={isInWorkflow ? 'center' : 'end'}
sideOffset={4}
className={cn(popupClassName, 'w-97.25 rounded-2xl')}
>
diff --git a/web/app/components/plugins/plugin-detail-panel/operation-dropdown.tsx b/web/app/components/plugins/plugin-detail-panel/operation-dropdown.tsx
index bb7419ec725..f96834970a5 100644
--- a/web/app/components/plugins/plugin-detail-panel/operation-dropdown.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/operation-dropdown.tsx
@@ -16,7 +16,7 @@ import { systemFeaturesQueryOptions } from '@/features/system-features/client'
import { PluginSource } from '../types'
type OperationDropdownProps = Readonly<
- Pick<DropdownMenuContentProps, 'alignOffset' | 'placement' | 'sideOffset'> & {
+ Pick<DropdownMenuContentProps, 'side' | 'align'> & {
source: PluginSource
onInfo: () => void
onCheckVersion: () => void
@@ -39,9 +39,8 @@ export function OperationDropdown({
onCheckVersion,
onRemove,
onViewReadme,
- placement = 'bottom-end',
- sideOffset = 4,
- alignOffset = 0,
+ side,
+ align,
popupClassName,
triggerSize = 'm',
triggerAriaLabel,
@@ -85,12 +84,7 @@ export function OperationDropdown({
</IconButton>
}
/>
- <DropdownMenuContent
- placement={placement}
- sideOffset={sideOffset}
- alignOffset={alignOffset}
- className={cn('w-48 py-1', popupClassName)}
- >
+ <DropdownMenuContent side={side} align={align} className={cn('w-48 py-1', popupClassName)}>
{showInfo && (
<DropdownMenuItem
className="px-2 py-1 system-md-regular text-text-secondary"
diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/index.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/index.tsx
index 27d629d3e82..29da6e95a1d 100644
--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/index.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/index.tsx
@@ -370,7 +370,7 @@ export const CreateSubscriptionButton = ({
</Tooltip>
)}
</SelectTrigger>
- <SelectContent placement="bottom-start" sideOffset={4}>
+ <SelectContent>
{visibleOptions.map((option) => (
<SelectItem key={option.value} value={option.value}>
<div className="mr-8 flex grow items-center gap-1 truncate px-1">
diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/selector-entry.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/selector-entry.tsx
index 5781899ee36..87800292570 100644
--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/selector-entry.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/selector-entry.tsx
@@ -113,7 +113,7 @@ export const SubscriptionSelectorEntry = ({
)}
/>
<PopoverContent
- placement="bottom-start"
+ align="start"
sideOffset={4}
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
>
diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/subscription-card.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/subscription-card.tsx
index 6134069dffa..9283d433dd3 100644
--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/subscription-card.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/subscription-card.tsx
@@ -65,7 +65,7 @@ const SubscriptionCard = ({ data, pluginDetail }: Props) => {
{data.endpoint}
</PopoverTrigger>
<PopoverContent
- placement="left"
+ side="left"
className="max-w-[320px] px-3 py-2 system-xs-regular break-all text-text-tertiary"
>
{data.endpoint}
diff --git a/web/app/components/plugins/plugin-detail-panel/tool-selector/components/reasoning-config-form.tsx b/web/app/components/plugins/plugin-detail-panel/tool-selector/components/reasoning-config-form.tsx
index fbfdfd042c6..27a68bfbc36 100644
--- a/web/app/components/plugins/plugin-detail-panel/tool-selector/components/reasoning-config-form.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/tool-selector/components/reasoning-config-form.tsx
@@ -302,7 +302,6 @@ export function ReasoningConfigForm({
{isAppSelector && (
<AppSelector
disabled={false}
- scope={scope || 'all'}
value={(varInput?.value ?? varInput) as AppSelectorValue | undefined}
onSelect={handleAppChange(variable)}
/>
diff --git a/web/app/components/plugins/plugin-detail-panel/tool-selector/components/tool-base-form.tsx b/web/app/components/plugins/plugin-detail-panel/tool-selector/components/tool-base-form.tsx
index 6da7d53b7c2..c5359da1190 100644
--- a/web/app/components/plugins/plugin-detail-panel/tool-selector/components/tool-base-form.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/tool-selector/components/tool-base-form.tsx
@@ -59,7 +59,8 @@ export function ToolBaseForm({
)}
</div>
<ToolPicker
- placement="bottom"
+ side="bottom"
+ align="center"
sideOffset={4}
trigger={
<ToolTrigger
diff --git a/web/app/components/plugins/plugin-detail-panel/tool-selector/index.tsx b/web/app/components/plugins/plugin-detail-panel/tool-selector/index.tsx
index 4f736a4d8b4..07565d07a4f 100644
--- a/web/app/components/plugins/plugin-detail-panel/tool-selector/index.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/tool-selector/index.tsx
@@ -167,11 +167,7 @@ function ToolSelector({
/>
) : null}
- <PopoverContent
- placement="left"
- sideOffset={4}
- className="border-none bg-transparent shadow-none"
- >
+ <PopoverContent side="left" sideOffset={4} className="border-none bg-transparent shadow-none">
<div
className={cn(
'relative max-h-160.5 min-h-20 w-90.25 rounded-xl',
diff --git a/web/app/components/plugins/plugin-page/debug-info.tsx b/web/app/components/plugins/plugin-page/debug-info.tsx
index 3e80021b74e..19adeec71cd 100644
--- a/web/app/components/plugins/plugin-page/debug-info.tsx
+++ b/web/app/components/plugins/plugin-page/debug-info.tsx
@@ -1,6 +1,5 @@
'use client'
import type { ButtonProps } from '@langgenius/dify-ui/button'
-import type { PopoverContentProps } from '@langgenius/dify-ui/popover'
import type { ReactNode } from 'react'
import { Button } from '@langgenius/dify-ui/button'
import { cn } from '@langgenius/dify-ui/cn'
@@ -14,14 +13,12 @@ import { PluginSidecarPanel } from './plugin-sidecar-panel'
const i18nPrefix = 'debugInfo'
type DebugInfoProps = {
- popupPlacement?: PopoverContentProps['placement']
triggerClassName?: string
triggerContent?: ReactNode
triggerVariant?: ButtonProps['variant']
}
function DebugInfo({
- popupPlacement = 'bottom',
triggerClassName,
triggerContent,
triggerVariant = 'secondary',
@@ -58,10 +55,7 @@ function DebugInfo({
</Button>
}
/>
- <PopoverContent
- placement={popupPlacement}
- className="border-0 bg-transparent p-0 shadow-none"
- >
+ <PopoverContent side="top" align="start" className="border-0 bg-transparent p-0 shadow-none">
<PluginSidecarPanel
title={title}
footer={
diff --git a/web/app/components/plugins/plugin-page/filter-management/category-filter.tsx b/web/app/components/plugins/plugin-page/filter-management/category-filter.tsx
index 7cac3cefbc5..954dc3a8447 100644
--- a/web/app/components/plugins/plugin-page/filter-management/category-filter.tsx
+++ b/web/app/components/plugins/plugin-page/filter-management/category-filter.tsx
@@ -86,7 +86,7 @@ const CategoriesFilter = ({ value, onChange }: CategoriesFilterProps) => {
)}
</div>
<PopoverContent
- placement="bottom-start"
+ align="start"
sideOffset={4}
className="border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/plugins/plugin-page/filter-management/tag-filter.tsx b/web/app/components/plugins/plugin-page/filter-management/tag-filter.tsx
index 6a3be84d167..15ec6af9ae8 100644
--- a/web/app/components/plugins/plugin-page/filter-management/tag-filter.tsx
+++ b/web/app/components/plugins/plugin-page/filter-management/tag-filter.tsx
@@ -83,7 +83,7 @@ const TagsFilter = ({ value, onChange }: TagsFilterProps) => {
)}
</div>
<PopoverContent
- placement="bottom-start"
+ align="start"
sideOffset={4}
className="border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/plugins/plugin-page/install-plugin-dropdown.tsx b/web/app/components/plugins/plugin-page/install-plugin-dropdown.tsx
index 874c6a18899..3b6519671f5 100644
--- a/web/app/components/plugins/plugin-page/install-plugin-dropdown.tsx
+++ b/web/app/components/plugins/plugin-page/install-plugin-dropdown.tsx
@@ -175,11 +175,7 @@ const InstallPluginDropdown = ({
</Button>
}
/>
- <DropdownMenuContent
- placement="bottom-start"
- sideOffset={4}
- className={cn('w-50 pb-2', popupClassName)}
- >
+ <DropdownMenuContent align="start" className={cn('w-50 pb-2', popupClassName)}>
<DropdownMenuGroup>
<DropdownMenuGroupLabel>
{t(($) => $.installFrom, { ns: 'plugin' })}
diff --git a/web/app/components/plugins/plugin-page/nav-operations.tsx b/web/app/components/plugins/plugin-page/nav-operations.tsx
index 1e9d7c4f845..fa88a8feda0 100644
--- a/web/app/components/plugins/plugin-page/nav-operations.tsx
+++ b/web/app/components/plugins/plugin-page/nav-operations.tsx
@@ -109,11 +109,11 @@ export function SubmitRequestDropdownMenu({
/>
}
/>
- <TooltipContent placement="bottom" role="tooltip">
+ <TooltipContent side="bottom" role="tooltip">
{guideLabel}
</TooltipContent>
</Tooltip>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="min-w-50 p-1">
+ <DropdownMenuContent className="min-w-50 p-1">
{options.map((option, index) => (
<Fragment key={option.href}>
{dividerAfterFirst && index === 1 && <DropdownMenuSeparator className="my-1" />}
diff --git a/web/app/components/plugins/plugin-page/plugin-tasks/components/task-status-indicator.tsx b/web/app/components/plugins/plugin-page/plugin-tasks/components/task-status-indicator.tsx
index 70f3f92f60f..4eb2cffea2c 100644
--- a/web/app/components/plugins/plugin-page/plugin-tasks/components/task-status-indicator.tsx
+++ b/web/app/components/plugins/plugin-page/plugin-tasks/components/task-status-indicator.tsx
@@ -103,7 +103,7 @@ function TaskStatusIndicator({
</IconButton>
}
/>
- <TooltipContent sideOffset={8}>{tip}</TooltipContent>
+ <TooltipContent>{tip}</TooltipContent>
</Tooltip>
)
}
diff --git a/web/app/components/plugins/plugin-page/plugin-tasks/index.tsx b/web/app/components/plugins/plugin-page/plugin-tasks/index.tsx
index 2b6550365b7..4328232704c 100644
--- a/web/app/components/plugins/plugin-page/plugin-tasks/index.tsx
+++ b/web/app/components/plugins/plugin-page/plugin-tasks/index.tsx
@@ -14,13 +14,11 @@ import PluginTaskList from './components/plugin-task-list'
import TaskStatusIndicator from './components/task-status-indicator'
import { usePluginTaskStatus } from './hooks'
-type PluginTasksProps = {
+type PluginTasksProps = Pick<PopoverPositionerProps, 'anchor'> & {
animatedSlot?: boolean
- anchor?: () => Element | null
- placement?: PopoverPositionerProps['placement']
}
-const PluginTasks = ({ animatedSlot = false, anchor, placement = 'bottom' }: PluginTasksProps) => {
+const PluginTasks = ({ animatedSlot = false, anchor }: PluginTasksProps) => {
const { t } = useTranslation(['plugin'])
const [open, setOpen] = useState(false)
const {
@@ -138,7 +136,7 @@ const PluginTasks = ({ animatedSlot = false, anchor, placement = 'bottom' }: Plu
disabled={!canOpenPopover}
/>
<PopoverPortal>
- <PopoverPositioner placement={placement} sideOffset={4} anchor={anchor}>
+ <PopoverPositioner align="start" sideOffset={4} anchor={anchor}>
<PopoverPopup aria-label={tip}>
<PluginTaskList
runningPlugins={runningPlugins}
diff --git a/web/app/components/plugins/plugin-tags-filter/index.tsx b/web/app/components/plugins/plugin-tags-filter/index.tsx
index 569aed801b0..1ce1f8f9c45 100644
--- a/web/app/components/plugins/plugin-tags-filter/index.tsx
+++ b/web/app/components/plugins/plugin-tags-filter/index.tsx
@@ -36,7 +36,7 @@ export function PluginTagsFilter({
<CompactTrigger tags={value} tagsMap={tagsMap} onTagsChange={onValueChange} />
)}
<PopoverContent
- placement="bottom-start"
+ align="start"
sideOffset={4}
alignOffset={-6}
className="border-none bg-transparent shadow-none"
diff --git a/web/app/components/plugins/reference-setting-modal/auto-update-setting/tool-picker.tsx b/web/app/components/plugins/reference-setting-modal/auto-update-setting/tool-picker.tsx
index bc8bae01292..3a93e76aaec 100644
--- a/web/app/components/plugins/reference-setting-modal/auto-update-setting/tool-picker.tsx
+++ b/web/app/components/plugins/reference-setting-modal/auto-update-setting/tool-picker.tsx
@@ -110,7 +110,7 @@ const ToolPicker: FC<Props> = ({
<Popover open={isShow} onOpenChange={onShowChange}>
<PopoverTrigger render={resolvedTrigger} />
<PopoverContent
- placement="top"
+ side="top"
sideOffset={4}
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
>
diff --git a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/index.tsx b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/index.tsx
index e94d27822cf..675366b4fa2 100644
--- a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/index.tsx
+++ b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/index.tsx
@@ -113,7 +113,7 @@ const Publisher = () => {
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={4}
alignOffset={40}
className={cn('border-none bg-transparent shadow-none', confirmVisible && 'hidden')}
diff --git a/web/app/components/share/text-generation/menu-dropdown.tsx b/web/app/components/share/text-generation/menu-dropdown.tsx
index 5bf086ff163..1f811b23415 100644
--- a/web/app/components/share/text-generation/menu-dropdown.tsx
+++ b/web/app/components/share/text-generation/menu-dropdown.tsx
@@ -25,13 +25,13 @@ import { webAppLogout } from '@/service/webapp-auth'
import InfoModal from './info-modal'
type Props = Readonly<
- Pick<DropdownMenuContentProps, 'placement'> & {
+ Pick<DropdownMenuContentProps, 'side' | 'align'> & {
data?: SiteInfo
hideLogout?: boolean
}
>
-function MenuDropdown({ data, placement, hideLogout }: Props) {
+function MenuDropdown({ data, side, align, hideLogout }: Props) {
const webAppAccessMode = useWebAppStore((s) => s.webAppAccessMode)
const router = useRouter()
const pathname = usePathname()
@@ -64,7 +64,7 @@ function MenuDropdown({ data, placement, hideLogout }: Props) {
</IconButton>
}
/>
- <DropdownMenuContent placement={placement || 'bottom-end'} sideOffset={4} className="w-56">
+ <DropdownMenuContent side={side} align={align} className="w-56">
<DropdownMenuRadioGroup
value={theme ?? 'system'}
onValueChange={setTheme}
diff --git a/web/app/components/snippet-list/components/snippet-card.tsx b/web/app/components/snippet-list/components/snippet-card.tsx
index 244011cff75..a4dee0f87c0 100644
--- a/web/app/components/snippet-list/components/snippet-card.tsx
+++ b/web/app/components/snippet-list/components/snippet-card.tsx
@@ -206,7 +206,7 @@ const SnippetCard = ({
<span aria-hidden className="i-ri-more-fill size-4 text-text-tertiary" />
</div>
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-54">
+ <DropdownMenuContent className="w-54">
{canCreateAndModifySnippet && (
<>
<DropdownMenuItem className="gap-2 px-3" onClick={handleOpenEditDialog}>
diff --git a/web/app/components/snippet-list/components/snippet-create-button.tsx b/web/app/components/snippet-list/components/snippet-create-button.tsx
index 97b351df208..1fe63850aa2 100644
--- a/web/app/components/snippet-list/components/snippet-create-button.tsx
+++ b/web/app/components/snippet-list/components/snippet-create-button.tsx
@@ -36,7 +36,7 @@ const SnippetCreateButton = () => {
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={6}
className="w-57 rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur p-1 shadow-lg backdrop-blur-xs"
>
diff --git a/web/app/components/snippet-list/components/snippet-publish-status-filter.tsx b/web/app/components/snippet-list/components/snippet-publish-status-filter.tsx
index 0e26f50dd2b..2f978295163 100644
--- a/web/app/components/snippet-list/components/snippet-publish-status-filter.tsx
+++ b/web/app/components/snippet-list/components/snippet-publish-status-filter.tsx
@@ -57,7 +57,7 @@ const SnippetPublishStatusFilter = ({ value, onChange }: SnippetPublishStatusFil
<span className="px-1 text-text-tertiary">{triggerLabel}</span>
<span aria-hidden className="i-ri-arrow-down-s-line h-4 w-4 shrink-0 text-text-tertiary" />
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-start" className="w-55">
+ <DropdownMenuContent align="start" className="w-55">
<DropdownMenuRadioGroup<SnippetPublishStatus>
value={value}
onValueChange={(nextValue) => onChange(nextValue)}
diff --git a/web/app/components/snippets/components/snippet-detail-top.tsx b/web/app/components/snippets/components/snippet-detail-top.tsx
index 3bee4d6d67f..eabe2701aa7 100644
--- a/web/app/components/snippets/components/snippet-detail-top.tsx
+++ b/web/app/components/snippets/components/snippet-detail-top.tsx
@@ -94,7 +94,7 @@ export function SnippetDetailTop({ expand = true, onToggle }: SnippetDetailTopPr
/>
}
/>
- <TooltipContent placement="bottom" className="flex items-center gap-1">
+ <TooltipContent side="bottom" className="flex items-center gap-1">
<span className="px-0.5">{t(($) => $['gotoAnything.quickAction'], { ns: 'app' })}</span>
<KbdGroup>
{formatForDisplay(GOTO_ANYTHING_HOTKEY, { parts: true }).map((key) => (
diff --git a/web/app/components/step-by-step-tour/mount.tsx b/web/app/components/step-by-step-tour/mount.tsx
index 3caa9fa1830..febefee084c 100644
--- a/web/app/components/step-by-step-tour/mount.tsx
+++ b/web/app/components/step-by-step-tour/mount.tsx
@@ -821,7 +821,8 @@ export default function StepByStepTourMount({
{overlayVisible && (
<PopoverPortal>
<PopoverPositioner
- placement="top-start"
+ side="top"
+ align="start"
sideOffset={0}
anchor={anchorRef}
collisionPadding={8}
@@ -892,7 +893,8 @@ function SkipRecoveryPrompt({
>
<PopoverPortal>
<PopoverPositioner
- placement="top-end"
+ side="top"
+ align="end"
sideOffset={28}
anchor={anchorRef}
arrowPadding={8}
diff --git a/web/app/components/tools/edit-custom-collection-modal/get-schema.tsx b/web/app/components/tools/edit-custom-collection-modal/get-schema.tsx
index 78a815b4825..3dc8896371d 100644
--- a/web/app/components/tools/edit-custom-collection-modal/get-schema.tsx
+++ b/web/app/components/tools/edit-custom-collection-modal/get-schema.tsx
@@ -52,7 +52,7 @@ const GetSchema: FC<Props> = ({ onChange }) => {
</span>
</PopoverTrigger>
<PopoverContent
- placement="bottom-start"
+ align="start"
sideOffset={2}
className="w-75 p-2"
aria-label={t(($) => $['createTool.importFromUrl'], { ns: 'tools' })}
@@ -95,7 +95,7 @@ const GetSchema: FC<Props> = ({ onChange }) => {
</span>
<span className="i-ri-arrow-down-s-line size-3" aria-hidden />
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-end" sideOffset={2} className="min-w-max">
+ <DropdownMenuContent sideOffset={2} className="min-w-max">
{examples.map((item) => (
<DropdownMenuItem
key={item.key}
diff --git a/web/app/components/tools/labels/filter.tsx b/web/app/components/tools/labels/filter.tsx
index b464132c24f..378b2d5ffde 100644
--- a/web/app/components/tools/labels/filter.tsx
+++ b/web/app/components/tools/labels/filter.tsx
@@ -64,7 +64,7 @@ const LabelFilter: FC<LabelFilterProps> = ({ value, onChange }) => {
</button>
)}
<PopoverContent
- placement="bottom-start"
+ align="start"
sideOffset={4}
className="w-60 rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg-blur shadow-lg backdrop-blur-[5px]"
>
diff --git a/web/app/components/tools/labels/selector.tsx b/web/app/components/tools/labels/selector.tsx
index dca40b5c8cc..fa927c85855 100644
--- a/web/app/components/tools/labels/selector.tsx
+++ b/web/app/components/tools/labels/selector.tsx
@@ -46,7 +46,7 @@ function LabelSelector({ value, onChange }: LabelSelectorProps) {
</div>
</PopoverTrigger>
<PopoverContent
- placement="bottom-start"
+ align="start"
sideOffset={4}
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
>
diff --git a/web/app/components/tools/mcp/detail/operation-dropdown.tsx b/web/app/components/tools/mcp/detail/operation-dropdown.tsx
index c825b60e403..f0498d7c4b2 100644
--- a/web/app/components/tools/mcp/detail/operation-dropdown.tsx
+++ b/web/app/components/tools/mcp/detail/operation-dropdown.tsx
@@ -34,7 +34,7 @@ const OperationDropdown: FC<Props> = ({ inCard, onOpenChange, onEdit, onRemove }
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-40">
+ <DropdownMenuContent className="w-40">
<DropdownMenuItem onClick={onEdit}>
<span aria-hidden className="i-ri-edit-line size-4 shrink-0 text-text-tertiary" />
<div className="ml-2 system-md-regular text-text-secondary">
diff --git a/web/app/components/tools/mcp/detail/tool-item.tsx b/web/app/components/tools/mcp/detail/tool-item.tsx
index be1c88d97c0..d17f4f88e1e 100644
--- a/web/app/components/tools/mcp/detail/tool-item.tsx
+++ b/web/app/components/tools/mcp/detail/tool-item.tsx
@@ -71,7 +71,7 @@ const MCPToolItem = ({ tool }: Props) => {
}
/>
<PopoverContent
- placement="left"
+ side="left"
className="w-90! rounded-xl! border-[0.5px]! border-components-panel-border! px-4! py-3.5! shadow-lg!"
>
<div>
diff --git a/web/app/components/tools/workflow-tool/method-selector.tsx b/web/app/components/tools/workflow-tool/method-selector.tsx
index 5edfc4a236e..ef46ad81c61 100644
--- a/web/app/components/tools/workflow-tool/method-selector.tsx
+++ b/web/app/components/tools/workflow-tool/method-selector.tsx
@@ -40,7 +40,7 @@ const MethodSelector: FC<MethodSelectorProps> = ({ value, onChange }) => {
</div>
}
/>
- <PopoverContent placement="bottom-start" sideOffset={4}>
+ <PopoverContent align="start" sideOffset={4}>
<div className="relative w-[320px]">
<div className="p-1">
<button
diff --git a/web/app/components/workflow-app/components/workflow-header/features-trigger.tsx b/web/app/components/workflow-app/components/workflow-header/features-trigger.tsx
index eb5541ab246..41ad8684b72 100644
--- a/web/app/components/workflow-app/components/workflow-header/features-trigger.tsx
+++ b/web/app/components/workflow-app/components/workflow-header/features-trigger.tsx
@@ -263,7 +263,7 @@ const FeaturesTrigger = () => {
onPublish,
onToggle: onPublisherToggle,
workflowToolAvailable: lastPublishedHasUserInput,
- crossAxisOffset: 4,
+ alignOffset: 4,
missingStartNode: !startNode,
hasTriggerNode,
startNodeLimitExceeded,
diff --git a/web/app/components/workflow-app/components/workflow-onboarding-modal/start-node-selection-panel.tsx b/web/app/components/workflow-app/components/workflow-onboarding-modal/start-node-selection-panel.tsx
index 2b0df6a3f82..07a7d02f9f4 100644
--- a/web/app/components/workflow-app/components/workflow-onboarding-modal/start-node-selection-panel.tsx
+++ b/web/app/components/workflow-app/components/workflow-onboarding-modal/start-node-selection-panel.tsx
@@ -45,7 +45,8 @@ const StartNodeSelectionPanel: FC<StartNodeSelectionPanelProps> = ({
open={showTriggerSelector}
onOpenChange={setShowTriggerSelector}
onSelect={handleTriggerSelect}
- placement="bottom-end"
+ side="bottom"
+ align="end"
standalonePanel={TabType.Start}
availableBlocksTypes={[
BlockEnum.TriggerSchedule,
diff --git a/web/app/components/workflow/block-selector/agent-selector.tsx b/web/app/components/workflow/block-selector/agent-selector.tsx
index d9d2b570725..935bdbf27a6 100644
--- a/web/app/components/workflow/block-selector/agent-selector.tsx
+++ b/web/app/components/workflow/block-selector/agent-selector.tsx
@@ -53,14 +53,14 @@ export function AgentSelectorMenu({ children }: { children: ReactNode }) {
export const AgentSelectorMenuTrigger = DropdownMenuTrigger
-type AgentSelectorMenuContentProps = {
- placement?: DropdownMenuContentProps['placement']
+type AgentSelectorMenuContentProps = Pick<DropdownMenuContentProps, 'side' | 'align'> & {
onSelect: (agent: AgentRosterNodeData) => void
onStartFromScratch?: () => void
}
export function AgentSelectorMenuContent({
- placement = 'bottom-end',
+ side,
+ align,
onSelect,
onStartFromScratch,
}: AgentSelectorMenuContentProps) {
@@ -68,8 +68,8 @@ export function AgentSelectorMenuContent({
return (
<DropdownMenuContent
- placement={placement}
- sideOffset={4}
+ side={side}
+ align={align}
aria-label={t(($) => $['roster.nodeSelector.dialogLabel'], { ns: 'agentRoster' })}
className="w-60"
>
@@ -283,7 +283,8 @@ export function AgentBlockItem({
/>
</AgentSelectorMenuTrigger>
<AgentSelectorMenuContent
- placement="right-start"
+ side="right"
+ align="start"
onSelect={onSelect}
onStartFromScratch={onStartFromScratch}
/>
diff --git a/web/app/components/workflow/block-selector/index.tsx b/web/app/components/workflow/block-selector/index.tsx
index f224fe25987..941d9016c3c 100644
--- a/web/app/components/workflow/block-selector/index.tsx
+++ b/web/app/components/workflow/block-selector/index.tsx
@@ -33,7 +33,7 @@ import { BlockSelectorPanels } from './tabs'
export type BlockSelectorProps = Pick<
PopoverPositionerProps,
- 'alignOffset' | 'placement' | 'sideOffset'
+ 'alignOffset' | 'side' | 'align' | 'sideOffset'
> & {
finalFocus?: PopoverPopupProps['finalFocus']
triggerRef?: Ref<HTMLButtonElement>
@@ -69,7 +69,8 @@ function BlockSelector({
triggerTooltip,
triggerRef,
finalFocus,
- placement = 'right',
+ side = 'right',
+ align,
sideOffset,
alignOffset,
triggerClassName,
@@ -166,7 +167,8 @@ function BlockSelector({
{triggerWithTooltip}
<PopoverPortal>
<PopoverPositioner
- placement={placement}
+ side={side}
+ align={align}
sideOffset={sideOffset}
alignOffset={alignOffset}
positionMethod="fixed"
diff --git a/web/app/components/workflow/block-selector/marketplace-plugin/action.tsx b/web/app/components/workflow/block-selector/marketplace-plugin/action.tsx
index cc446816e38..511e3f80c8a 100644
--- a/web/app/components/workflow/block-selector/marketplace-plugin/action.tsx
+++ b/web/app/components/workflow/block-selector/marketplace-plugin/action.tsx
@@ -65,7 +65,7 @@ function OperationDropdown({ open, onOpenChange, author, name, version }: Props)
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="min-w-44">
+ <DropdownMenuContent className="min-w-44">
<DropdownMenuItem className="system-md-regular" onClick={handleDownload}>
{t(($) => $['operation.download'], { ns: 'common' })}
</DropdownMenuItem>
diff --git a/web/app/components/workflow/block-selector/preview-card.tsx b/web/app/components/workflow/block-selector/preview-card.tsx
index d9ec3153822..230425b375c 100644
--- a/web/app/components/workflow/block-selector/preview-card.tsx
+++ b/web/app/components/workflow/block-selector/preview-card.tsx
@@ -11,7 +11,7 @@ export function BlockSelectorPreviewCardContent({ children }: { children: ReactN
return (
<PreviewCardPortal>
<PreviewCardPositioner
- placement="right"
+ side="right"
className="h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom,transform] duration-180 ease-[cubic-bezier(0.22,1,0.36,1)] data-instant:transition-none motion-reduce:transition-none"
>
<PreviewCardPopup className="relative h-(--popup-height,auto) w-(--popup-width,auto) overflow-hidden rounded-xl bg-components-panel-bg shadow-lg transition-[width,height,transform,scale,opacity] duration-180 ease-[cubic-bezier(0.22,1,0.36,1)] data-instant:transition-none motion-reduce:transition-none">
diff --git a/web/app/components/workflow/block-selector/snippets/snippet-tags-filter.tsx b/web/app/components/workflow/block-selector/snippets/snippet-tags-filter.tsx
index 192fef0aa9f..01626a926e8 100644
--- a/web/app/components/workflow/block-selector/snippets/snippet-tags-filter.tsx
+++ b/web/app/components/workflow/block-selector/snippets/snippet-tags-filter.tsx
@@ -85,7 +85,7 @@ const SnippetTagsFilter = ({ embedded = false, value, onChange }: SnippetTagsFil
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={6}
className="w-60 rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur p-0 shadow-lg backdrop-blur-xs"
>
diff --git a/web/app/components/workflow/block-selector/tabs.tsx b/web/app/components/workflow/block-selector/tabs.tsx
index 309512e8d34..f6f0bf700e6 100644
--- a/web/app/components/workflow/block-selector/tabs.tsx
+++ b/web/app/components/workflow/block-selector/tabs.tsx
@@ -80,7 +80,7 @@ function TabHeaderItem({
return (
<Tooltip>
<TooltipTrigger render={tabElement} />
- <TooltipContent placement="top" className="max-w-57.5">
+ <TooltipContent className="max-w-57.5">
{tab.disabledTip || fallbackDisabledTip}
</TooltipContent>
</Tooltip>
diff --git a/web/app/components/workflow/block-selector/tool-picker.tsx b/web/app/components/workflow/block-selector/tool-picker.tsx
index b7c14e230bd..9ab686a438f 100644
--- a/web/app/components/workflow/block-selector/tool-picker.tsx
+++ b/web/app/components/workflow/block-selector/tool-picker.tsx
@@ -26,7 +26,7 @@ const ToolBrowser = dynamic(() => import('./tool-browser'), {
})
type Props = Readonly<
- Pick<PopoverContentProps, 'placement' | 'sideOffset'> & {
+ Pick<PopoverContentProps, 'side' | 'align' | 'sideOffset'> & {
disabled: boolean
trigger: ReactElement
isShow: boolean
@@ -223,7 +223,8 @@ export function ToolPickerContent({
function ToolPicker({
disabled,
trigger,
- placement = 'right-start',
+ side = 'right',
+ align = 'start',
sideOffset = 0,
isShow,
onShowChange,
@@ -239,7 +240,8 @@ function ToolPicker({
<PopoverTrigger disabled={disabled} render={trigger} />
<PopoverContent
- placement={placement}
+ side={side}
+ align={align}
sideOffset={sideOffset}
className="border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/workflow/comment/thread.tsx b/web/app/components/workflow/comment/thread.tsx
index b987a462162..7347d3de801 100644
--- a/web/app/components/workflow/comment/thread.tsx
+++ b/web/app/components/workflow/comment/thread.tsx
@@ -485,7 +485,7 @@ function CommentThreadComponent({
</button>
}
/>
- <TooltipContent placement="top">
+ <TooltipContent>
{t(($) => $['comments.aria.deleteComment'], { ns: 'workflowComments' })}
</TooltipContent>
</Tooltip>
@@ -511,7 +511,7 @@ function CommentThreadComponent({
</button>
}
/>
- <TooltipContent placement="top">
+ <TooltipContent>
{t(($) => $['comments.aria.resolveComment'], { ns: 'workflowComments' })}
</TooltipContent>
</Tooltip>
@@ -534,7 +534,7 @@ function CommentThreadComponent({
</button>
}
/>
- <TooltipContent placement="top">
+ <TooltipContent>
{t(($) => $['comments.aria.previousComment'], { ns: 'workflowComments' })}
</TooltipContent>
</Tooltip>
@@ -556,7 +556,7 @@ function CommentThreadComponent({
</button>
}
/>
- <TooltipContent placement="top">
+ <TooltipContent>
{t(($) => $['comments.aria.nextComment'], { ns: 'workflowComments' })}
</TooltipContent>
</Tooltip>
@@ -585,11 +585,7 @@ function CommentThreadComponent({
>
<RiMoreFill className="size-4" />
</DropdownMenuTrigger>
- <DropdownMenuContent
- placement="bottom-end"
- sideOffset={4}
- className="w-36 backdrop-blur-[10px]"
- >
+ <DropdownMenuContent className="w-36 backdrop-blur-[10px]">
<DropdownMenuItem
className="px-3"
onClick={(e) => {
@@ -678,12 +674,7 @@ function CommentThreadComponent({
>
<RiMoreFill className="size-4" />
</DropdownMenuTrigger>
- <DropdownMenuContent
- placement="bottom-end"
- sideOffset={4}
- className="w-36 backdrop-blur-[10px]"
- data-reply-menu
- >
+ <DropdownMenuContent className="w-36 backdrop-blur-[10px]" data-reply-menu>
<DropdownMenuItem
onClick={(event) => {
event.stopPropagation()
diff --git a/web/app/components/workflow/header/checklist/index.tsx b/web/app/components/workflow/header/checklist/index.tsx
index a0395f53a2b..55180bd29f2 100644
--- a/web/app/components/workflow/header/checklist/index.tsx
+++ b/web/app/components/workflow/header/checklist/index.tsx
@@ -92,7 +92,7 @@ const WorkflowChecklist = ({ disabled, showGoTo = true, onItemClick }: WorkflowC
<TooltipContent>{checklistLabel}</TooltipContent>
</Tooltip>
<PopoverContent
- placement="bottom-start"
+ align="start"
sideOffset={12}
alignOffset={-30}
className="w-105 rounded-2xl bg-background-default-subtle"
diff --git a/web/app/components/workflow/header/online-users.tsx b/web/app/components/workflow/header/online-users.tsx
index 40aaa09281f..c39bde55790 100644
--- a/web/app/components/workflow/header/online-users.tsx
+++ b/web/app/components/workflow/header/online-users.tsx
@@ -163,7 +163,7 @@ const OnlineUsers = () => {
)
}
/>
- <TooltipContent placement="bottom" sideOffset={4} className="max-w-55">
+ <TooltipContent side="bottom" sideOffset={4} className="max-w-55">
{displayName}
{isCurrentUser && (
<span className="ml-1 text-text-quaternary">{currentUserSuffix}</span>
@@ -190,8 +190,7 @@ const OnlineUsers = () => {
}
/>
<PopoverContent
- placement="bottom-start"
- sideOffset={8}
+ align="start"
alignOffset={-48}
className={cn(
'mt-1.5 flex max-h-50 w-60 flex-col overflow-y-auto',
diff --git a/web/app/components/workflow/header/test-run-menu.tsx b/web/app/components/workflow/header/test-run-menu.tsx
index ed3c9773c92..08f0e5e96e2 100644
--- a/web/app/components/workflow/header/test-run-menu.tsx
+++ b/web/app/components/workflow/header/test-run-menu.tsx
@@ -191,7 +191,7 @@ const TestRunMenu = forwardRef<TestRunMenuRef, TestRunMenuProps>(
)}
<DropdownMenuContent
onKeyDown={(event) => handleShortcutMenuKeyDown(event, shortcutMappings, handleSelect)}
- placement="bottom-start"
+ align="start"
sideOffset={8}
alignOffset={-4}
className="w-71 px-1"
diff --git a/web/app/components/workflow/header/view-history.tsx b/web/app/components/workflow/header/view-history.tsx
index dd0930f62de..2664bbdf881 100644
--- a/web/app/components/workflow/header/view-history.tsx
+++ b/web/app/components/workflow/header/view-history.tsx
@@ -79,7 +79,7 @@ const ViewHistory = ({ withText, onClearLogAndMessageModal, historyUrl }: ViewHi
</Tooltip>
)}
<PopoverContent
- placement={withText ? 'bottom-start' : 'bottom-end'}
+ align={withText ? 'start' : 'end'}
sideOffset={4}
alignOffset={withText ? -8 : 10}
className="border-none bg-transparent shadow-none"
diff --git a/web/app/components/workflow/header/view-workflow-history.tsx b/web/app/components/workflow/header/view-workflow-history.tsx
index e66680368b2..0a3f0063b88 100644
--- a/web/app/components/workflow/header/view-workflow-history.tsx
+++ b/web/app/components/workflow/header/view-workflow-history.tsx
@@ -162,7 +162,7 @@ const ViewWorkflowHistory = () => {
}
/>
</TipPopup>
- <PopoverContent placement="bottom-end" className="border-none bg-transparent shadow-none">
+ <PopoverContent align="end" className="border-none bg-transparent shadow-none">
<div className="flex max-w-90 min-w-60 flex-col overflow-y-auto rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur shadow-xl backdrop-blur-[5px]">
<div className="sticky top-0 flex items-center justify-between px-4 pt-3">
<div className="grow text-text-secondary">
diff --git a/web/app/components/workflow/node-actions-menu/context-menu-content.tsx b/web/app/components/workflow/node-actions-menu/context-menu-content.tsx
index 0fc3990fe36..dddd88b6c96 100644
--- a/web/app/components/workflow/node-actions-menu/context-menu-content.tsx
+++ b/web/app/components/workflow/node-actions-menu/context-menu-content.tsx
@@ -79,7 +79,7 @@ export function NodeActionsContextMenuContent(props: NodeActionsMenuProps) {
</ContextMenuItem>
<PopoverPortal>
<PopoverBackdrop />
- <PopoverPositioner placement="right-start" positionMethod="fixed">
+ <PopoverPositioner side="right" align="start" positionMethod="fixed">
<ChangeBlockPopup
nodeId={model.id}
nodeData={model.data}
diff --git a/web/app/components/workflow/node-actions-menu/index.tsx b/web/app/components/workflow/node-actions-menu/index.tsx
index 5b094da22b9..0da812bea3f 100644
--- a/web/app/components/workflow/node-actions-menu/index.tsx
+++ b/web/app/components/workflow/node-actions-menu/index.tsx
@@ -107,7 +107,7 @@ function NodeActionsDropdownContent(props: NodeActionsMenuProps) {
}
return (
- <DropdownMenuPositioner placement="bottom-end">
+ <DropdownMenuPositioner align="end">
<DropdownMenuPopup
finalFocus={() => (deletingRef.current ? (flowStore.getState().domNode ?? true) : true)}
className={`${NODE_ACTIONS_MENU_WIDTH_CLASS_NAME} border-[0.5px] border-components-panel-border bg-components-panel-bg-blur py-1 shadow-lg backdrop-blur-[5px]`}
@@ -142,7 +142,7 @@ function NodeActionsDropdownContent(props: NodeActionsMenuProps) {
</DropdownMenuItem>
<PopoverPortal>
<PopoverBackdrop />
- <PopoverPositioner placement="right-start" positionMethod="fixed">
+ <PopoverPositioner side="right" align="start" positionMethod="fixed">
<ChangeBlockPopup
nodeId={model.id}
nodeData={model.data}
diff --git a/web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx b/web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx
index 61edce260e3..73f3da24976 100644
--- a/web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx
+++ b/web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx
@@ -215,7 +215,6 @@ export const AgentStrategySelector = memo((props: AgentStrategySelectorProps) =>
}
/>
<PopoverContent
- placement="bottom"
sideOffset={0}
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
>
diff --git a/web/app/components/workflow/nodes/_base/components/error-handle/error-handle-type-selector.tsx b/web/app/components/workflow/nodes/_base/components/error-handle/error-handle-type-selector.tsx
index 015d5eb8e83..e2c67a99058 100644
--- a/web/app/components/workflow/nodes/_base/components/error-handle/error-handle-type-selector.tsx
+++ b/web/app/components/workflow/nodes/_base/components/error-handle/error-handle-type-selector.tsx
@@ -59,7 +59,7 @@ const ErrorHandleTypeSelector = ({
{selectedOption?.label}
<RiArrowDownSLine className="size-3.5" />
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-70 p-1">
+ <DropdownMenuContent className="w-70 p-1">
<DropdownMenuRadioGroup value={value} onValueChange={onSelected}>
{availableOptions.map((option) => (
<DropdownMenuRadioItem
diff --git a/web/app/components/workflow/nodes/_base/components/form-input-item.tsx b/web/app/components/workflow/nodes/_base/components/form-input-item.tsx
index f4e0e582d8a..91248ac5d8d 100644
--- a/web/app/components/workflow/nodes/_base/components/form-input-item.tsx
+++ b/web/app/components/workflow/nodes/_base/components/form-input-item.tsx
@@ -463,7 +463,6 @@ const FormInputItem: FC<Props> = ({
{isAppSelector && (
<AppSelector
disabled={readOnly}
- scope={scope || 'all'}
value={varInput?.value}
onSelect={handleAppOrModelSelect}
/>
diff --git a/web/app/components/workflow/nodes/_base/components/next-step/add.tsx b/web/app/components/workflow/nodes/_base/components/next-step/add.tsx
index 66d1b612abc..27b530fb812 100644
--- a/web/app/components/workflow/nodes/_base/components/next-step/add.tsx
+++ b/web/app/components/workflow/nodes/_base/components/next-step/add.tsx
@@ -76,7 +76,7 @@ const Add = ({ nodeId, nodeData, sourceHandle, isParallel, isFailBranch }: AddPr
prevNodeId: nodeId,
prevNodeSourceHandle: sourceHandle,
}}
- placement="top"
+ side="top"
sideOffset={0}
trigger={triggerElement}
popupClassName="w-[328px]!"
diff --git a/web/app/components/workflow/nodes/_base/components/next-step/operator.tsx b/web/app/components/workflow/nodes/_base/components/next-step/operator.tsx
index 10674691650..9fc8dd1a7b9 100644
--- a/web/app/components/workflow/nodes/_base/components/next-step/operator.tsx
+++ b/web/app/components/workflow/nodes/_base/components/next-step/operator.tsx
@@ -58,7 +58,8 @@ const ChangeItem = ({ data, nodeId, sourceHandle }: ChangeItemProps) => {
return (
<BlockSelector
onSelect={handleSelect}
- placement="top-end"
+ side="top"
+ align="end"
sideOffset={6}
alignOffset={8}
trigger={triggerElement}
@@ -96,7 +97,7 @@ const Operator = ({ open, onOpenChange, data, nodeId, sourceHandle }: OperatorPr
}
/>
<DropdownMenuPortal>
- <DropdownMenuPositioner placement="bottom-end" sideOffset={4} alignOffset={-4}>
+ <DropdownMenuPositioner align="end" alignOffset={-4}>
<DropdownMenuPopup>
<div className="min-w-30 rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur system-md-regular text-text-secondary shadow-lg">
<div className="p-1">
diff --git a/web/app/components/workflow/nodes/_base/components/node-handle.tsx b/web/app/components/workflow/nodes/_base/components/node-handle.tsx
index 6919ce054ea..ba8020ea7e1 100644
--- a/web/app/components/workflow/nodes/_base/components/node-handle.tsx
+++ b/web/app/components/workflow/nodes/_base/components/node-handle.tsx
@@ -121,7 +121,7 @@ export const NodeTargetHandle = memo(
nextNodeTargetHandle: handleId,
}}
triggerStyle={{ scale: 'var(--workflow-control-scale, 1)' }}
- placement="left"
+ side="left"
showStartTab
triggerClassName={`
absolute -left-1 -top-1 opacity-0 pointer-events-none transition-opacity duration-150
diff --git a/web/app/components/workflow/nodes/_base/components/switch-plugin-version.tsx b/web/app/components/workflow/nodes/_base/components/switch-plugin-version.tsx
index aabda4e7042..7b10a68c4e3 100644
--- a/web/app/components/workflow/nodes/_base/components/switch-plugin-version.tsx
+++ b/web/app/components/workflow/nodes/_base/components/switch-plugin-version.tsx
@@ -147,7 +147,7 @@ export const SwitchPluginVersion: FC<SwitchPluginVersionProps> = (props) => {
)}
<DropdownMenuContent
className="max-h-[min(16rem,var(--available-height))]"
- placement="bottom-start"
+ align="start"
aria-labelledby={versionMenuLabelId}
>
<DropdownMenuGroup>
diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx
index 7f875dc2cc1..9756f9d3d1f 100644
--- a/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx
+++ b/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx
@@ -423,7 +423,7 @@ const VarReferencePicker: FC<Props> = ({
)}
<PopoverContent
initialFocus={searchInputRef}
- placement={isAddBtnTrigger ? 'bottom-end' : 'bottom-start'}
+ align={isAddBtnTrigger ? 'end' : 'start'}
sideOffset={4}
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
>
diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx
index 2f65dc8490f..932e5662bad 100644
--- a/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx
+++ b/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx
@@ -295,7 +295,8 @@ const Item: FC<ItemProps> = ({
<Popover open={open} onOpenChange={noop}>
<PopoverTrigger nativeButton={false} render={itemTrigger} />
<PopoverContent
- placement="left-start"
+ side="left"
+ align="start"
sideOffset={0}
className={cn(
VAR_REFERENCE_CHILD_POPUP_CLASS_NAME,
diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-type-picker.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-type-picker.tsx
index f052a9b9793..925d4bc8f46 100644
--- a/web/app/components/workflow/nodes/_base/components/variable/var-type-picker.tsx
+++ b/web/app/components/workflow/nodes/_base/components/variable/var-type-picker.tsx
@@ -50,7 +50,7 @@ const VarReferencePicker: FC<Props> = ({ readonly, className, value, onChange })
<SelectValue className="capitalize" />
</SelectTrigger>
<SelectPortal>
- <SelectPositioner sideOffset={4}>
+ <SelectPositioner>
<SelectPopup className="w-30 rounded-lg border-0 p-1 shadow-sm">
<SelectList className="p-0">
{TYPES.map((type) => (
diff --git a/web/app/components/workflow/nodes/agent-v2/components/agent-orchestrate-panel-content.tsx b/web/app/components/workflow/nodes/agent-v2/components/agent-orchestrate-panel-content.tsx
index 437382348ac..bed2a51f9f8 100644
--- a/web/app/components/workflow/nodes/agent-v2/components/agent-orchestrate-panel-content.tsx
+++ b/web/app/components/workflow/nodes/agent-v2/components/agent-orchestrate-panel-content.tsx
@@ -746,7 +746,7 @@ function WorkflowInlineAgentConfigureMoreAction({
</button>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-max min-w-44">
+ <DropdownMenuContent className="w-max min-w-44">
<DropdownMenuItem className="gap-2 whitespace-nowrap" onClick={onSaveInlineToRoster}>
<span
aria-hidden
diff --git a/web/app/components/workflow/nodes/agent-v2/components/agent-roster-field.tsx b/web/app/components/workflow/nodes/agent-v2/components/agent-roster-field.tsx
index ccfc7c9830b..b46a12de764 100644
--- a/web/app/components/workflow/nodes/agent-v2/components/agent-roster-field.tsx
+++ b/web/app/components/workflow/nodes/agent-v2/components/agent-roster-field.tsx
@@ -214,11 +214,7 @@ function AgentRosterDrawer({
>
<span aria-hidden className="i-ri-more-fill size-4" />
</DropdownMenuTrigger>
- <DropdownMenuContent
- placement="bottom-end"
- sideOffset={4}
- className="w-max min-w-44"
- >
+ <DropdownMenuContent className="w-max min-w-44">
<DropdownMenuItem
className="gap-2 whitespace-nowrap"
onClick={onSaveInlineToRoster}
@@ -448,11 +444,7 @@ export function AgentRosterField({
>
{t(($) => $[`${i18nPrefix}.roster.change`], { ns: 'workflowAgent' })}
</AgentSelectorMenuTrigger>
- <AgentSelectorMenuContent
- placement="bottom-end"
- onSelect={onChange}
- onStartFromScratch={onStartFromScratch}
- />
+ <AgentSelectorMenuContent onSelect={onChange} onStartFromScratch={onStartFromScratch} />
</AgentSelectorMenu>
</div>
{errorMessage ? (
diff --git a/web/app/components/workflow/nodes/assigner/components/operation-selector.tsx b/web/app/components/workflow/nodes/assigner/components/operation-selector.tsx
index 996542403a6..fcab72c9b5c 100644
--- a/web/app/components/workflow/nodes/assigner/components/operation-selector.tsx
+++ b/web/app/components/workflow/nodes/assigner/components/operation-selector.tsx
@@ -81,11 +81,7 @@ function OperationSelector({
/>
</DropdownMenuTrigger>
- <DropdownMenuContent
- placement="bottom-start"
- sideOffset={4}
- className={cn('w-35', popupClassName)}
- >
+ <DropdownMenuContent align="start" className={cn('w-35', popupClassName)}>
<DropdownMenuGroup>
<DropdownMenuGroupLabel>
{t(($) => $['nodes.assigner.operations.title'], { ns: 'workflowLogic' })}
diff --git a/web/app/components/workflow/nodes/data-source-empty/index.tsx b/web/app/components/workflow/nodes/data-source-empty/index.tsx
index fc0e075fd60..8f0fce8daac 100644
--- a/web/app/components/workflow/nodes/data-source-empty/index.tsx
+++ b/web/app/components/workflow/nodes/data-source-empty/index.tsx
@@ -44,7 +44,8 @@ const DataSourceEmptyNode = ({ id, data }: NodeProps) => {
trigger={triggerElement}
standalonePanel={TabType.Sources}
popupClassName="w-[320px]"
- placement="bottom-start"
+ side="bottom"
+ align="start"
sideOffset={4}
/>
</div>
diff --git a/web/app/components/workflow/nodes/human-input/components/button-style-dropdown.tsx b/web/app/components/workflow/nodes/human-input/components/button-style-dropdown.tsx
index 20da65d91c9..7541eb5229c 100644
--- a/web/app/components/workflow/nodes/human-input/components/button-style-dropdown.tsx
+++ b/web/app/components/workflow/nodes/human-input/components/button-style-dropdown.tsx
@@ -71,7 +71,7 @@ const ButtonStyleDropdown: FC<Props> = ({ text = 'Button Text', data, onChange,
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={4}
alignOffset={44}
className="border-none bg-transparent shadow-none"
diff --git a/web/app/components/workflow/nodes/human-input/components/delivery-method/method-selector.tsx b/web/app/components/workflow/nodes/human-input/components/delivery-method/method-selector.tsx
index b76add36da0..113713185b8 100644
--- a/web/app/components/workflow/nodes/human-input/components/delivery-method/method-selector.tsx
+++ b/web/app/components/workflow/nodes/human-input/components/delivery-method/method-selector.tsx
@@ -68,7 +68,7 @@ const MethodSelector: FC<MethodSelectorProps> = ({ data, onAdd, onShowUpgradeTip
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={4}
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
>
diff --git a/web/app/components/workflow/nodes/human-input/components/delivery-method/recipient/email-input.tsx b/web/app/components/workflow/nodes/human-input/components/delivery-method/recipient/email-input.tsx
index 760b207b7ae..feaa233666a 100644
--- a/web/app/components/workflow/nodes/human-input/components/delivery-method/recipient/email-input.tsx
+++ b/web/app/components/workflow/nodes/human-input/components/delivery-method/recipient/email-input.tsx
@@ -152,12 +152,7 @@ const EmailInput = ({ email, value, list, onDelete, onSelect, onAdd, disabled =
onKeyDown={handleKeyDown}
/>
<PopoverPortal>
- <PopoverPositioner
- placement="bottom-start"
- sideOffset={4}
- alignOffset={-40}
- anchor={inputRef}
- >
+ <PopoverPositioner align="start" sideOffset={4} alignOffset={-40} anchor={inputRef}>
<PopoverPopup
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
initialFocus={false}
diff --git a/web/app/components/workflow/nodes/human-input/components/delivery-method/recipient/member-selector.tsx b/web/app/components/workflow/nodes/human-input/components/delivery-method/recipient/member-selector.tsx
index 81fd3005633..11a978f9efe 100644
--- a/web/app/components/workflow/nodes/human-input/components/delivery-method/recipient/member-selector.tsx
+++ b/web/app/components/workflow/nodes/human-input/components/delivery-method/recipient/member-selector.tsx
@@ -49,7 +49,7 @@ const MemberSelector: FC<Props> = ({ value, email, onSelect, list = [] }) => {
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={4}
alignOffset={35}
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
diff --git a/web/app/components/workflow/nodes/if-else/components/condition-add.tsx b/web/app/components/workflow/nodes/if-else/components/condition-add.tsx
index a37f72ee30e..670528f79ab 100644
--- a/web/app/components/workflow/nodes/if-else/components/condition-add.tsx
+++ b/web/app/components/workflow/nodes/if-else/components/condition-add.tsx
@@ -49,7 +49,7 @@ const ConditionAdd = ({
/>
<PopoverContent
initialFocus={searchInputRef}
- placement="bottom-start"
+ align="start"
sideOffset={4}
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
>
diff --git a/web/app/components/workflow/nodes/if-else/components/condition-list/condition-operator.tsx b/web/app/components/workflow/nodes/if-else/components/condition-list/condition-operator.tsx
index 4db08c71309..a78713ef4d0 100644
--- a/web/app/components/workflow/nodes/if-else/components/condition-list/condition-operator.tsx
+++ b/web/app/components/workflow/nodes/if-else/components/condition-list/condition-operator.tsx
@@ -64,11 +64,7 @@ const ConditionOperator = ({
: t(($) => $[`${i18nPrefix}.select`], { ns: 'workflowLogic' })}
<RiArrowDownSLine className="size-3.5" />
</DropdownMenuTrigger>
- <DropdownMenuContent
- placement="bottom-end"
- sideOffset={4}
- className="rounded-xl border-[0.5px] bg-components-panel-bg-blur p-1"
- >
+ <DropdownMenuContent className="rounded-xl border-[0.5px] bg-components-panel-bg-blur p-1">
<DropdownMenuRadioGroup value={selectedOption?.value} onValueChange={onSelect}>
{options.map((option) => (
<DropdownMenuRadioItem
diff --git a/web/app/components/workflow/nodes/if-else/components/condition-list/condition-var-selector.tsx b/web/app/components/workflow/nodes/if-else/components/condition-list/condition-var-selector.tsx
index 8e0d49d14c4..7f5a02d0fd5 100644
--- a/web/app/components/workflow/nodes/if-else/components/condition-list/condition-var-selector.tsx
+++ b/web/app/components/workflow/nodes/if-else/components/condition-list/condition-var-selector.tsx
@@ -47,7 +47,7 @@ const ConditionVarSelector = ({
/>
<PopoverContent
initialFocus={searchInputRef}
- placement="bottom-start"
+ align="start"
sideOffset={4}
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
>
diff --git a/web/app/components/workflow/nodes/if-else/components/condition-number-input.tsx b/web/app/components/workflow/nodes/if-else/components/condition-number-input.tsx
index e62314e9e61..6cdde2f37e3 100644
--- a/web/app/components/workflow/nodes/if-else/components/condition-number-input.tsx
+++ b/web/app/components/workflow/nodes/if-else/components/condition-number-input.tsx
@@ -61,7 +61,7 @@ const ConditionNumberInput = ({
<RiArrowDownSLine className="size-3.5" />
</DropdownMenuTrigger>
<DropdownMenuContent
- placement="bottom-start"
+ align="start"
sideOffset={2}
className="w-28 rounded-xl border-[0.5px] bg-components-panel-bg-blur p-1"
>
@@ -109,7 +109,7 @@ const ConditionNumberInput = ({
</PopoverTrigger>
<PopoverContent
initialFocus={searchInputRef}
- placement="bottom-start"
+ align="start"
sideOffset={2}
className="border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/selector.tsx b/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/selector.tsx
index 45c22651613..bb0b53c4b64 100644
--- a/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/selector.tsx
+++ b/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/selector.tsx
@@ -48,7 +48,7 @@ const Selector = ({ options, value, onChange, readonly, trigger }: SelectorProps
</PopoverTrigger>
)}
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={0}
alignOffset={-8}
className="border-none bg-transparent shadow-none"
diff --git a/web/app/components/workflow/nodes/knowledge-retrieval-v2/components/recall-settings.tsx b/web/app/components/workflow/nodes/knowledge-retrieval-v2/components/recall-settings.tsx
index be3d6ecc353..38610497852 100644
--- a/web/app/components/workflow/nodes/knowledge-retrieval-v2/components/recall-settings.tsx
+++ b/web/app/components/workflow/nodes/knowledge-retrieval-v2/components/recall-settings.tsx
@@ -95,7 +95,7 @@ const RecallSettings: FC<Props> = ({
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={0}
alignOffset={-2}
className="border-none bg-transparent shadow-none"
diff --git a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/add-condition.tsx b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/add-condition.tsx
index da6ffb917c4..c921ff93263 100644
--- a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/add-condition.tsx
+++ b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/add-condition.tsx
@@ -30,7 +30,7 @@ const AddCondition = ({
<span aria-hidden="true" className="i-ri-add-line size-3.5" />
{t(($) => $['nodes.knowledgeRetrieval.metadata.panel.add'], { ns: 'workflowModels' })}
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-start" sideOffset={12} className="w-80">
+ <DropdownMenuContent align="start" sideOffset={12} className="w-80">
<DropdownMenuInputGroup>
<span
aria-hidden="true"
diff --git a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-common-variable-selector.tsx b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-common-variable-selector.tsx
index d8f8c818a24..7dfd2f2f1bd 100644
--- a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-common-variable-selector.tsx
+++ b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-common-variable-selector.tsx
@@ -65,7 +65,7 @@ const ConditionCommonVariableSelector = ({
}}
/>
<PopoverContent
- placement="bottom-start"
+ align="start"
sideOffset={4}
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
>
diff --git a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-operator.tsx b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-operator.tsx
index fe7e46011e7..a49b847d4b1 100644
--- a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-operator.tsx
+++ b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-operator.tsx
@@ -60,7 +60,7 @@ const ConditionOperator = ({
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={4}
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
>
diff --git a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-value-method.tsx b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-value-method.tsx
index b0f88380738..9942c775613 100644
--- a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-value-method.tsx
+++ b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-value-method.tsx
@@ -27,7 +27,7 @@ const ConditionValueMethod = ({
}
/>
<PopoverContent
- placement="bottom-start"
+ align="start"
sideOffset={4}
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
>
diff --git a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-variable-selector.tsx b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-variable-selector.tsx
index 4f9446eae72..cb8149ac2cf 100644
--- a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-variable-selector.tsx
+++ b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-variable-selector.tsx
@@ -68,7 +68,7 @@ const ConditionVariableSelector = ({
/>
<PopoverContent
initialFocus={searchInputRef}
- placement="bottom-start"
+ align="start"
sideOffset={4}
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
>
diff --git a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-filter/metadata-filter-selector.tsx b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-filter/metadata-filter-selector.tsx
index 520edeeb118..b8f72a7bd27 100644
--- a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-filter/metadata-filter-selector.tsx
+++ b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-filter/metadata-filter-selector.tsx
@@ -65,7 +65,7 @@ const MetadataFilterSelector = ({
{selectedOption.value}
<span aria-hidden className="i-ri-arrow-down-s-line size-3.5" />
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-70 p-1">
+ <DropdownMenuContent className="w-70 p-1">
<DropdownMenuRadioGroup value={value} onValueChange={onSelect}>
{visibleOptions.map((option) => (
<DropdownMenuRadioItem
diff --git a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-trigger.tsx b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-trigger.tsx
index 665e6e13c1d..94b7412a0a4 100644
--- a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-trigger.tsx
+++ b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-trigger.tsx
@@ -50,11 +50,7 @@ const MetadataTrigger = ({
</Button>
}
/>
- <PopoverContent
- placement="left"
- sideOffset={4}
- className="border-none bg-transparent shadow-none"
- >
+ <PopoverContent side="left" sideOffset={4} className="border-none bg-transparent shadow-none">
<MetadataPanel
metadataFilteringConditions={metadataFilteringConditions}
onCancel={() => setOpen(false)}
diff --git a/web/app/components/workflow/nodes/knowledge-retrieval/components/retrieval-config.tsx b/web/app/components/workflow/nodes/knowledge-retrieval/components/retrieval-config.tsx
index da632c31f8c..a1bc50aa98e 100644
--- a/web/app/components/workflow/nodes/knowledge-retrieval/components/retrieval-config.tsx
+++ b/web/app/components/workflow/nodes/knowledge-retrieval/components/retrieval-config.tsx
@@ -136,7 +136,7 @@ const RetrievalConfig: FC<Props> = ({
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={0}
alignOffset={-2}
className="border-none bg-transparent shadow-none"
diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-importer.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-importer.tsx
index af1b09bd97f..d08ec3033c1 100644
--- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-importer.tsx
+++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-importer.tsx
@@ -82,7 +82,7 @@ const JsonImporter: FC<JsonImporterProps> = ({ onSubmit, updateBtnWidth }) => {
</span>
</PopoverTrigger>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={4}
alignOffset={16}
className="border-none bg-transparent shadow-none"
diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx
index 4d7343246ee..2ec284f8530 100644
--- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx
+++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx
@@ -235,7 +235,7 @@ function JsonSchemaConfigContent({ defaultSchema, onSave }: JsonSchemaConfigProp
</TabsList>
<div className="flex items-center gap-x-0.5">
{/* JSON Schema Generator */}
- <JsonSchemaGenerator crossAxisOffset={btnWidth} onApply={handleApplySchema} />
+ <JsonSchemaGenerator alignOffset={btnWidth} onApply={handleApplySchema} />
<Separator decorative orientation="vertical" className="mx-2 h-3" />
{/* JSON Schema Importer */}
<JsonImporter updateBtnWidth={updateBtnWidth} onSubmit={handleSubmit} />
diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/index.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/index.tsx
index 2482398293c..b8e566df4e9 100644
--- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/index.tsx
+++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/index.tsx
@@ -1,3 +1,4 @@
+import type { PopoverContentProps } from '@langgenius/dify-ui/popover'
import type { SchemaRoot } from '../../../types'
import type { FormValue } from '@/app/components/header/account-setting/model-provider-page/declarations'
import type { CompletionParams, Model } from '@/types/app'
@@ -19,9 +20,8 @@ import { SchemaGeneratorDark, SchemaGeneratorLight } from './assets'
import GeneratedResult from './generated-result'
import PromptEditor from './prompt-editor'
-type JsonSchemaGeneratorProps = {
+type JsonSchemaGeneratorProps = Pick<PopoverContentProps, 'alignOffset'> & {
onApply: (schema: SchemaRoot) => void
- crossAxisOffset?: number
}
const GENERATOR_VIEWS = {
@@ -38,7 +38,7 @@ const createEmptyModel = (): Model => ({
completion_params: {} as CompletionParams,
})
-export function JsonSchemaGenerator({ onApply, crossAxisOffset }: JsonSchemaGeneratorProps) {
+export function JsonSchemaGenerator({ onApply, alignOffset }: JsonSchemaGeneratorProps) {
const { t } = useTranslation(['workflowModels'])
const [open, setOpen] = useState(false)
const [view, setView] = useState<GeneratorView>(GENERATOR_VIEWS.promptEditor)
@@ -161,9 +161,9 @@ export function JsonSchemaGenerator({ onApply, crossAxisOffset }: JsonSchemaGene
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={4}
- alignOffset={crossAxisOffset ?? 0}
+ alignOffset={alignOffset}
className="border-none bg-transparent shadow-none"
>
{view === GENERATOR_VIEWS.promptEditor && (
diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/type-selector.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/type-selector.tsx
index a18b992a5cb..f489368f64f 100644
--- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/type-selector.tsx
+++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/type-selector.tsx
@@ -38,7 +38,7 @@ const TypeSelector: FC<TypeSelectorProps> = ({ items, currentValue, onSelect })
<SelectValue className="system-xs-medium text-text-tertiary" />
</SelectTrigger>
<SelectPortal>
- <SelectPositioner sideOffset={4}>
+ <SelectPositioner>
<SelectPopup className="w-40 rounded-xl border-[0.5px] p-1 shadow-lg shadow-shadow-shadow-5">
<SelectList className="p-0">
{items.map((item) => (
diff --git a/web/app/components/workflow/nodes/loop/components/condition-add.tsx b/web/app/components/workflow/nodes/loop/components/condition-add.tsx
index 7e18781bcbe..319b3ceee80 100644
--- a/web/app/components/workflow/nodes/loop/components/condition-add.tsx
+++ b/web/app/components/workflow/nodes/loop/components/condition-add.tsx
@@ -42,7 +42,7 @@ const ConditionAdd = ({ className, variables, onSelectVariable, disabled }: Cond
/>
<PopoverContent
initialFocus={searchInputRef}
- placement="bottom-start"
+ align="start"
sideOffset={4}
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
>
diff --git a/web/app/components/workflow/nodes/loop/components/condition-list/condition-operator.tsx b/web/app/components/workflow/nodes/loop/components/condition-list/condition-operator.tsx
index 4db08c71309..a78713ef4d0 100644
--- a/web/app/components/workflow/nodes/loop/components/condition-list/condition-operator.tsx
+++ b/web/app/components/workflow/nodes/loop/components/condition-list/condition-operator.tsx
@@ -64,11 +64,7 @@ const ConditionOperator = ({
: t(($) => $[`${i18nPrefix}.select`], { ns: 'workflowLogic' })}
<RiArrowDownSLine className="size-3.5" />
</DropdownMenuTrigger>
- <DropdownMenuContent
- placement="bottom-end"
- sideOffset={4}
- className="rounded-xl border-[0.5px] bg-components-panel-bg-blur p-1"
- >
+ <DropdownMenuContent className="rounded-xl border-[0.5px] bg-components-panel-bg-blur p-1">
<DropdownMenuRadioGroup value={selectedOption?.value} onValueChange={onSelect}>
{options.map((option) => (
<DropdownMenuRadioItem
diff --git a/web/app/components/workflow/nodes/loop/components/condition-list/condition-var-selector.tsx b/web/app/components/workflow/nodes/loop/components/condition-list/condition-var-selector.tsx
index e7039950c2b..f0126ef5ba2 100644
--- a/web/app/components/workflow/nodes/loop/components/condition-list/condition-var-selector.tsx
+++ b/web/app/components/workflow/nodes/loop/components/condition-list/condition-var-selector.tsx
@@ -47,7 +47,7 @@ const ConditionVarSelector = ({
/>
<PopoverContent
initialFocus={searchInputRef}
- placement="bottom-start"
+ align="start"
sideOffset={4}
className="border-none bg-transparent p-0 shadow-none backdrop-blur-none"
>
diff --git a/web/app/components/workflow/nodes/loop/components/condition-number-input.tsx b/web/app/components/workflow/nodes/loop/components/condition-number-input.tsx
index e62314e9e61..6cdde2f37e3 100644
--- a/web/app/components/workflow/nodes/loop/components/condition-number-input.tsx
+++ b/web/app/components/workflow/nodes/loop/components/condition-number-input.tsx
@@ -61,7 +61,7 @@ const ConditionNumberInput = ({
<RiArrowDownSLine className="size-3.5" />
</DropdownMenuTrigger>
<DropdownMenuContent
- placement="bottom-start"
+ align="start"
sideOffset={2}
className="w-28 rounded-xl border-[0.5px] bg-components-panel-bg-blur p-1"
>
@@ -109,7 +109,7 @@ const ConditionNumberInput = ({
</PopoverTrigger>
<PopoverContent
initialFocus={searchInputRef}
- placement="bottom-start"
+ align="start"
sideOffset={2}
className="border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/workflow/nodes/parameter-extractor/components/extract-parameter/import-from-tool.tsx b/web/app/components/workflow/nodes/parameter-extractor/components/extract-parameter/import-from-tool.tsx
index d827dc07b37..7ff5ebc700f 100644
--- a/web/app/components/workflow/nodes/parameter-extractor/components/extract-parameter/import-from-tool.tsx
+++ b/web/app/components/workflow/nodes/parameter-extractor/components/extract-parameter/import-from-tool.tsx
@@ -94,7 +94,8 @@ const ImportFromTool: FC<Props> = ({ onImport }) => {
return (
<BlockSelector
- placement="bottom-end"
+ side="bottom"
+ align="end"
sideOffset={4}
alignOffset={52}
trigger={triggerElement}
diff --git a/web/app/components/workflow/nodes/trigger-webhook/panel.tsx b/web/app/components/workflow/nodes/trigger-webhook/panel.tsx
index 9e323d5a16a..4f4baf1baa6 100644
--- a/web/app/components/workflow/nodes/trigger-webhook/panel.tsx
+++ b/web/app/components/workflow/nodes/trigger-webhook/panel.tsx
@@ -212,7 +212,7 @@ const Panel: FC<NodePanelProps<WebhookTriggerNodeType>> = ({ id, data }) => {
</button>
}
/>
- <TooltipContent placement="bottom" sideOffset={4}>
+ <TooltipContent side="bottom" sideOffset={4}>
{debugUrlCopied
? t(($) => $[`${i18nPrefix}.debugUrlCopied`], { ns: 'workflowIntegrations' })
: t(($) => $[`${i18nPrefix}.debugUrlCopy`], { ns: 'workflowIntegrations' })}
diff --git a/web/app/components/workflow/nodes/variable-assigner/components/add-variable/index.tsx b/web/app/components/workflow/nodes/variable-assigner/components/add-variable/index.tsx
index 4c799613308..631be8b2340 100644
--- a/web/app/components/workflow/nodes/variable-assigner/components/add-variable/index.tsx
+++ b/web/app/components/workflow/nodes/variable-assigner/components/add-variable/index.tsx
@@ -70,7 +70,7 @@ const AddVariable = ({
/>
<PopoverContent
ref={popupRef}
- placement="right"
+ side="right"
sideOffset={4}
className="border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/workflow/note-node/note-editor/toolbar/color-picker.tsx b/web/app/components/workflow/note-node/note-editor/toolbar/color-picker.tsx
index adb55bbfc24..22e8fbb396d 100644
--- a/web/app/components/workflow/note-node/note-editor/toolbar/color-picker.tsx
+++ b/web/app/components/workflow/note-node/note-editor/toolbar/color-picker.tsx
@@ -59,11 +59,7 @@ const ColorPicker = ({ theme, onThemeChange }: ColorPickerProps) => {
</button>
}
/>
- <PopoverContent
- placement="top"
- sideOffset={4}
- className="border-none bg-transparent shadow-none"
- >
+ <PopoverContent side="top" sideOffset={4} className="border-none bg-transparent shadow-none">
<div className="grid grid-cols-3 grid-rows-2 gap-0.5 rounded-lg border-[0.5px] border-components-actionbar-border bg-components-actionbar-bg p-0.5 shadow-lg">
{COLOR_LIST.map((color) => (
<div
diff --git a/web/app/components/workflow/note-node/note-editor/toolbar/font-size-selector.tsx b/web/app/components/workflow/note-node/note-editor/toolbar/font-size-selector.tsx
index 7c36e13c9a0..a32cf30ab79 100644
--- a/web/app/components/workflow/note-node/note-editor/toolbar/font-size-selector.tsx
+++ b/web/app/components/workflow/note-node/note-editor/toolbar/font-size-selector.tsx
@@ -43,7 +43,7 @@ const FontSizeSelector = () => {
}
/>
<PopoverContent
- placement="bottom-start"
+ align="start"
sideOffset={2}
className="border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/workflow/note-node/note-editor/toolbar/operator.tsx b/web/app/components/workflow/note-node/note-editor/toolbar/operator.tsx
index 8789e975266..c6c97a7997f 100644
--- a/web/app/components/workflow/note-node/note-editor/toolbar/operator.tsx
+++ b/web/app/components/workflow/note-node/note-editor/toolbar/operator.tsx
@@ -75,7 +75,7 @@ const Operator = ({
<span aria-hidden className="i-ri-more-fill size-4" />
</DropdownMenuTrigger>
<DropdownMenuPortal>
- <DropdownMenuPositioner placement="bottom-end" sideOffset={4}>
+ <DropdownMenuPositioner align="end">
<DropdownMenuPopup
finalFocus={() => (deletingRef.current ? (flowStore.getState().domNode ?? true) : true)}
onKeyDown={(event) =>
diff --git a/web/app/components/workflow/operator/add-block.tsx b/web/app/components/workflow/operator/add-block.tsx
index bd3228b7bdc..1ef11483994 100644
--- a/web/app/components/workflow/operator/add-block.tsx
+++ b/web/app/components/workflow/operator/add-block.tsx
@@ -105,7 +105,7 @@ const AddBlock = ({
onOpenChange={handleOpenChange}
disabled={nodesReadOnly}
onSelect={handleSelect}
- placement="right-start"
+ align="start"
sideOffset={sideOffset ?? 4}
alignOffset={alignOffset ?? -8}
trigger={renderTrigger || renderTriggerElement}
diff --git a/web/app/components/workflow/operator/export-image.tsx b/web/app/components/workflow/operator/export-image.tsx
index 3bc4e367794..7960780487b 100644
--- a/web/app/components/workflow/operator/export-image.tsx
+++ b/web/app/components/workflow/operator/export-image.tsx
@@ -170,7 +170,7 @@ const ExportImage = memo(() => {
}
/>
</TipPopup>
- <DropdownMenuContent placement="right-end" className="min-w-45">
+ <DropdownMenuContent side="right" className="min-w-45">
<DropdownMenuGroup>
<DropdownMenuGroupLabel>
{t(($) => $['common.currentView'], { ns: 'workflow' })}
diff --git a/web/app/components/workflow/operator/zoom-in-out.tsx b/web/app/components/workflow/operator/zoom-in-out.tsx
index bef66cd24b8..1c85d36f3a9 100644
--- a/web/app/components/workflow/operator/zoom-in-out.tsx
+++ b/web/app/components/workflow/operator/zoom-in-out.tsx
@@ -192,7 +192,7 @@ const ZoomInOut: FC<ZoomInOutProps> = ({
{Number.parseFloat(`${zoom * 100}`).toFixed(0)}%
</DropdownMenuTrigger>
<DropdownMenuPortal>
- <DropdownMenuPositioner placement="top-start" sideOffset={4} alignOffset={-2}>
+ <DropdownMenuPositioner side="top" align="start" alignOffset={-2}>
<DropdownMenuPopup
onKeyDown={(event) => {
if (workflowReadOnly) return
diff --git a/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal-trigger.tsx b/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal-trigger.tsx
index 193f9e6b6bc..53e071d24ce 100644
--- a/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal-trigger.tsx
+++ b/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal-trigger.tsx
@@ -39,8 +39,8 @@ const VariableModalTrigger = ({ open, setOpen, showTip, chatVar, onClose, onSave
}
/>
<PopoverContent
- placement="left-start"
- sideOffset={8}
+ side="left"
+ align="start"
alignOffset={showTip ? -278 : -48}
className="border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/workflow/panel/chat-variable-panel/components/variable-type-select.tsx b/web/app/components/workflow/panel/chat-variable-panel/components/variable-type-select.tsx
index a91ee9e1f97..84936c72732 100644
--- a/web/app/components/workflow/panel/chat-variable-panel/components/variable-type-select.tsx
+++ b/web/app/components/workflow/panel/chat-variable-panel/components/variable-type-select.tsx
@@ -69,10 +69,7 @@ const VariableTypeSelector = <T extends string>({
/>
</div>
</SelectTrigger>
- <SelectContent
- placement="bottom-start"
- className={cn('bg-components-panel-bg-blur', popupClassName)}
- >
+ <SelectContent className={cn('bg-components-panel-bg-blur', popupClassName)}>
{list.map((item) => (
<SelectItem
key={item}
diff --git a/web/app/components/workflow/panel/env-panel/variable-trigger.tsx b/web/app/components/workflow/panel/env-panel/variable-trigger.tsx
index f55d40d6f9d..f3fbed748d7 100644
--- a/web/app/components/workflow/panel/env-panel/variable-trigger.tsx
+++ b/web/app/components/workflow/panel/env-panel/variable-trigger.tsx
@@ -38,8 +38,8 @@ const VariableTrigger = ({ open, setOpen, env, onClose, onSave }: Props) => {
}
/>
<PopoverContent
- placement="left-start"
- sideOffset={8}
+ side="left"
+ align="start"
alignOffset={-104}
className="border-none bg-transparent shadow-none"
>
diff --git a/web/app/components/workflow/panel/version-history-panel/action-menu/index.tsx b/web/app/components/workflow/panel/version-history-panel/action-menu/index.tsx
index dfc091c393c..bf73240ba05 100644
--- a/web/app/components/workflow/panel/version-history-panel/action-menu/index.tsx
+++ b/web/app/components/workflow/panel/version-history-panel/action-menu/index.tsx
@@ -202,11 +202,7 @@ function ActionMenu(props: ActionMenuProps) {
</IconButton>
}
/>
- <DropdownMenuContent
- placement="bottom-end"
- sideOffset={4}
- className="w-max max-w-[calc(100vw-24px)] min-w-46 shadow-shadow-shadow-5"
- >
+ <DropdownMenuContent className="w-max max-w-[calc(100vw-24px)] min-w-46 shadow-shadow-shadow-5">
{options.map((option) => (
<ActionMenuItem key={option.key} item={option} onClick={handleAction} />
))}
diff --git a/web/app/components/workflow/panel/version-history-panel/filter/index.tsx b/web/app/components/workflow/panel/version-history-panel/filter/index.tsx
index 5f9bd665df6..0271f8a07e3 100644
--- a/web/app/components/workflow/panel/version-history-panel/filter/index.tsx
+++ b/web/app/components/workflow/panel/version-history-panel/filter/index.tsx
@@ -52,7 +52,7 @@ const Filter: FC<FilterProps> = ({
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={4}
alignOffset={55}
className="border-none bg-transparent shadow-none"
diff --git a/web/app/components/workflow/run/agent-log/agent-log-nav-more.tsx b/web/app/components/workflow/run/agent-log/agent-log-nav-more.tsx
index 2748e05a9eb..49712f0e60f 100644
--- a/web/app/components/workflow/run/agent-log/agent-log-nav-more.tsx
+++ b/web/app/components/workflow/run/agent-log/agent-log-nav-more.tsx
@@ -29,12 +29,7 @@ const AgentLogNavMore = ({ options, onShowAgentOrToolLog }: AgentLogNavMoreProps
</IconButton>
}
/>
- <DropdownMenuContent
- placement="bottom-start"
- sideOffset={2}
- alignOffset={-54}
- className="w-34 p-1"
- >
+ <DropdownMenuContent align="start" sideOffset={2} alignOffset={-54} className="w-34 p-1">
{options.map((option) => (
<DropdownMenuItem
key={option.message_id}
diff --git a/web/app/components/workflow/variable-inspect/listening.tsx b/web/app/components/workflow/variable-inspect/listening.tsx
index b3422ce209e..a0b237d6ffc 100644
--- a/web/app/components/workflow/variable-inspect/listening.tsx
+++ b/web/app/components/workflow/variable-inspect/listening.tsx
@@ -210,7 +210,7 @@ const Listening: FC<ListeningProps> = ({ onStop, message }) => {
</button>
}
/>
- <TooltipContent placement="top">
+ <TooltipContent>
{debugUrlCopied
? t(($) => $['nodes.triggerWebhook.debugUrlCopied'], { ns: 'workflowIntegrations' })
: t(($) => $['nodes.triggerWebhook.debugUrlCopy'], { ns: 'workflowIntegrations' })}
diff --git a/web/app/components/workflow/workflow-preview/components/zoom-in-out.tsx b/web/app/components/workflow/workflow-preview/components/zoom-in-out.tsx
index 7ced2a9e435..89559c59082 100644
--- a/web/app/components/workflow/workflow-preview/components/zoom-in-out.tsx
+++ b/web/app/components/workflow/workflow-preview/components/zoom-in-out.tsx
@@ -112,7 +112,7 @@ const ZoomInOut: FC = () => {
{Number.parseFloat(`${zoom * 100}`).toFixed(0)}%
</DropdownMenuTrigger>
<DropdownMenuPortal>
- <DropdownMenuPositioner placement="top-start" sideOffset={4} alignOffset={-2}>
+ <DropdownMenuPositioner side="top" align="start" alignOffset={-2}>
<DropdownMenuPopup>
<div className="w-36.25 rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur shadow-lg backdrop-blur-[5px]">
{zoomOptions.map((options, groupIndex) => (
diff --git a/web/app/signin/_locale-menu.tsx b/web/app/signin/_locale-menu.tsx
index a768f069e14..1e2f91da6a8 100644
--- a/web/app/signin/_locale-menu.tsx
+++ b/web/app/signin/_locale-menu.tsx
@@ -43,7 +43,7 @@ export default function LocaleMenu<T extends string>({
</DropdownMenuTrigger>
</div>
</div>
- <DropdownMenuContent placement="bottom-end" sideOffset={8} className="w-50">
+ <DropdownMenuContent sideOffset={8} className="w-50">
<DropdownMenuRadioGroup<T>
value={value}
onValueChange={(nextValue) => onChange?.(nextValue)}
diff --git a/web/app/signin/one-more-step.tsx b/web/app/signin/one-more-step.tsx
index 73cd12568f7..5be904d2a60 100644
--- a/web/app/signin/one-more-step.tsx
+++ b/web/app/signin/one-more-step.tsx
@@ -144,7 +144,7 @@ const OneMoreStep = () => {
}
/>
<PopoverContent
- placement="top"
+ side="top"
className="w-[256px] px-3 py-2 text-xs font-medium text-text-tertiary"
>
<div>
diff --git a/web/features/agent-v2/agent-detail/configure/components/community-edition-tip.tsx b/web/features/agent-v2/agent-detail/configure/components/community-edition-tip.tsx
index 14f39f44bf5..d7e0e07f86b 100644
--- a/web/features/agent-v2/agent-detail/configure/components/community-edition-tip.tsx
+++ b/web/features/agent-v2/agent-detail/configure/components/community-edition-tip.tsx
@@ -6,7 +6,7 @@ import { Popover, PopoverContent, PopoverTrigger } from '@langgenius/dify-ui/pop
import { useSuspenseQuery } from '@tanstack/react-query'
import { systemFeaturesQueryOptions } from '@/features/system-features/client'
-type CommunityEditionTipProps = Pick<PopoverContentProps, 'className' | 'placement'> & {
+type CommunityEditionTipProps = Pick<PopoverContentProps, 'className' | 'side' | 'align'> & {
tip: string
}
@@ -15,11 +15,7 @@ type CommunityEditionTipProps = Pick<PopoverContentProps, 'className' | 'placeme
* Renders nothing on enterprise or cloud deployments, so callers do not repeat
* the edition check.
*/
-export function CommunityEditionTip({
- tip,
- placement = 'bottom',
- className,
-}: CommunityEditionTipProps) {
+export function CommunityEditionTip({ tip, side, align, className }: CommunityEditionTipProps) {
const { data: deploymentEdition } = useSuspenseQuery({
...systemFeaturesQueryOptions(),
select: ({ deployment_edition }) => deployment_edition,
@@ -47,7 +43,8 @@ export function CommunityEditionTip({
}
/>
<PopoverContent
- placement={placement}
+ side={side}
+ align={align}
className={cn('px-3 py-2 system-xs-regular text-text-tertiary', className)}
>
{tip}
diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/advanced/env.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/advanced/env.tsx
index f623866d281..abc97628f75 100644
--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/advanced/env.tsx
+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/advanced/env.tsx
@@ -116,7 +116,7 @@ function EnvEditorScope({
>
{t(($) => $[scopeLabelKeys[scope]])}
</SelectTrigger>
- <SelectContent placement="bottom-start" className="min-w-24">
+ <SelectContent className="min-w-24">
{envScopeOptions.map((option) => (
<SelectItem<EnvScope> key={option} value={option} className="h-7 system-xs-regular">
<SelectItemText>{t(($) => $[scopeLabelKeys[option]])}</SelectItemText>
diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/model-config/field.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/model-config/field.tsx
index dccd1afe9ee..559038876ee 100644
--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/model-config/field.tsx
+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/model-config/field.tsx
@@ -73,7 +73,8 @@ export function AgentModelField({ currentModel, onSelect }: AgentModelFieldProps
showModelMeta={false}
modelPredicate={isAgentCompatibleModel}
modelSuggestionPredicate={isAgentSuggestedModel}
- placement="bottom-end"
+ side="bottom"
+ align="end"
setModel={({ modelId, provider, plugin_id }) => {
onSelect({
provider,
diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/index.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/index.tsx
index 212a11131ee..cbae7c98729 100644
--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/index.tsx
+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/index.tsx
@@ -414,7 +414,7 @@ function WorkspaceAgentSkillItem({
>
<span aria-hidden className="i-ri-more-fill size-4" />
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-48">
+ <DropdownMenuContent className="w-48">
<DropdownMenuItem className="gap-2" onClick={handleOpenInLibrary}>
<span
aria-hidden
@@ -726,7 +726,7 @@ export function AgentSkills() {
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={4}
className={
addMenuView === 'menu'
diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/item.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/item.tsx
index 8daafb8bfa8..d2c2c0d8037 100644
--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/item.tsx
+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/item.tsx
@@ -179,7 +179,7 @@ export function AgentSkillItem({
>
<span aria-hidden className="i-ri-more-fill size-4" />
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-48">
+ <DropdownMenuContent className="w-48">
{!skill.isMissing && onDownloadSkill && (
<DropdownMenuItem className="gap-2" onClick={onDownloadSkill}>
<span
diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/tools/index.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/tools/index.tsx
index df35738f0bb..274c4b7dd85 100644
--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/tools/index.tsx
+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/tools/index.tsx
@@ -349,7 +349,8 @@ function AddToolMenu({
}
/>
<PopoverContent
- placement="top-end"
+ side="top"
+ align="end"
sideOffset={4}
className={
view === 'menu'
diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/tools/provider-tool/item.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/tools/provider-tool/item.tsx
index b0c8db14352..080f85cbea3 100644
--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/tools/provider-tool/item.tsx
+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/tools/provider-tool/item.tsx
@@ -112,7 +112,7 @@ function UnauthorizedCredentialStatus({
isOpen={isOpen}
onOpenChange={setIsOpen}
sideOffset={4}
- placement="bottom-end"
+ align="end"
triggerPopupSameWidth={false}
popupClassName="w-[360px]"
disableSetDefault
@@ -336,7 +336,7 @@ export const AgentProviderToolItem = memo(
</span>
<span aria-hidden className="i-ri-more-fill size-4" />
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-44">
+ <DropdownMenuContent className="w-44">
<DropdownMenuItem
variant="destructive"
className="gap-2"
diff --git a/web/features/agent-v2/agent-detail/configure/components/preview/build-chat.tsx b/web/features/agent-v2/agent-detail/configure/components/preview/build-chat.tsx
index f8a43cf2035..798a0cc446e 100644
--- a/web/features/agent-v2/agent-detail/configure/components/preview/build-chat.tsx
+++ b/web/features/agent-v2/agent-detail/configure/components/preview/build-chat.tsx
@@ -57,11 +57,7 @@ function AgentBuildChatEmptyState({
<div className="min-w-0 truncate system-md-medium text-text-secondary">
{t(($) => $['agentDetail.configure.build.empty.title'])}
</div>
- <CommunityEditionTip
- tip={communityEditionBuildModeTip}
- placement="top"
- className="max-w-85"
- />
+ <CommunityEditionTip tip={communityEditionBuildModeTip} side="top" className="max-w-85" />
</div>
<p className="mt-1 max-w-full body-md-regular text-text-tertiary">
{t(($) => $['agentDetail.configure.build.empty.description'])}
diff --git a/web/features/agent-v2/agent-detail/configure/components/preview/header.tsx b/web/features/agent-v2/agent-detail/configure/components/preview/header.tsx
index 0ca53d5413b..5ca7a67651d 100644
--- a/web/features/agent-v2/agent-detail/configure/components/preview/header.tsx
+++ b/web/features/agent-v2/agent-detail/configure/components/preview/header.tsx
@@ -54,7 +54,6 @@ function ModeInfoTip({ children, ariaLabel }: { children: ReactNode; ariaLabel:
/>
</PopoverTrigger>
<PopoverContent
- placement="bottom"
sideOffset={2}
className="w-60 max-w-60 rounded-xl bg-components-tooltip-bg px-4 py-3.5 text-start text-text-secondary backdrop-blur-[5px]"
>
@@ -98,7 +97,6 @@ function PreviewModeItem({
{item}
</PopoverTrigger>
<PopoverContent
- placement="bottom"
sideOffset={6}
className="max-w-65 rounded-md bg-components-tooltip-bg px-3 py-2 system-xs-regular text-text-tertiary shadow-lg"
>
diff --git a/web/features/agent-v2/agent-detail/configure/components/preview/versions-panel/filter.tsx b/web/features/agent-v2/agent-detail/configure/components/preview/versions-panel/filter.tsx
index 8e8891db771..cd88fcc96df 100644
--- a/web/features/agent-v2/agent-detail/configure/components/preview/versions-panel/filter.tsx
+++ b/web/features/agent-v2/agent-detail/configure/components/preview/versions-panel/filter.tsx
@@ -61,7 +61,7 @@ export function VersionFilter({
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={4}
alignOffset={55}
className="border-none bg-transparent shadow-none"
diff --git a/web/features/agent-v2/agent-detail/configure/components/preview/versions-panel/version-item.tsx b/web/features/agent-v2/agent-detail/configure/components/preview/versions-panel/version-item.tsx
index 807cfd77b3a..4a4940a1124 100644
--- a/web/features/agent-v2/agent-detail/configure/components/preview/versions-panel/version-item.tsx
+++ b/web/features/agent-v2/agent-detail/configure/components/preview/versions-panel/version-item.tsx
@@ -113,7 +113,7 @@ export function VersionItem({
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" className="min-w-40">
+ <DropdownMenuContent className="min-w-40">
{onRestore && (
<DropdownMenuItem
disabled={restoreDisabled}
diff --git a/web/features/agent-v2/agent-detail/configure/components/preview/working-directory-breadcrumb.tsx b/web/features/agent-v2/agent-detail/configure/components/preview/working-directory-breadcrumb.tsx
index 54402dc5299..af17962932d 100644
--- a/web/features/agent-v2/agent-detail/configure/components/preview/working-directory-breadcrumb.tsx
+++ b/web/features/agent-v2/agent-detail/configure/components/preview/working-directory-breadcrumb.tsx
@@ -161,11 +161,7 @@ export function AgentWorkingDirectoryBreadcrumb({
</IconButton>
}
/>
- <DropdownMenuContent
- placement="bottom-start"
- sideOffset={4}
- className="w-34 p-1"
- >
+ <DropdownMenuContent align="start" className="w-34 p-1">
{hiddenItems.map((hiddenItem) => (
<DropdownMenuItem
key={hiddenItem.path}
diff --git a/web/features/agent-v2/agent-detail/navigation.tsx b/web/features/agent-v2/agent-detail/navigation.tsx
index 7c6a038ac95..37d26908a45 100644
--- a/web/features/agent-v2/agent-detail/navigation.tsx
+++ b/web/features/agent-v2/agent-detail/navigation.tsx
@@ -141,7 +141,7 @@ export function AgentDetailTop({ expand = true, onToggle }: AgentDetailTopProps)
/>
}
/>
- <TooltipContent placement="bottom" className="flex items-center gap-1">
+ <TooltipContent side="bottom" className="flex items-center gap-1">
<span className="px-0.5">{tApp(($) => $['gotoAnything.quickAction'])}</span>
<KbdGroup>
{formatForDisplay(GOTO_ANYTHING_HOTKEY, { parts: true }).map((key) => (
diff --git a/web/features/agent-v2/agent-detail/sidebar-actions.tsx b/web/features/agent-v2/agent-detail/sidebar-actions.tsx
index 8e2360b5f48..458f49f6ed6 100644
--- a/web/features/agent-v2/agent-detail/sidebar-actions.tsx
+++ b/web/features/agent-v2/agent-detail/sidebar-actions.tsx
@@ -82,7 +82,7 @@ export function AgentDetailSidebarActions({ agent }: { agent: AgentDetailSidebar
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-max min-w-40">
+ <DropdownMenuContent className="w-max min-w-40">
{capabilities.canEdit && (
<DropdownMenuItem className="gap-2" onClick={handleEditOpen}>
<span aria-hidden className="i-ri-edit-line size-4 shrink-0 text-text-tertiary" />
diff --git a/web/features/agent-v2/roster/components/agent-roster-list.tsx b/web/features/agent-v2/roster/components/agent-roster-list.tsx
index 39d34e3f0df..0e0ca2f72cb 100644
--- a/web/features/agent-v2/roster/components/agent-roster-list.tsx
+++ b/web/features/agent-v2/roster/components/agent-roster-list.tsx
@@ -379,7 +379,7 @@ function AgentRosterItem({ agent }: { agent: AgentAppPartial }) {
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-max min-w-40">
+ <DropdownMenuContent className="w-max min-w-40">
<AgentCardActionMenuItems
kind="dropdown"
isExporting={isExporting}
diff --git a/web/features/agent-v2/roster/components/agent-workflow-references-dropdown.tsx b/web/features/agent-v2/roster/components/agent-workflow-references-dropdown.tsx
index 9b4048c55fa..ddbd192c05e 100644
--- a/web/features/agent-v2/roster/components/agent-workflow-references-dropdown.tsx
+++ b/web/features/agent-v2/roster/components/agent-workflow-references-dropdown.tsx
@@ -39,7 +39,7 @@ export function AgentWorkflowReferencesDropdown({
</span>
<span className="system-xs-regular text-text-tertiary">{referenceCount}</span>
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-start" sideOffset={4} className="w-66 p-1">
+ <DropdownMenuContent align="start" className="w-66 p-1">
<DropdownMenuGroup>
<DropdownMenuGroupLabel className="flex w-full min-w-0 truncate pt-2 pr-3 pb-1.5 pl-2 system-xs-medium normal-case">
{t(($) => $['roster.references.label'], { ns: 'agentRoster', name: agentName })}
diff --git a/web/features/app-access-error/locale-menu.tsx b/web/features/app-access-error/locale-menu.tsx
index fca5473bb30..7572fff1e6f 100644
--- a/web/features/app-access-error/locale-menu.tsx
+++ b/web/features/app-access-error/locale-menu.tsx
@@ -37,7 +37,7 @@ export default function LocaleMenu({
<span className="truncate">{selectedLanguageName}</span>
<span aria-hidden className="i-ri-arrow-down-s-line size-4 shrink-0" />
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-end" className="max-h-80 w-60 overflow-y-auto">
+ <DropdownMenuContent className="max-h-80 w-60 overflow-y-auto">
<DropdownMenuRadioGroup<Locale>
value={locale}
onValueChange={(value) => {
diff --git a/web/features/network-access/app-binding/index.tsx b/web/features/network-access/app-binding/index.tsx
index 7bad567f77d..69166f251b7 100644
--- a/web/features/network-access/app-binding/index.tsx
+++ b/web/features/network-access/app-binding/index.tsx
@@ -533,7 +533,7 @@ function AccessControlSession({
initialFocus={(interactionType) =>
interactionType === 'keyboard' || interactionType === '' ? true : panelRef.current
}
- placement="bottom-end"
+ align="end"
className="w-100 rounded-2xl border-divider-regular p-0 backdrop-blur-[5px] transition-none data-starting-style:scale-100 data-starting-style:opacity-100"
>
{showPaywall ? (
diff --git a/web/features/new-rag/documents/actions-dropdown.tsx b/web/features/new-rag/documents/actions-dropdown.tsx
index 71d79bd3b8d..cf19ada043b 100644
--- a/web/features/new-rag/documents/actions-dropdown.tsx
+++ b/web/features/new-rag/documents/actions-dropdown.tsx
@@ -354,7 +354,7 @@ export function DocumentActionsDropdown({
)}
/>
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-50">
+ <DropdownMenuContent className="w-50">
<RenameDocumentMenuItem document={document} onOpen={() => setRenameDialogOpen(true)} />
<ReprocessDocumentMenuItem document={document} />
<DownloadDocumentMenuItem document={document} />
diff --git a/web/features/new-rag/documents/list.tsx b/web/features/new-rag/documents/list.tsx
index 2d3835f1d7f..47b6495a2e0 100644
--- a/web/features/new-rag/documents/list.tsx
+++ b/web/features/new-rag/documents/list.tsx
@@ -124,7 +124,7 @@ function DocumentStatus({
</button>
}
/>
- <PopoverContent placement="top" className="max-w-80 px-3 py-2">
+ <PopoverContent side="top" className="max-w-80 px-3 py-2">
<PopoverDescription className="system-xs-regular wrap-break-word whitespace-pre-wrap text-text-tertiary">
{failureReason}
</PopoverDescription>
diff --git a/web/features/new-rag/documents/metadata/drawer.tsx b/web/features/new-rag/documents/metadata/drawer.tsx
index 5fa5fef21e5..4b2226b106b 100644
--- a/web/features/new-rag/documents/metadata/drawer.tsx
+++ b/web/features/new-rag/documents/metadata/drawer.tsx
@@ -142,7 +142,8 @@ function CreateMetadataPopover() {
}
/>
<PopoverContent
- placement="left-start"
+ side="left"
+ align="start"
sideOffset={20}
alignOffset={-38}
className="w-[320px]"
diff --git a/web/features/new-rag/documents/metadata/picker.tsx b/web/features/new-rag/documents/metadata/picker.tsx
index 756925551fd..4331d940d1f 100644
--- a/web/features/new-rag/documents/metadata/picker.tsx
+++ b/web/features/new-rag/documents/metadata/picker.tsx
@@ -78,7 +78,8 @@ export function DocumentMetadataPicker({
/>
<PopoverContent
alignOffset={4}
- placement="left-start"
+ side="left"
+ align="start"
className="w-[320px] bg-components-panel-bg-blur backdrop-blur-[5px]"
sideOffset={-38}
>
diff --git a/web/features/new-rag/list/knowledge-space-actions.tsx b/web/features/new-rag/list/knowledge-space-actions.tsx
index 37733c46392..a76cdc4be2a 100644
--- a/web/features/new-rag/list/knowledge-space-actions.tsx
+++ b/web/features/new-rag/list/knowledge-space-actions.tsx
@@ -71,7 +71,7 @@ export function KnowledgeSpaceActions({
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="min-w-46.5">
+ <DropdownMenuContent className="min-w-46.5">
{canEdit && (
<DropdownMenuLinkItem
render={<Link href={newKnowledgeSettingsPath(knowledgeSpace.control_space_id)} />}
diff --git a/web/features/new-rag/list/knowledge-view-switcher.tsx b/web/features/new-rag/list/knowledge-view-switcher.tsx
index faf1d2d3a88..922d5fef59d 100644
--- a/web/features/new-rag/list/knowledge-view-switcher.tsx
+++ b/web/features/new-rag/list/knowledge-view-switcher.tsx
@@ -72,7 +72,6 @@ export function KnowledgeViewSwitcher({ value, onChange }: KnowledgeViewSwitcher
}
/>
<PopoverContent
- placement="bottom"
sideOffset={13}
className="relative flex max-h-[calc(100dvh-2rem)] min-h-40.5 w-80 max-w-[calc(100vw-2rem)] flex-col"
>
diff --git a/web/features/new-rag/quality/bad-cases-panel.tsx b/web/features/new-rag/quality/bad-cases-panel.tsx
index f1cb41110a6..748494b1ea4 100644
--- a/web/features/new-rag/quality/bad-cases-panel.tsx
+++ b/web/features/new-rag/quality/bad-cases-panel.tsx
@@ -296,7 +296,7 @@ function BadCaseRow({
question: item.question ?? '',
})}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-50">
+ <DropdownMenuContent className="w-50">
{canEdit &&
(item.status === 'fixed' ? (
<DropdownMenuItem className="gap-2 px-3" onClick={() => onPromote(item)}>
diff --git a/web/features/new-rag/quality/golden-questions-panel.tsx b/web/features/new-rag/quality/golden-questions-panel.tsx
index 29f66ddac91..3fbf6359071 100644
--- a/web/features/new-rag/quality/golden-questions-panel.tsx
+++ b/web/features/new-rag/quality/golden-questions-panel.tsx
@@ -108,7 +108,7 @@ function GoldenAnnotation({ annotation }: { annotation: string }) {
</button>
}
/>
- <PopoverContent placement="top" className="max-w-67 px-3 py-2">
+ <PopoverContent side="top" className="max-w-67 px-3 py-2">
<p className="system-xs-regular wrap-break-word text-text-tertiary">{annotation}</p>
</PopoverContent>
</Popover>
@@ -432,7 +432,7 @@ export function GoldenQuestionsPanel({ actionSlot }: GoldenQuestionsPanelProps)
question: item.question,
})}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-50">
+ <DropdownMenuContent className="w-50">
<DropdownMenuItem
className="gap-2 px-3"
onClick={() => void openEdit(item)}
diff --git a/web/features/new-rag/retrieval/results.tsx b/web/features/new-rag/retrieval/results.tsx
index 56372061128..8a9a946b144 100644
--- a/web/features/new-rag/retrieval/results.tsx
+++ b/web/features/new-rag/retrieval/results.tsx
@@ -507,7 +507,7 @@ export function QualityActions({
<span aria-hidden className="i-ri-thumb-down-line size-4" />
{t(($) => $['retrievalTest.makeBadCase'], { ns: 'knowledgeRetrieval' })}
</DropdownMenuTrigger>
- <DropdownMenuContent placement="top-end" sideOffset={4} className="w-44">
+ <DropdownMenuContent side="top" className="w-44">
<DropdownMenuItem onClick={() => void onBadCase('low-score')}>
{t(($) => $['qualityPage.reasonValues.lowScore'], { ns: 'knowledgeSpace' })}
</DropdownMenuItem>
diff --git a/web/features/new-rag/sources/setup/sync-policy-field.tsx b/web/features/new-rag/sources/setup/sync-policy-field.tsx
index a508bbdc01e..2c7ec6198dd 100644
--- a/web/features/new-rag/sources/setup/sync-policy-field.tsx
+++ b/web/features/new-rag/sources/setup/sync-policy-field.tsx
@@ -141,7 +141,7 @@ function CustomIntervalPopover({
return (
<Popover open={open} onOpenChange={onOpenChange}>
<PopoverPortal>
- <PopoverPositioner anchor={anchorRef} placement="bottom-start" sideOffset={4}>
+ <PopoverPositioner anchor={anchorRef} align="start" sideOffset={4}>
<PopoverPopup className="w-75 rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg p-3.5 shadow-lg">
<CustomIntervalEditor
disabled={disabled}
diff --git a/web/features/new-rag/sources/source-actions.tsx b/web/features/new-rag/sources/source-actions.tsx
index 808c9935bb6..a4c28bc081c 100644
--- a/web/features/new-rag/sources/source-actions.tsx
+++ b/web/features/new-rag/sources/source-actions.tsx
@@ -253,7 +253,7 @@ export function SourceActions({
)}
/>
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-50">
+ <DropdownMenuContent className="w-50">
{canSync && (
<DropdownMenuItem
onClick={() => void (syncAction === 'retry' ? retrySource() : syncSource())}
diff --git a/web/features/new-rag/space/shell.tsx b/web/features/new-rag/space/shell.tsx
index 17ebd7098c8..bf0a22d45cb 100644
--- a/web/features/new-rag/space/shell.tsx
+++ b/web/features/new-rag/space/shell.tsx
@@ -263,7 +263,7 @@ export function KnowledgeSpaceShell({
/>
}
/>
- <TooltipContent placement="bottom" className="flex items-center gap-1">
+ <TooltipContent side="bottom" className="flex items-center gap-1">
<span className="px-0.5">{tApp(($) => $['gotoAnything.quickAction'])}</span>
<KbdGroup>
{formatForDisplay(GOTO_ANYTHING_HOTKEY, { parts: true }).map((key) => (
diff --git a/web/features/skills/detail/builder-panel.tsx b/web/features/skills/detail/builder-panel.tsx
index 59958fd0252..7687c7103b6 100644
--- a/web/features/skills/detail/builder-panel.tsx
+++ b/web/features/skills/detail/builder-panel.tsx
@@ -112,7 +112,7 @@ function BuilderModelSelector({
modelList={modelList}
modelSelectorPopupClassName="h-[480px]! max-h-[480px]! w-80! max-w-80!"
showModelMeta={false}
- placement="bottom-start"
+ align="start"
trigger={
<button
type="button"
diff --git a/web/features/skills/detail/file-tree-items.tsx b/web/features/skills/detail/file-tree-items.tsx
index 65eb023601a..8e29fd4025f 100644
--- a/web/features/skills/detail/file-tree-items.tsx
+++ b/web/features/skills/detail/file-tree-items.tsx
@@ -291,7 +291,6 @@ function FileActions({
<DropdownMenuContent
data-skill-file-menu
onKeyDown={onMenuKeyDown}
- placement="bottom-end"
className={skillFileMenuPopupClassName}
>
<FileActionMenuItems
diff --git a/web/features/skills/detail/file-tree.tsx b/web/features/skills/detail/file-tree.tsx
index 5a618a23519..29f791546b7 100644
--- a/web/features/skills/detail/file-tree.tsx
+++ b/web/features/skills/detail/file-tree.tsx
@@ -1143,7 +1143,7 @@ export function FileTree({
</button>
}
/>
- <TooltipContent placement="right">
+ <TooltipContent side="right">
{t(($) => $['skillManagement.detail.expandSidebar'])}
</TooltipContent>
</Tooltip>
@@ -1260,7 +1260,7 @@ export function FileTree({
/>
}
/>
- <TooltipContent placement="bottom" className="flex items-center gap-1">
+ <TooltipContent side="bottom" className="flex items-center gap-1">
<span className="px-0.5">{tApp(($) => $['gotoAnything.quickAction'])}</span>
<KbdGroup>
{formatForDisplay(GOTO_ANYTHING_HOTKEY, { parts: true }).map((key) => (
@@ -1292,7 +1292,7 @@ export function FileTree({
</button>
}
/>
- <TooltipContent placement="bottom">
+ <TooltipContent side="bottom">
{t(($) => $['skillManagement.detail.collapseSidebar'])}
</TooltipContent>
</Tooltip>
@@ -1364,7 +1364,6 @@ export function FileTree({
<DropdownMenuContent
data-skill-file-menu
onKeyDown={handleRootMenuKeyDown}
- placement="bottom-end"
className={skillFileMenuPopupClassName}
>
<RootFileActionMenuItems
@@ -1604,7 +1603,8 @@ export function FileTree({
}
/>
<PopoverContent
- placement="top-start"
+ side="top"
+ align="start"
sideOffset={4}
className="w-(--anchor-width) max-w-(--available-width) bg-components-panel-bg-blur p-1 shadow-shadow-shadow-5 backdrop-blur-[5px]"
aria-label={referenceCountLabel}
diff --git a/web/features/skills/detail/sidebar-actions.tsx b/web/features/skills/detail/sidebar-actions.tsx
index 96f4da35910..c4bf84b8c31 100644
--- a/web/features/skills/detail/sidebar-actions.tsx
+++ b/web/features/skills/detail/sidebar-actions.tsx
@@ -262,7 +262,7 @@ export function SkillDetailSidebarActions({
>
<span aria-hidden className="i-ri-more-fill size-4 text-text-tertiary" />
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-40">
+ <DropdownMenuContent className="w-40">
{canEdit && (
<DropdownMenuItem className="gap-2" onClick={onRename}>
<span aria-hidden className="i-ri-edit-line size-4 shrink-0 text-text-tertiary" />
diff --git a/web/features/skills/detail/skill-metadata.tsx b/web/features/skills/detail/skill-metadata.tsx
index f719c4cba5d..bb2e5b0f67b 100644
--- a/web/features/skills/detail/skill-metadata.tsx
+++ b/web/features/skills/detail/skill-metadata.tsx
@@ -242,7 +242,7 @@ export function SkillTagsEditor({
</span>
</ComboboxTrigger>
<ComboboxPortal>
- <ComboboxPositioner placement="bottom-start" sideOffset={4}>
+ <ComboboxPositioner>
<ComboboxPopup className="w-(--anchor-width) min-w-60 rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg-blur p-0 shadow-lg backdrop-blur-[5px]">
<TagSearchContentView
type="skill"
diff --git a/web/features/skills/detail/version-panel.tsx b/web/features/skills/detail/version-panel.tsx
index 3874acb5005..5d2da5c6704 100644
--- a/web/features/skills/detail/version-panel.tsx
+++ b/web/features/skills/detail/version-panel.tsx
@@ -143,7 +143,7 @@ function VersionFilter({
}
/>
<PopoverContent
- placement="bottom-end"
+ align="end"
sideOffset={4}
alignOffset={55}
className="border-none bg-transparent shadow-none"
@@ -322,7 +322,7 @@ function VersionRow({
>
<span aria-hidden className="i-ri-more-fill size-4 text-text-tertiary" />
</DropdownMenuTrigger>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-46">
+ <DropdownMenuContent className="w-46">
<DropdownMenuItem onClick={() => setRestoreOpen(true)}>
{t(($) => $['skillManagement.detail.restoreVersion'])}
</DropdownMenuItem>
diff --git a/web/features/skills/page.tsx b/web/features/skills/page.tsx
index 843842d5b8e..78726ea638d 100644
--- a/web/features/skills/page.tsx
+++ b/web/features/skills/page.tsx
@@ -549,7 +549,7 @@ function SkillCard({
</IconButton>
}
/>
- <DropdownMenuContent placement="bottom-end" sideOffset={4} className="w-40">
+ <DropdownMenuContent className="w-40">
{canEdit && (
<DropdownMenuItem className="gap-2" onClick={handleDuplicate}>
<span
diff --git a/web/features/tag-management/components/tag-filter.tsx b/web/features/tag-management/components/tag-filter.tsx
index 86a40a870bc..62cf24f3d86 100644
--- a/web/features/tag-management/components/tag-filter.tsx
+++ b/web/features/tag-management/components/tag-filter.tsx
@@ -164,7 +164,7 @@ export const TagFilter = ({
</IconButton>
)}
<ComboboxPortal {...portalProps}>
- <ComboboxPositioner placement="bottom-start" sideOffset={4}>
+ <ComboboxPositioner>
<ComboboxPopup
aria-label={triggerLabel}
className="w-60 rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg-blur p-0 shadow-lg backdrop-blur-[5px]"
diff --git a/web/features/tag-management/components/tag-selector.tsx b/web/features/tag-management/components/tag-selector.tsx
index 5d0d304ad62..80174927b1e 100644
--- a/web/features/tag-management/components/tag-selector.tsx
+++ b/web/features/tag-management/components/tag-selector.tsx
@@ -1,11 +1,5 @@
import type { TagResponse as Tag, TagType } from '@dify/contracts/api/console/tags/types.gen'
-import type {
- ComboboxPopupProps,
- ComboboxPortalProps,
- ComboboxPositionerProps,
- ComboboxProps,
- ComboboxTriggerProps,
-} from '@langgenius/dify-ui/combobox'
+import type { ComboboxProps, ComboboxTriggerProps } from '@langgenius/dify-ui/combobox'
import type { TagComboboxItem } from './tag-combobox-item'
import { cn } from '@langgenius/dify-ui/cn'
import {
@@ -55,20 +49,7 @@ type TagSelectorRootProps = Omit<
| 'onOpenChangeComplete'
| 'children'
>
-type TagSelectorContentProps = {
- placement?: ComboboxPositionerProps['placement']
- sideOffset?: ComboboxPositionerProps['sideOffset']
- alignOffset?: ComboboxPositionerProps['alignOffset']
- portalProps?: Omit<ComboboxPortalProps, 'children'>
- positionerProps?: Omit<
- ComboboxPositionerProps,
- 'alignOffset' | 'children' | 'placement' | 'sideOffset'
- >
- popupProps?: Omit<ComboboxPopupProps, 'children' | 'className'>
- popupClassName?: string
-}
export type TagSelectorProps = TagSelectorRootProps &
- TagSelectorContentProps &
Pick<ComboboxTriggerProps, 'className' | 'onClick'> & {
targetId: string
contextLabel?: string
@@ -95,13 +76,6 @@ export const TagSelector = ({
onOpenTagManagement = () => {},
onTagsChange,
onApplyTags,
- placement = 'bottom-start',
- sideOffset = 4,
- alignOffset = 0,
- portalProps,
- positionerProps,
- popupProps,
- popupClassName,
...rootProps
}: TagSelectorProps) => {
const { t } = useTranslation(['common'])
@@ -328,21 +302,12 @@ export const TagSelector = ({
className="pointer-events-none absolute top-0 right-0 h-full w-20 bg-tag-selector-mask-bg group-hover/tag-area:hidden group-focus-visible/tag-area:hidden group-data-popup-open/tag-area:hidden"
/>
</ComboboxTrigger>
- <ComboboxPortal {...portalProps}>
- <ComboboxPositioner
- placement={placement}
- sideOffset={sideOffset}
- alignOffset={alignOffset}
- {...positionerProps}
- >
+ <ComboboxPortal>
+ <ComboboxPositioner>
<ComboboxPopup
onClick={(event) => event.stopPropagation()}
aria-label={accessibleTriggerLabel}
- {...popupProps}
- className={cn(
- 'w-(--anchor-width) min-w-60 rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg-blur p-0 shadow-lg backdrop-blur-[5px]',
- popupClassName,
- )}
+ className="w-(--anchor-width) min-w-60 rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg-blur p-0 shadow-lg backdrop-blur-[5px]"
>
<TagSearchContent
type={type}