From db96b10d4d23a2a1709468886ff73534188cf826 Mon Sep 17 00:00:00 2001 From: Francisco Javier Arceo Date: Mon, 18 Aug 2025 14:12:39 -0400 Subject: [PATCH] chore: Adding unit tests for UI Signed-off-by: Francisco Javier Arceo --- .../[id]/files/[fileId]/contents/page.tsx | 10 +++++++++- .../components/chat-playground/markdown-renderer.tsx | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/llama_stack/ui/app/logs/vector-stores/[id]/files/[fileId]/contents/page.tsx b/llama_stack/ui/app/logs/vector-stores/[id]/files/[fileId]/contents/page.tsx index 0283db9e7..3d714a480 100644 --- a/llama_stack/ui/app/logs/vector-stores/[id]/files/[fileId]/contents/page.tsx +++ b/llama_stack/ui/app/logs/vector-stores/[id]/files/[fileId]/contents/page.tsx @@ -52,8 +52,10 @@ export default function ContentsListPage() { const [file, setFile] = useState(null); const [contents, setContents] = useState([]); const [isLoadingStore, setIsLoadingStore] = useState(true); + const [isLoadingFile, setIsLoadingFile] = useState(true); const [isLoadingContents, setIsLoadingContents] = useState(true); const [errorStore, setErrorStore] = useState(null); + const [errorFile, setErrorFile] = useState(null); const [errorContents, setErrorContents] = useState(null); useEffect(() => { @@ -175,7 +177,13 @@ export default function ContentsListPage() { Content Chunks ({contents.length}) - {isLoadingContents ? ( + {isLoadingFile ? ( + + ) : errorFile ? ( +
+ Error loading file: {errorFile.message} +
+ ) : isLoadingContents ? (
diff --git a/llama_stack/ui/components/chat-playground/markdown-renderer.tsx b/llama_stack/ui/components/chat-playground/markdown-renderer.tsx index bc6bf5122..b48b5e1ba 100644 --- a/llama_stack/ui/components/chat-playground/markdown-renderer.tsx +++ b/llama_stack/ui/components/chat-playground/markdown-renderer.tsx @@ -187,6 +187,7 @@ const COMPONENTS = { code: ({ children, className, + ...rest }: { children: React.ReactNode; className?: string;