diff --git a/packages/web/components/ProfileViewer.tsx b/packages/web/components/ProfileViewer.tsx index 5f6f803..9503d90 100644 --- a/packages/web/components/ProfileViewer.tsx +++ b/packages/web/components/ProfileViewer.tsx @@ -90,12 +90,19 @@ export function ProfileViewer() { : "http://localhost:8000"; async function fetchAndDisplayFile(path: string, name: string) { + console.log("fetchAndDisplayFile called:", path, name); setIsLoadingFile(true); try { - const res = await fetch(`${API_BASE}${path}`); + const url = `${API_BASE}${path}`; + console.log("Fetching:", url); + const res = await fetch(url); + console.log("Response status:", res.status); const text = await res.text(); + console.log("Response length:", text.length); const lines = text.trim().split("\n"); + console.log("Lines count:", lines.length); const data = lines.slice(1).map((line) => line.split(",")); + console.log("Data rows:", data.length); setSelectedFile({ name, path, data }); } catch (err) { console.error("Failed to fetch file:", err); @@ -266,7 +273,14 @@ export function ProfileViewer() {
- {selectedFile ? ( + {isLoadingFile ? ( +
+
+
+

Loading file data...

+
+
+ ) : selectedFile ? (