Skip to content

Commit 553ecca

Browse files
karthikscale3darshit-s3rohit-kadhedylanzuber-scale3alizenhom
authored
Release 1.0.4 (#59)
* Bug fix * signup bug fix * user invite * docs: add local setup instructions, cleanup files (#10) * Update README.md (#11) * Update README.md * Update README.md * Update README.md * Bugfix auth (#12) * Update README.md * Update favicon (#17) * Release 1.0.3 (#8) * Bug fix * signup bug fix * user invite * favicon * Adding pagination to traces (#16) * Adding pagination to traces * installing scroller * query function bug * fix * Bug fix pagination --------- Co-authored-by: Karthik Kalyanaraman <[email protected]> * Dylan/s3en 2060 adding more frontend pagination (#18) * Adding pagination to traces * installing scroller * bug fixes for trace pagination * adding delete prompt api * adding pagination to evaluate * adding pagination to evals * adding pagination to prompset, bug fixes * adding .env * fix --------- Co-authored-by: Karthik Kalyanaraman <[email protected]> * updating prompt dialog (#19) * Show API key warning message (#20) * Show API key warning message * Update instructions * Fix null dereference checks (#21) * adding check for missing table (#22) * adding check for missing table * adding docs button * Check empty table --------- Co-authored-by: Karthik Kalyanaraman <[email protected]> * Check length of data (#24) * flicker issue (#26) * Flicker issue (#27) * flicker issue * Fixes * Fix (#30) * Fix header (#32) * updating gitignore * Rohit/s3 en 2064 fix api key not showing (#29) * fix api key bug * final fixes * fix scroll bar issue * adjust readme * Pagination bug * Pagination bug (#37) * removing form reset on edit (#39) * removing form reset on edit * bug fixes: * fix * fix page number bug --------- Co-authored-by: Karthik Kalyanaraman <[email protected]> * Dylan/s3en 2079 thumbs up duplication bug (#40) * refetch/duplicate bug fix * Prevent stale data in forms * fix * linting * fixing duplication bug * removing console * Fix eval * Fix pagination for promp eval * Fix promptsets pagination --------- Co-authored-by: Karthik Kalyanaraman <[email protected]> * Bug fixes for Traces Pagination (#42) * Pagination bug * Fix pagination for traces * Bug fix * Fix invalid model (#43) * Pagination bug * Bug fix * Bug fixes (#45) * Pagination bug * Bug fix * fix pricing * fix the pii function * Bugfixes * adding pagination to dataset * Trace page improvements (#49) * Pagination bug * Bug fix * Fix scrolling pagination * Filters * Add model * utc - local time switch * Bugfixes and Evaluation Dashboard (#50) * Pagination bug * Bug fix * minor fix * Evaluations dashboard refresh * Move prompts as a tab * UI improvements * round values * Add migration script * Minor bug fixes (#51) * Pagination bug * Bug fix * Bug fix * Disable LLM view for framework and vector db requests * Minor bug fixes (#52) * Pagination bug * Bug fix * Bug fix * Disable LLM view for framework and vector db requests * adding projects page loading * deleting * fix * adding perplexity cost calculator: * Dylan/s3en 2127 loading states for all pages (#57) * loading for data set * adding loading page for promptset * dataset loading * prompts loading * prompts loading * metrics loading, chart loading * evaluations loading * refactor traces * trace row loading * more loading * Rename loading to skeleton * Minor fix --------- Co-authored-by: Karthik Kalyanaraman <[email protected]> * Bugfixes and cleanups (#58) * Pagination bug * Bug fix * Make /projects endpoint response cleaner * Better error handling for projects page * Cleanup metrics page * Cleanup metrics and better error handling * better error handling for traces * Error handling for evaluations page * Error handle evaluations * Error handling for datasets * Minor fixes * hover fixes * Minor fix * minor fix --------- Co-authored-by: darshit-s3 <[email protected]> Co-authored-by: Rohit Kadhe <[email protected]> Co-authored-by: dylanzuber-scale3 <[email protected]> Co-authored-by: dylan <[email protected]> Co-authored-by: Ali Waleed <[email protected]>
1 parent 56fc157 commit 553ecca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2623
-1797
lines changed

app/(protected)/layout.tsx

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { Header } from "@/components/shared/header";
22
import { Separator } from "@/components/ui/separator";
3+
import { Skeleton } from "@/components/ui/skeleton";
34
import { authOptions } from "@/lib/auth/options";
45
import { getServerSession } from "next-auth";
56
import { redirect } from "next/navigation";
67
import { Suspense } from "react";
8+
import { PageSkeleton } from "./projects/page-client";
79

810
export default async function Layout({
911
children,
@@ -16,7 +18,7 @@ export default async function Layout({
1618
}
1719

1820
return (
19-
<Suspense fallback={<div>Loading...</div>}>
21+
<Suspense fallback={<PageLoading />}>
2022
<main className="min-h-screen w-full">
2123
<Header email={session?.user?.email as string} />
2224
<Separator />
@@ -25,3 +27,28 @@ export default async function Layout({
2527
</Suspense>
2628
);
2729
}
30+
31+
function PageLoading() {
32+
return (
33+
<main className="min-h-screen w-full">
34+
<header className="flex flex-col gap-2 w-full px-12 z-30 sticky top-0 bg-primary-foreground">
35+
<div className="flex justify-between items-center w-full pt-3">
36+
<div className="text-xl font-bold flex items-center gap-0">
37+
Langtrace AI
38+
</div>
39+
<div className="flex items-end gap-3">
40+
<Skeleton className="w-20 h-16" />
41+
<div className="flex flex-col mr-4">
42+
<p className="text-sm text-muted-foreground">
43+
<Skeleton className="w-20 h-16" />
44+
</p>
45+
</div>
46+
<Skeleton className="w-20 h-16" />
47+
</div>
48+
</div>
49+
<Skeleton className="w-full h-0.5" />
50+
</header>
51+
<PageSkeleton />
52+
</main>
53+
);
54+
}

app/(protected)/project/[project_id]/datasets/dataset/[dataset_id]/page.tsx

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use client";
22

33
import { CreateData } from "@/components/project/dataset/create-data";
4+
import DatasetRowSkeleton from "@/components/project/dataset/dataset-row-skeleton";
45
import { EditData } from "@/components/project/dataset/edit-data";
56
import { Spinner } from "@/components/shared/spinner";
67
import { Button } from "@/components/ui/button";
@@ -12,6 +13,7 @@ import { useParams } from "next/navigation";
1213
import { useState } from "react";
1314
import { useBottomScrollListener } from "react-bottom-scroll-listener";
1415
import { useQuery } from "react-query";
16+
import { toast } from "sonner";
1517

1618
export default function Dataset() {
1719
const dataset_id = useParams()?.dataset_id as string;
@@ -36,6 +38,10 @@ export default function Dataset() {
3638
const response = await fetch(
3739
`/api/dataset?dataset_id=${dataset_id}&page=${page}&pageSize=${PAGE_SIZE}`
3840
);
41+
if (!response.ok) {
42+
const error = await response.json();
43+
throw new Error(error?.message || "Failed to fetch dataset");
44+
}
3945
const result = await response.json();
4046
return result;
4147
},
@@ -66,10 +72,16 @@ export default function Dataset() {
6672
}
6773
setShowLoader(false);
6874
},
75+
onError: (error) => {
76+
setShowLoader(false);
77+
toast.error("Failed to fetch dataset", {
78+
description: error instanceof Error ? error.message : String(error),
79+
});
80+
},
6981
});
7082

7183
if (fetchDataset.isLoading || !fetchDataset.data || !currentData) {
72-
return <div>Loading...</div>;
84+
return <PageSkeleton />;
7385
} else {
7486
return (
7587
<div className="w-full py-6 px-6 flex flex-col gap-4">
@@ -130,3 +142,32 @@ export default function Dataset() {
130142
);
131143
}
132144
}
145+
146+
function PageSkeleton() {
147+
return (
148+
<div className="w-full py-6 px-6 flex flex-col gap-4">
149+
<div className="flex gap-4 items-center w-fit">
150+
<Button
151+
disabled={true}
152+
variant="secondary"
153+
onClick={() => window.history.back()}
154+
>
155+
<ChevronLeft className="mr-1" />
156+
Back
157+
</Button>
158+
<CreateData disabled={true} />
159+
</div>
160+
<div className="flex flex-col gap-3 rounded-md border border-muted max-h-screen overflow-y-scroll">
161+
<div className="grid grid-cols-5 items-center justify-stretch gap-3 py-3 px-4 bg-muted">
162+
<p className="text-xs font-medium">Created at</p>
163+
<p className="text-xs font-medium">Input</p>
164+
<p className="text-xs font-medium">Output</p>
165+
<p className="text-xs font-medium text-end">Note</p>
166+
</div>
167+
{Array.from({ length: 5 }).map((_, index) => (
168+
<DatasetRowSkeleton key={index} />
169+
))}
170+
</div>
171+
</div>
172+
);
173+
}

app/(protected)/project/[project_id]/datasets/promptset/[promptset_id]/page.tsx

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ import { EditPrompt } from "@/components/project/dataset/edit-data";
55
import { Spinner } from "@/components/shared/spinner";
66
import { Button } from "@/components/ui/button";
77
import { Separator } from "@/components/ui/separator";
8+
import { Skeleton } from "@/components/ui/skeleton";
89
import { PAGE_SIZE } from "@/lib/constants";
910
import { Prompt } from "@prisma/client";
1011
import { ChevronLeft } from "lucide-react";
1112
import { useParams } from "next/navigation";
1213
import { useState } from "react";
1314
import { useBottomScrollListener } from "react-bottom-scroll-listener";
1415
import { useQuery } from "react-query";
16+
import { toast } from "sonner";
1517

1618
export default function Promptset() {
1719
const promptset_id = useParams()?.promptset_id as string;
@@ -36,6 +38,10 @@ export default function Promptset() {
3638
const response = await fetch(
3739
`/api/promptset?promptset_id=${promptset_id}&page=${page}&pageSize=${PAGE_SIZE}`
3840
);
41+
if (!response.ok) {
42+
const error = await response.json();
43+
throw new Error(error?.message || "Failed to fetch promptset");
44+
}
3945
const result = await response.json();
4046
return result;
4147
},
@@ -66,10 +72,16 @@ export default function Promptset() {
6672
}
6773
setShowLoader(false);
6874
},
75+
onError: (error) => {
76+
setShowLoader(false);
77+
toast.error("Failed to fetch promptset", {
78+
description: error instanceof Error ? error.message : String(error),
79+
});
80+
},
6981
});
7082

7183
if (fetchPromptset.isLoading || !fetchPromptset.data || !currentData) {
72-
return <div>Loading...</div>;
84+
return <PageSkeleton />;
7385
} else {
7486
return (
7587
<div className="w-full py-6 px-6 flex flex-col gap-4">
@@ -121,3 +133,51 @@ export default function Promptset() {
121133
);
122134
}
123135
}
136+
137+
function PageSkeleton() {
138+
return (
139+
<div className="w-full py-6 px-6 flex flex-col gap-4">
140+
<div className="flex gap-4 items-center w-fit">
141+
<Button
142+
disabled={true}
143+
variant="secondary"
144+
onClick={() => window.history.back()}
145+
>
146+
<ChevronLeft className="mr-1" />
147+
Back
148+
</Button>
149+
<CreatePrompt disabled={true} />
150+
</div>
151+
<div className="flex flex-col gap-3 rounded-md border border-muted max-h-screen overflow-y-scroll">
152+
<div className="grid grid-cols-4 items-center justify-stretch gap-3 py-3 px-4 bg-muted">
153+
<p className="text-xs font-medium">Created at</p>
154+
<p className="text-xs font-medium">Value</p>
155+
<p className="text-xs font-medium text-left">Note</p>
156+
<p className="text-xs font-medium text-end"></p>
157+
</div>
158+
{Array.from({ length: 3 }).map((_, index) => (
159+
<PromptsetRowSkeleton key={index} />
160+
))}
161+
</div>
162+
</div>
163+
);
164+
}
165+
166+
function PromptsetRowSkeleton() {
167+
return (
168+
<div className="flex flex-col">
169+
<div className="grid grid-cols-5 items-start justify-stretch gap-3 py-3 px-4">
170+
<div className="text-xs">
171+
<Skeleton className="w-full h-6" />
172+
</div>
173+
<div className="text-xs h-12 overflow-y-scroll">
174+
<Skeleton className="w-full h-6" />
175+
</div>
176+
<div className="text-xs h-12 overflow-y-scroll">
177+
<Skeleton className="w-full h-6" />
178+
</div>
179+
</div>
180+
<Separator orientation="horizontal" />
181+
</div>
182+
);
183+
}

0 commit comments

Comments
 (0)