From 2ee11ed4c51bf4e0a03dd8c409c74c5459a7fba4 Mon Sep 17 00:00:00 2001 From: jason Date: Wed, 29 Apr 2026 11:41:13 +0800 Subject: [PATCH 1/2] fix: add missing Popover import in DetailHeader The TagsInline component uses Popover to display hidden tags when they overflow the container width, but Popover was not imported from antd. This caused a runtime error when datasets had many tags (>5), triggering ErrorBoundary and redirecting users to homepage. Root cause: Line 3 imported Card, Button, Tag, Tooltip, Modal but missing Popover, while Popover was used at lines 193-215. Fix: Add Popover to the antd import statement. --- frontend/src/components/DetailHeader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/DetailHeader.tsx b/frontend/src/components/DetailHeader.tsx index c918944a..498f5173 100644 --- a/frontend/src/components/DetailHeader.tsx +++ b/frontend/src/components/DetailHeader.tsx @@ -1,6 +1,6 @@ import React, { useLayoutEffect, useEffect, useRef, useState, useCallback, useMemo } from "react"; import { Database } from "lucide-react"; -import { Card, Button, Tag, Tooltip, Modal } from "antd"; +import { Card, Button, Tag, Tooltip, Modal, Popover } from "antd"; import type { ItemType } from "antd/es/menu/interface"; import AddTagPopover from "./AddTagPopover"; import ActionDropdown from "./ActionDropdown"; From 7800a5ab83ca9bce2775f312c16bccbcdb2e2a83 Mon Sep 17 00:00:00 2001 From: jason Date: Wed, 29 Apr 2026 12:26:18 +0800 Subject: [PATCH 2/2] fix: correct Tag id type from number to string (UUID) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The backend returns Tag objects with UUID string IDs, but frontend components AddTagPopover and DetailHeader defined Tag interface with id: number, causing type mismatch and potential display issues. Changes: - AddTagPopover.tsx: interface Tag { id: number } → { id: string } - DetailHeader.tsx: TagConfig and TagsInline interfaces updated to id: string This aligns with: - Backend: TagResponse.java returns UUID string - dataset.model.ts: TagItem interface already correctly defines id: string --- frontend/src/components/AddTagPopover.tsx | 2 +- frontend/src/components/DetailHeader.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/AddTagPopover.tsx b/frontend/src/components/AddTagPopover.tsx index 2b240ce5..900df369 100644 --- a/frontend/src/components/AddTagPopover.tsx +++ b/frontend/src/components/AddTagPopover.tsx @@ -4,7 +4,7 @@ import { useEffect, useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; interface Tag { - id: number; + id: string; name: string; color: string; } diff --git a/frontend/src/components/DetailHeader.tsx b/frontend/src/components/DetailHeader.tsx index 498f5173..51915102 100644 --- a/frontend/src/components/DetailHeader.tsx +++ b/frontend/src/components/DetailHeader.tsx @@ -32,9 +32,9 @@ interface OperationItem { interface TagConfig { showAdd: boolean; - tags: Array<{ id: number; name: string; color: string } | string>; + tags: Array<{ id: string; name: string; color: string } | string>; onFetchTags?: () => Promise<{ - data: { id: number; name: string; color: string }[]; + data: { id: string; name: string; color: string }[]; }>; onAddTag?: (tag: string) => void; onCreateAndTag?: (tagName: string) => void; @@ -48,7 +48,7 @@ interface DetailHeaderProps { } // 标签单行渲染组件 -const TagsInline = ({ tags }: { tags: Array<{ id: number; name: string; color: string } | string> }) => { +const TagsInline = ({ tags }: { tags: Array<{ id: string; name: string; color: string } | string> }) => { const containerRef = useRef(null); const tagsAreaRef = useRef(null); const [visibleTags, setVisibleTags] = useState([]);