diff --git a/frontend-web/src/components/assistant-ui/document-upload-popup.tsx b/frontend-web/src/components/assistant-ui/document-upload-popup.tsx index 98fcdbe4..a0afd6d5 100644 --- a/frontend-web/src/components/assistant-ui/document-upload-popup.tsx +++ b/frontend-web/src/components/assistant-ui/document-upload-popup.tsx @@ -826,7 +826,13 @@ const DocumentUploadPopupContent: FC<{ )} - {listData.length === 0 && } + {isSearching ? ( +
+ +
+ ) : ( + listData.length === 0 && + )} {searchType === "human" && (
{listData.map((item: listDataItem, index: number) => { diff --git a/frontend-web/src/components/assistant-ui/network-actor.tsx b/frontend-web/src/components/assistant-ui/network-actor.tsx index 9be9cfcd..a48576cb 100644 --- a/frontend-web/src/components/assistant-ui/network-actor.tsx +++ b/frontend-web/src/components/assistant-ui/network-actor.tsx @@ -545,7 +545,12 @@ export function NetworkActor({ inputValue, searchSpaceId, onSuccess }: NetworkAc
)}
-
+ {isSearching ? ( +
+ +
+ ) : null} +
{userList.map((item, index) => (
diff --git a/frontend-web/src/pages/NotebookAIWritingPage.tsx b/frontend-web/src/pages/NotebookAIWritingPage.tsx index 8c818d68..e23e5f24 100644 --- a/frontend-web/src/pages/NotebookAIWritingPage.tsx +++ b/frontend-web/src/pages/NotebookAIWritingPage.tsx @@ -2,6 +2,9 @@ import { useEffect, useState } from 'react'; import { useSearchParams } from 'react-router-dom'; import AIWritingPage from '@/open-canvas/pages/AIWritingPage'; import { getNotebookApiBaseURL } from '@/core/config'; +import { useTheme, type ThemeType } from '@/contexts/ThemeContext'; + +const VALID_THEMES: ThemeType[] = ['dark', 'light', 'lightblue']; interface NotebookTokenData { doc_ids: number[]; @@ -13,6 +16,17 @@ interface NotebookTokenData { export default function NotebookAIWritingPage() { const [searchParams] = useSearchParams(); const token = searchParams.get('token'); + const themekey = searchParams.get('themekey'); + const { setTheme } = useTheme(); + + // 跟随调用方传入的 themekey 切换主题;缺省或非法值兜底为 light + useEffect(() => { + const next = themekey && VALID_THEMES.includes(themekey as ThemeType) + ? (themekey as ThemeType) + : 'light'; + setTheme(next); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [themekey]); const [data, setData] = useState(null); const [spaceName, setSpaceName] = useState(null); diff --git a/frontend-web/src/pages/StudioNotebookDetailPage.tsx b/frontend-web/src/pages/StudioNotebookDetailPage.tsx index b0747e85..83d367f4 100644 --- a/frontend-web/src/pages/StudioNotebookDetailPage.tsx +++ b/frontend-web/src/pages/StudioNotebookDetailPage.tsx @@ -27,6 +27,7 @@ import { fetchDocumentByChunk } from "@/core/studio/api"; import type { DocumentWithChunks } from "@/core/studio/api"; import type { SourceItem } from "@/core/studio/types"; import { getStoredAuth } from "@/core/auth"; +import { useTheme } from "@/contexts/ThemeContext"; import { useModels } from "@/core/models/hooks"; import { Select, @@ -218,6 +219,7 @@ export default function StudioNotebookDetailPage({ const params = useParams<{ notebookId: string }>(); const notebookId = notebookIdProp != null ? String(notebookIdProp) : params.notebookId; + const { theme } = useTheme(); // 跳转「我的空间」时带上当前主题 key const { notebooks, isLoading, token: studioToken } = useStudioNotebooks(); // token 用于跳转 callback const { models } = useModels(); const queryClient = useQueryClient(); @@ -508,7 +510,7 @@ export default function StudioNotebookDetailPage({
{/* 右上角跳转按钮 */} -
+
+
-
-
+
+
); @@ -37,11 +41,13 @@ function NotebookCardSkeleton() { function NotebookCard({ nb, + isDark, onRename, onDelete, onOpen, }: { nb: StudioNotebook; + isDark: boolean; onRename: (nb: StudioNotebook) => void; onDelete: (nb: StudioNotebook) => void; /** 传入则点击卡片回调(内嵌打开),不再路由跳转。 */ @@ -61,16 +67,16 @@ function NotebookCard({
- + {nb.name} - {nb.source_count} 个来源 + {nb.source_count} 个来源
); return ( -
+
{onOpen ? (