🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
feat(ui): use pagination instead of virtualization on sessions view (#2248)
Marc Klingen7ac92e83dac3
diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 01ee3c75a0..36487d32d6 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -360,9 +360,6 @@ importers:'@tanstack/react-table':specifier: ^8.11.8version: 8.13.2([email protected])([email protected])- '@tanstack/react-virtual':- specifier: ^3.5.0- version: 3.5.0([email protected])([email protected])'@tremor/react':specifier: 3.16.2@@ -437,7 +434,7 @@ importers:version: 0.364.0([email protected])next:specifier: ^14.2.3- version: 14.2.3(@babel/[email protected])(@playwright/[email protected])([email protected])([email protected])+ version: 14.2.3(@babel/[email protected])(@playwright/[email protected])([email protected])([email protected])next-auth:specifier: ^4.24.7@@ -1556,13 +1553,12 @@ packages:'@babel/traverse': 7.24.1'@babel/types': 7.24.0convert-source-map: 2.0.0- debug: 4.3.4([email protected])+ debug: 4.3.4gensync: 1.0.0-beta.2json5: 2.2.3semver: 6.3.1transitivePeerDependencies:- supports-color- dev: true/@babel/[email protected]:resolution: {integrity: sha512-tVQRucExLQ02Boi4vdPp49svNGcfL2GhdTCT9aldhXgCJVAI21EtRfBettiuLUwce/7r6bFdgs6JFkcdTiFttA==}@@ -1609,7 +1605,6 @@ packages:'@jridgewell/gen-mapping': 0.3.5'@jridgewell/trace-mapping': 0.3.25jsesc: 2.5.2- dev: true/@babel/[email protected]:resolution: {integrity: sha512-x32i4hEXvr+iI0NEoEfDKzlemF8AmtOP8CcrRaEcpzysWuoEb1KknpcvMsHKPONoKZiDuItklgWhB18xEhr9PA==}@@ -1653,7 +1648,6 @@ packages:engines: {node: '>=6.9.0'}dependencies:'@babel/types': 7.24.0- dev: true/@babel/[email protected]:resolution: {integrity: sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==}@@ -1674,7 +1668,6 @@ packages:'@babel/helper-simple-access': 7.22.5'@babel/helper-split-export-declaration': 7.22.6'@babel/helper-validator-identifier': 7.24.5- dev: true/@babel/[email protected](@babel/[email protected]):resolution: {integrity: sha512-9GxeY8c2d2mdQUP1Dye0ks3VDyIMS98kt/llQ2nUId8IsWqTF0l1LkSX0/uP7l7MCDrzXS009Hyhe2gzTiGW8A==}@@ -1700,7 +1693,6 @@ packages:engines: {node: '>=6.9.0'}dependencies:'@babel/types': 7.24.0- dev: true/@babel/[email protected]:resolution: {integrity: sha512-uH3Hmf5q5n7n8mz7arjUlDOCbttY/DW4DYhE6FUsjKJ/oYC1kQQUvwEQWxRwUpX9qQKRXeqLwWxrqilMrf32sQ==}@@ -1714,7 +1706,6 @@ packages:engines: {node: '>=6.9.0'}dependencies:'@babel/types': 7.24.0- dev: true/@babel/[email protected]:resolution: {integrity: sha512-5CHncttXohrHk8GWOFCcCl4oRD9fKosWlIRgWm4ql9VYioKm52Mk2xsmoohvm7f3JoiLSM5ZgJuRaf5QZZYd3Q==}@@ -1749,7 +1740,6 @@ packages:'@babel/types': 7.24.0transitivePeerDependencies:- supports-color- dev: true/@babel/[email protected]:resolution: {integrity: sha512-CiQmBMMpMQHwM5m01YnrM6imUG1ebgYJ+fAIW4FZe6m4qHTPaRHti+R8cggAwkdz4oXhtO4/K9JWlh+8hIfR2Q==}@@ -1955,11 +1945,10 @@ packages:'@babel/helper-split-export-declaration': 7.22.6'@babel/parser': 7.24.1'@babel/types': 7.24.0- debug: 4.3.4([email protected])+ debug: 4.3.4globals: 11.12.0transitivePeerDependencies:- supports-color- dev: true/@babel/[email protected]:resolution: {integrity: sha512-7aaBLeDQ4zYcUFDUD41lJc1fG8+5IU9DaNSJAgal866FGvmD5EbWQgnEC6kO1gGLsX0esNkfnJSndbTXA3r7UA==}@@ -2570,7 +2559,7 @@ packages:engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}dependencies:ajv: 6.12.6- debug: 4.3.4([email protected])+ debug: 4.3.4espree: 9.6.1globals: 13.24.0ignore: 5.3.1@@ -2695,7 +2684,7 @@ packages:engines: {node: '>=10.10.0'}dependencies:'@humanwhocodes/object-schema': 2.0.2- debug: 4.3.4([email protected])+ debug: 4.3.4minimatch: 3.1.2transitivePeerDependencies:- supports-color@@ -4008,7 +3997,7 @@ packages:typescript:optional: truedependencies:- debug: 4.3.4([email protected])+ debug: 4.3.4extract-zip: 2.0.1https-proxy-agent: 5.0.1progress: 2.0.3@@ -5536,7 +5525,7 @@ packages:'@sentry/vercel-edge': 7.113.0'@sentry/webpack-plugin': 1.21.0chalk: 3.0.0- next: 14.2.3(@babel/[email protected])(@playwright/[email protected])([email protected])([email protected])+ next: 14.2.3(@babel/[email protected])(@playwright/[email protected])([email protected])([email protected])react: 18.2.0resolve: 1.22.8rollup: 2.78.0@@ -6340,7 +6329,7 @@ packages:'@trpc/client': 10.45.2(@trpc/[email protected])'@trpc/react-query': 10.45.2(@tanstack/[email protected])(@trpc/[email protected])(@trpc/[email protected])([email protected])([email protected])'@trpc/server': 10.45.2- next: 14.2.3(@babel/[email protected])(@playwright/[email protected])([email protected])([email protected])+ next: 14.2.3(@babel/[email protected])(@playwright/[email protected])([email protected])([email protected])react: 18.2.0react-dom: 18.2.0([email protected])dev: false@@ -6752,7 +6741,7 @@ packages:'@typescript-eslint/type-utils': 6.21.0([email protected])([email protected])'@typescript-eslint/utils': 6.21.0([email protected])([email protected])'@typescript-eslint/visitor-keys': 6.21.0- debug: 4.3.4([email protected])+ debug: 4.3.4eslint: 8.57.0graphemer: 1.4.0ignore: 5.3.1@@ -6807,7 +6796,7 @@ packages:'@typescript-eslint/types': 7.12.0'@typescript-eslint/typescript-estree': 7.12.0([email protected])'@typescript-eslint/visitor-keys': 7.12.0- debug: 4.3.4([email protected])+ debug: 4.3.4eslint: 8.57.0typescript: 5.4.5transitivePeerDependencies:@@ -6828,7 +6817,7 @@ packages:'@typescript-eslint/types': 7.2.0'@typescript-eslint/typescript-estree': 7.2.0([email protected])'@typescript-eslint/visitor-keys': 7.2.0- debug: 4.3.4([email protected])+ debug: 4.3.4eslint: 8.57.0typescript: 5.4.5transitivePeerDependencies:@@ -6887,7 +6876,7 @@ packages:dependencies:'@typescript-eslint/typescript-estree': 6.21.0([email protected])'@typescript-eslint/utils': 6.21.0([email protected])([email protected])- debug: 4.3.4([email protected])+ debug: 4.3.4eslint: 8.57.0ts-api-utils: 1.3.0([email protected])typescript: 5.4.5@@ -6972,7 +6961,7 @@ packages:dependencies:'@typescript-eslint/types': 6.21.0'@typescript-eslint/visitor-keys': 6.21.0- debug: 4.3.4([email protected])+ debug: 4.3.4globby: 11.1.0is-glob: 4.0.3minimatch: 9.0.3@@ -6994,7 +6983,7 @@ packages:dependencies:'@typescript-eslint/types': 7.12.0'@typescript-eslint/visitor-keys': 7.12.0- debug: 4.3.4([email protected])+ debug: 4.3.4globby: 11.1.0is-glob: 4.0.3minimatch: 9.0.4@@ -7016,7 +7005,7 @@ packages:dependencies:'@typescript-eslint/types': 7.2.0'@typescript-eslint/visitor-keys': 7.2.0- debug: 4.3.4([email protected])+ debug: 4.3.4globby: 11.1.0is-glob: 4.0.3minimatch: 9.0.3@@ -7459,7 +7448,7 @@ packages:resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}engines: {node: '>= 6.0.0'}dependencies:- debug: 4.3.4([email protected])+ debug: 4.3.4transitivePeerDependencies:- supports-color@@ -8890,6 +8879,17 @@ packages:ms: 2.1.3dev: true+ resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}+ engines: {node: '>=6.0'}+ peerDependencies:+ supports-color: '*'+ peerDependenciesMeta:+ supports-color:+ optional: true+ dependencies:+ ms: 2.1.2+resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}engines: {node: '>=6.0'}@@ -9546,7 +9546,7 @@ packages:eslint: 8.57.0eslint-import-resolver-node: 0.3.9eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected])([email protected])([email protected])([email protected])- eslint-plugin-import: 2.29.1(@typescript-eslint/[email protected])([email protected])([email protected])+ eslint-plugin-import: 2.29.1(@typescript-eslint/[email protected])([email protected])eslint-plugin-jsx-a11y: 6.8.0([email protected])eslint-plugin-react: 7.34.1([email protected])eslint-plugin-react-hooks: 4.6.0([email protected])@@ -9638,11 +9638,11 @@ packages:eslint: '*'eslint-plugin-import: '*'dependencies:- debug: 4.3.4([email protected])+ debug: 4.3.4enhanced-resolve: 5.16.0eslint: 8.57.0eslint-module-utils: 2.8.1(@typescript-eslint/[email protected])([email protected])([email protected])([email protected])- eslint-plugin-import: 2.29.1(@typescript-eslint/[email protected])([email protected])([email protected])+ eslint-plugin-import: 2.29.1(@typescript-eslint/[email protected])([email protected])fast-glob: 3.3.2get-tsconfig: 4.7.3is-core-module: 2.13.1@@ -9684,6 +9684,35 @@ packages:- supports-colordev: true+ resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==}+ engines: {node: '>=4'}+ peerDependencies:+ '@typescript-eslint/parser': '*'+ eslint: '*'+ eslint-import-resolver-node: '*'+ eslint-import-resolver-typescript: '*'+ eslint-import-resolver-webpack: '*'+ peerDependenciesMeta:+ '@typescript-eslint/parser':+ optional: true+ eslint:+ optional: true+ eslint-import-resolver-node:+ optional: true+ eslint-import-resolver-typescript:+ optional: true+ eslint-import-resolver-webpack:+ optional: true+ dependencies:+ '@typescript-eslint/parser': 7.12.0([email protected])([email protected])+ debug: 3.2.7+ eslint: 8.57.0+ eslint-import-resolver-node: 0.3.9+ transitivePeerDependencies:+ - supports-color+ dev: true+/[email protected](@typescript-eslint/[email protected])([email protected])([email protected])([email protected]):resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==}engines: {node: '>=4'}@@ -9772,6 +9801,41 @@ packages:- supports-colordev: true+ resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==}+ engines: {node: '>=4'}+ peerDependencies:+ '@typescript-eslint/parser': '*'+ eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8+ peerDependenciesMeta:+ '@typescript-eslint/parser':+ optional: true+ dependencies:+ '@typescript-eslint/parser': 7.12.0([email protected])([email protected])+ array-includes: 3.1.7+ array.prototype.findlastindex: 1.2.4+ array.prototype.flat: 1.3.2+ array.prototype.flatmap: 1.3.2+ debug: 3.2.7+ doctrine: 2.1.0+ eslint: 8.57.0+ eslint-import-resolver-node: 0.3.9+ eslint-module-utils: 2.8.1(@typescript-eslint/[email protected])([email protected])([email protected])+ hasown: 2.0.2+ is-core-module: 2.13.1+ is-glob: 4.0.3+ minimatch: 3.1.2+ object.fromentries: 2.0.8+ object.groupby: 1.0.3+ object.values: 1.2.0+ semver: 6.3.1+ tsconfig-paths: 3.15.0+ transitivePeerDependencies:+ - eslint-import-resolver-typescript+ - eslint-import-resolver-webpack+ - supports-color+ dev: true+resolution: {integrity: sha512-QIT7FH7fNmd9n4se7FFKHbsLKGQiw885Ds6Y/sxKgCZ6natwCsXdgPOADnYVxN2QrRweF0FZWbJ6S7Rsn7llug==}engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}@@ -10043,7 +10107,7 @@ packages:ajv: 6.12.6chalk: 4.1.2cross-spawn: 7.0.3- debug: 4.3.4([email protected])+ debug: 4.3.4doctrine: 3.0.0escape-string-regexp: 4.0.0eslint-scope: 7.2.2@@ -10276,7 +10340,7 @@ packages:engines: {node: '>= 10.17.0'}hasBin: truedependencies:- debug: 4.3.4([email protected])+ debug: 4.3.4get-stream: 5.2.0yauzl: 2.10.0optionalDependencies:@@ -11011,7 +11075,7 @@ packages:dependencies:'@tootallnate/once': 2.0.0agent-base: 6.0.2- debug: 4.3.4([email protected])+ debug: 4.3.4transitivePeerDependencies:- supports-colordev: true@@ -11049,7 +11113,7 @@ packages:engines: {node: '>= 6'}dependencies:agent-base: 6.0.2- debug: 4.3.4([email protected])+ debug: 4.3.4transitivePeerDependencies:- supports-color@@ -11679,7 +11743,7 @@ packages:resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==}engines: {node: '>=10'}dependencies:- debug: 4.3.4([email protected])+ debug: 4.3.4istanbul-lib-coverage: 3.2.2source-map: 0.6.1transitivePeerDependencies:@@ -13558,7 +13622,7 @@ packages:'@panva/hkdf': 1.1.1cookie: 0.5.0jose: 4.15.5- next: 14.2.3(@babel/[email protected])(@playwright/[email protected])([email protected])([email protected])+ next: 14.2.3(@babel/[email protected])(@playwright/[email protected])([email protected])([email protected])nodemailer: 6.9.13oauth: 0.9.15openid-client: 5.6.5@@ -13576,7 +13640,7 @@ packages:react: ^16.8.0 || ^17.0.0 || ^18.0.0use-query-params: ^2.0.0dependencies:- next: 14.2.3(@babel/[email protected])(@playwright/[email protected])([email protected])([email protected])+ next: 14.2.3(@babel/[email protected])(@playwright/[email protected])([email protected])([email protected])react: 18.2.0tslib: 2.6.2use-query-params: 2.2.1([email protected])([email protected])@@ -13592,6 +13656,49 @@ packages:react-dom: 18.2.0([email protected])dev: false+ /[email protected](@babel/[email protected])(@playwright/[email protected])([email protected])([email protected]):+ resolution: {integrity: sha512-dowFkFTR8v79NPJO4QsBUtxv0g9BrS/phluVpMAt2ku7H+cbcBJlopXjkWlwxrk/xGqMemr7JkGPGemPrLLX7A==}+ engines: {node: '>=18.17.0'}+ hasBin: true+ peerDependencies:+ '@opentelemetry/api': ^1.1.0+ '@playwright/test': ^1.41.2+ react: ^18.2.0+ react-dom: ^18.2.0+ sass: ^1.3.0+ peerDependenciesMeta:+ '@opentelemetry/api':+ optional: true+ '@playwright/test':+ optional: true+ sass:+ optional: true+ dependencies:+ '@next/env': 14.2.3+ '@playwright/test': 1.43.1+ '@swc/helpers': 0.5.5+ busboy: 1.6.0+ caniuse-lite: 1.0.30001599+ graceful-fs: 4.2.11+ postcss: 8.4.31+ react: 18.2.0+ react-dom: 18.2.0([email protected])+ styled-jsx: 5.1.1(@babel/[email protected])([email protected])+ optionalDependencies:+ '@next/swc-darwin-arm64': 14.2.3+ '@next/swc-darwin-x64': 14.2.3+ '@next/swc-linux-arm64-gnu': 14.2.3+ '@next/swc-linux-arm64-musl': 14.2.3+ '@next/swc-linux-x64-gnu': 14.2.3+ '@next/swc-linux-x64-musl': 14.2.3+ '@next/swc-win32-arm64-msvc': 14.2.3+ '@next/swc-win32-ia32-msvc': 14.2.3+ '@next/swc-win32-x64-msvc': 14.2.3+ transitivePeerDependencies:+ - '@babel/core'+ - babel-plugin-macros+ dev: false+/[email protected](@babel/[email protected])(@playwright/[email protected])([email protected])([email protected]):resolution: {integrity: sha512-dowFkFTR8v79NPJO4QsBUtxv0g9BrS/phluVpMAt2ku7H+cbcBJlopXjkWlwxrk/xGqMemr7JkGPGemPrLLX7A==}engines: {node: '>=18.17.0'}@@ -14930,7 +15037,7 @@ packages:'@puppeteer/browsers': 0.5.0([email protected])chromium-bidi: 0.4.7([email protected])cross-fetch: 3.1.5- debug: 4.3.4([email protected])+ debug: 4.3.4devtools-protocol: 0.0.1107588extract-zip: 2.0.1https-proxy-agent: 5.0.1@@ -16183,6 +16290,24 @@ packages:resolution: {integrity: sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==}dev: false+ resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==}+ engines: {node: '>= 12.0.0'}+ peerDependencies:+ '@babel/core': '*'+ babel-plugin-macros: '*'+ react: '>= 16.8.0 || 17.x.x || ^18.0.0-0'+ peerDependenciesMeta:+ '@babel/core':+ optional: true+ babel-plugin-macros:+ optional: true+ dependencies:+ '@babel/core': 7.24.3+ client-only: 0.0.1+ react: 18.2.0+ dev: false+resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==}engines: {node: '>= 12.0.0'}diff --git a/web/package.json b/web/package.jsonindex d2d49f41b9..6b6ab52380 100644--- a/web/package.json+++ b/web/package.json@@ -71,7 +71,6 @@"@tailwindcss/container-queries": "^0.1.1","@tanstack/react-query": "^4.36.1","@tanstack/react-table": "^8.11.8",- "@tanstack/react-virtual": "^3.5.0","@tremor/react": "3.16.2","@trpc/client": "^10.45.0","@trpc/next": "^10.45.0",diff --git a/web/src/components/session/index.tsx b/web/src/components/session/index.tsxindex eaa63d8e5e..947929a2fe 100644--- a/web/src/components/session/index.tsx+++ b/web/src/components/session/index.tsx@@ -12,33 +12,19 @@ import { useDetailPageLists } from "@/src/features/navigate-detail-pages/contextimport { api } from "@/src/utils/api";import { usdFormatter } from "@/src/utils/numbers";import Link from "next/link";-import { useEffect, useRef } from "react";-import { useWindowVirtualizer } from "@tanstack/react-virtual";-import { type RouterOutput } from "@/src/utils/types";-import {- DataTableRowHeightSwitch,- type RowHeight,- useRowHeightLocalStorage,-} from "@/src/components/table/data-table-row-height-switch";-import { ScrollArea } from "@/src/components/ui/scroll-area";+import { useEffect, useState } from "react";import { AnnotateButton } from "@/src/features/manual-scoring/components/AnnotateButton";+import { Button } from "@/src/components/ui/button";-// do not use the usual table row heights here-const rowHeightMapping: Record<RowHeight, number> = {- s: 200,- m: 350,- l: 700,-};+// some projects have thousands of traces in a sessions, paginate to avoid rendering all at once+const PAGE_SIZE = 50;export const SessionPage: React.FC<{sessionId: string;projectId: string;}> = ({ sessionId, projectId }) => {const { setDetailPageList } = useDetailPageLists();- const [rowHeight, setRowHeight] = useRowHeightLocalStorage(- "single-session",- "m",- );+ const [visibleTraces, setVisibleTraces] = useState(PAGE_SIZE);const session = api.sessions.byId.useQuery({sessionId,@@ -96,11 +82,6 @@ export const SessionPage: React.FC<{}listKey="sessions"/>,- <DataTableRowHeightSwitch- rowHeight={rowHeight}- setRowHeight={setRowHeight}- key="height"- />,]}/><div className="flex flex-wrap gap-2">@@ -121,99 +102,49 @@ export const SessionPage: React.FC<{</Badge>)}</div>- {session.data && (- <TraceCardList- session={session.data}- projectId={projectId}- rowHeight={rowHeightMapping[rowHeight]}- />- )}- </div>- );-};--const TraceCardList = ({- session,- projectId,- rowHeight,-}: {- session: RouterOutput["sessions"]["byId"];- projectId: string;- rowHeight: number;-}) => {- const listVirtualizationRef = useRef<HTMLDivElement | null>(null);-- const virtualizer = useWindowVirtualizer({- count: session.traces.length,- estimateSize: () => rowHeight,- overscan: 5,- scrollMargin: listVirtualizationRef.current?.offsetTop ?? 0,- gap: 10,- });- useEffect(() => {- // re-measure when rowHeight changes to update the virtualizer- virtualizer.measure();- }, [rowHeight, virtualizer]);- return (- <div className="mt-5 border-t pt-5">- <div- ref={listVirtualizationRef}- style={{- height: `${virtualizer.getTotalSize()}px`,- position: "relative",- }}- >- {virtualizer- .getVirtualItems()- .map((virtualItem) => ({- virtualItem,- trace: session.traces[virtualItem.index],- }))- .map(({ virtualItem, trace }) => (- <Card- className="group grid w-full gap-3 overflow-hidden border-border p-2 shadow-none hover:border-ring md:grid-cols-3"- key={virtualItem.key}- data-index={virtualItem.index}- style={{- position: "absolute",- top: 0,- left: 0,- height: `${rowHeight}px`,- transform: `translateY(${virtualItem.start - virtualizer.options.scrollMargin}px)`,- }}- >- <ScrollArea className="col-span-2 pr-3">- <SessionIO traceId={trace.id} />- </ScrollArea>- <ScrollArea>- <div className="-mt-1 overflow-y-auto p-1 opacity-50 transition-opacity group-hover:opacity-100">- <Link- href={`/project/${projectId}/traces/${trace.id}`}- className="text-xs hover:underline"- >- Trace: {trace.name} ({trace.id}) ↗- </Link>- <div className="text-xs text-muted-foreground">- {trace.timestamp.toLocaleString()}- </div>- <div className="mb-1 mt-2 text-xs text-muted-foreground">- Scores- </div>- <div className="flex flex-wrap content-start items-start gap-1">- <GroupedScoreBadges scores={trace.scores} />- </div>- <AnnotateButton- projectId={projectId}- traceId={trace.id}- scores={trace.scores}- variant="badge"- type="session"- source="SessionDetail"- />- </div>- </ScrollArea>- </Card>- ))}+ <div className="mt-5 flex flex-col gap-2 border-t pt-5">+ {session.data?.traces.slice(0, visibleTraces).map((trace) => (+ <Card+ className="group grid gap-3 border-border p-2 shadow-none hover:border-ring md:grid-cols-3"+ key={trace.id}+ >+ <SessionIO traceId={trace.id} />+ <div className="-mt-1 p-1 opacity-50 transition-opacity group-hover:opacity-100">+ <Link+ href={`/project/${projectId}/traces/${trace.id}`}+ className="text-xs hover:underline"+ >+ Trace: {trace.name} ({trace.id}) ↗+ </Link>+ <div className="text-xs text-muted-foreground">+ {trace.timestamp.toLocaleString()}+ </div>+ <div className="mb-1 mt-2 text-xs text-muted-foreground">+ Scores+ </div>+ <div className="mb-1 flex flex-wrap content-start items-start gap-1">+ <GroupedScoreBadges scores={trace.scores} />+ </div>+ <AnnotateButton+ projectId={projectId}+ traceId={trace.id}+ scores={trace.scores}+ variant="badge"+ type="session"+ source="SessionDetail"+ />+ </div>+ </Card>+ ))}+ {session.data?.traces && session.data.traces.length > visibleTraces && (+ <Button+ onClick={() => setVisibleTraces((prev) => prev + PAGE_SIZE)}+ variant="ghost"+ className="self-center"+ >+ {`Load ${Math.min(session.data.traces.length - visibleTraces, PAGE_SIZE)} More`}+ </Button>+ )}</div></div>);@@ -232,9 +163,8 @@ const SessionIO = ({ traceId }: { traceId: string }) => {refetchOnMount: false, // prevents refetching loops},);-return (- <div className="flex flex-col gap-2 overflow-x-hidden overflow-y-scroll p-0">+ <div className="col-span-2 flex flex-col gap-2 p-0">{!trace.data ? (<JsonSkeletonclassName="h-full w-full overflow-hidden px-2 py-1"