From 09719bb9cfd2dee80452fe97f7be2ce1a106229c Mon Sep 17 00:00:00 2001 From: yangdx Date: Mon, 7 Apr 2025 20:09:43 +0800 Subject: [PATCH 1/4] Fix Safari popover problem --- .../src/components/graph/LayoutsControl.tsx | 13 +++++-- .../src/components/graph/Settings.tsx | 6 ++-- lightrag_webui/src/components/ui/Popover.tsx | 36 ++++++++++++------- 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/lightrag_webui/src/components/graph/LayoutsControl.tsx b/lightrag_webui/src/components/graph/LayoutsControl.tsx index 1933ce19..c4ec67be 100644 --- a/lightrag_webui/src/components/graph/LayoutsControl.tsx +++ b/lightrag_webui/src/components/graph/LayoutsControl.tsx @@ -289,7 +289,7 @@ const LayoutsControl = () => { ) return ( - <> +
{layouts[layout] && 'worker' in layouts[layout] && ( { - + @@ -331,7 +338,7 @@ const LayoutsControl = () => {
- +
) } diff --git a/lightrag_webui/src/components/graph/Settings.tsx b/lightrag_webui/src/components/graph/Settings.tsx index 5f541e3d..758f6d58 100644 --- a/lightrag_webui/src/components/graph/Settings.tsx +++ b/lightrag_webui/src/components/graph/Settings.tsx @@ -245,8 +245,10 @@ export default function Settings() { e.preventDefault()} >
diff --git a/lightrag_webui/src/components/ui/Popover.tsx b/lightrag_webui/src/components/ui/Popover.tsx index b81456ef..d281daa4 100644 --- a/lightrag_webui/src/components/ui/Popover.tsx +++ b/lightrag_webui/src/components/ui/Popover.tsx @@ -7,20 +7,32 @@ const Popover = PopoverPrimitive.Root const PopoverTrigger = PopoverPrimitive.Trigger +// Define the props type to include positioning props +type PopoverContentProps = React.ComponentPropsWithoutRef & { + collisionPadding?: number | Partial>; + sticky?: 'partial' | 'always'; + avoidCollisions?: boolean; +}; + const PopoverContent = React.forwardRef< React.ComponentRef, - React.ComponentPropsWithoutRef ->(({ className, align = 'center', sideOffset = 4, ...props }, ref) => ( - + PopoverContentProps +>(({ className, align = 'center', sideOffset = 4, collisionPadding, sticky, avoidCollisions = false, ...props }, ref) => ( + + + )) PopoverContent.displayName = PopoverPrimitive.Content.displayName From 6a0909ea32380daf4fdf98adea485dd67d2881dc Mon Sep 17 00:00:00 2001 From: yangdx Date: Mon, 7 Apr 2025 20:24:51 +0800 Subject: [PATCH 2/4] Fix i18n direction problem --- lightrag_webui/src/features/DocumentManager.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightrag_webui/src/features/DocumentManager.tsx b/lightrag_webui/src/features/DocumentManager.tsx index ecb163c1..306d5566 100644 --- a/lightrag_webui/src/features/DocumentManager.tsx +++ b/lightrag_webui/src/features/DocumentManager.tsx @@ -158,7 +158,7 @@ export default function DocumentManager() { }, []); const [showPipelineStatus, setShowPipelineStatus] = useState(false) - const { t } = useTranslation() + const { t, i18n } = useTranslation() const health = useBackendState.use.health() const pipelineBusy = useBackendState.use.pipelineBusy() const [docs, setDocs] = useState(null) @@ -499,7 +499,7 @@ export default function DocumentManager() { {t('documentPanel.documentManager.uploadedTitle')}
-
+