🪢 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(datasets): add codemirror as json editor (#1643)
Marc Klingen245321da11ff
diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 62158fa6b5..87d221b733 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -164,6 +164,9 @@ importers:'@aws-sdk/s3-request-presigner':specifier: ^3.540.0version: 3.540.0+ '@codemirror/lang-json':+ specifier: ^6.0.1+ version: 6.0.1'@headlessui/react':specifier: ^1.7.18version: 1.7.18([email protected])([email protected])@@ -302,6 +305,12 @@ importers:'@trpc/server':specifier: ^10.45.0version: 10.45.2+ '@uiw/codemirror-theme-github':+ specifier: ^4.21.25+ version: 4.21.25(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])+ '@uiw/react-codemirror':+ specifier: ^4.21.25+ version: 4.21.25(@babel/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])([email protected])([email protected])([email protected])ai:specifier: ^3.0.20version: 3.0.20([email protected])([email protected])([email protected])([email protected])([email protected])@@ -349,7 +358,7 @@ importers:version: 0.364.0([email protected])next:specifier: ^14.1.4next-auth:specifier: ^4.24.7@@ -1403,30 +1412,6 @@ packages:semver: 6.3.1transitivePeerDependencies:- supports-color- dev: true-- /@babel/[email protected]:- resolution: {integrity: sha512-MBVlMXP+kkl5394RBLSxxk/iLTeVGuXTV3cIDXavPpMMqnSnt6apKgan/U8O3USWZCWZT/TbgfEpKa4uMgN4Dg==}- engines: {node: '>=6.9.0'}- dependencies:- '@ampproject/remapping': 2.3.0- '@babel/code-frame': 7.24.2- '@babel/generator': 7.24.4- '@babel/helper-compilation-targets': 7.23.6- '@babel/helper-module-transforms': 7.23.3(@babel/[email protected])- '@babel/helpers': 7.24.4- '@babel/parser': 7.24.4- '@babel/template': 7.24.0- '@babel/traverse': 7.24.1- '@babel/types': 7.24.0- convert-source-map: 2.0.0- debug: 4.3.4([email protected])- gensync: 1.0.0-beta.2- json5: 2.2.3- semver: 6.3.1- transitivePeerDependencies:- - supports-color- dev: falseresolution: {integrity: sha512-d5guuzMlPeDfZIbpQ8+g1NaCNuAGBBGNECh0HVqz1sjOeVLh2CEaifuOysCH18URW6R7pqXINvf5PaR/dC6jLQ==}@@ -1451,16 +1436,6 @@ packages:'@jridgewell/trace-mapping': 0.3.25jsesc: 2.5.2- /@babel/[email protected]:- resolution: {integrity: sha512-Xd6+v6SnjWVx/nus+y0l1sxMOTOMBkyL4+BIdbALyatQnAe/SRVjANeDPSCYaX+i1iJmuGSKf3Z+E+V/va1Hvw==}- engines: {node: '>=6.9.0'}- dependencies:- '@babel/types': 7.24.0- '@jridgewell/gen-mapping': 0.3.5- '@jridgewell/trace-mapping': 0.3.25- jsesc: 2.5.2- dev: false-/@babel/[email protected]:resolution: {integrity: sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==}engines: {node: '>=6.9.0'}@@ -1506,21 +1481,6 @@ packages:'@babel/helper-simple-access': 7.22.5'@babel/helper-split-export-declaration': 7.22.6'@babel/helper-validator-identifier': 7.22.20- dev: true-- /@babel/[email protected](@babel/[email protected]):- resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==}- engines: {node: '>=6.9.0'}- peerDependencies:- '@babel/core': ^7.0.0- dependencies:- '@babel/core': 7.24.4- '@babel/helper-environment-visitor': 7.22.20- '@babel/helper-module-imports': 7.22.15- '@babel/helper-simple-access': 7.22.5- '@babel/helper-split-export-declaration': 7.22.6- '@babel/helper-validator-identifier': 7.22.20- dev: false/@babel/[email protected]:resolution: {integrity: sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==}@@ -1560,18 +1520,6 @@ packages:'@babel/types': 7.24.0transitivePeerDependencies:- supports-color- dev: true-- /@babel/[email protected]:- resolution: {integrity: sha512-FewdlZbSiwaVGlgT1DPANDuCHaDMiOo+D/IDYRFYjHOuv66xMSJ7fQwwODwRNAPkADIO/z1EoF/l2BCWlWABDw==}- engines: {node: '>=6.9.0'}- dependencies:- '@babel/template': 7.24.0- '@babel/traverse': 7.24.1- '@babel/types': 7.24.0- transitivePeerDependencies:- - supports-color- dev: false/@babel/[email protected]:resolution: {integrity: sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==}@@ -1792,6 +1740,84 @@ packages:resolution: {integrity: sha512-hBzuU5+JjB2cqNZyszkDHZgOSrUUT8V3dhgRl8Q9Gp6dAj/H5+KILGjbhDpc3Iy9qmqlm/akuOI2ut9VUtzJxQ==}dev: true+ /@codemirror/[email protected](@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected]):+ resolution: {integrity: sha512-G2Zm0mXznxz97JhaaOdoEG2cVupn4JjPaS4AcNvZzhOsnnG9YVN68VzfoUw6dYTsIxT6a/cmoFEN47KAWhXaOg==}+ peerDependencies:+ '@codemirror/language': ^6.0.0+ '@codemirror/state': ^6.0.0+ '@codemirror/view': ^6.0.0+ '@lezer/common': ^1.0.0+ dependencies:+ '@codemirror/language': 6.10.1+ '@codemirror/state': 6.4.1+ '@codemirror/view': 6.26.2+ '@lezer/common': 1.2.1+ dev: false++ /@codemirror/[email protected]:+ resolution: {integrity: sha512-dO4hcF0fGT9tu1Pj1D2PvGvxjeGkbC6RGcZw6Qs74TH+Ed1gw98jmUgd2axWvIZEqTeTuFrg1lEB1KV6cK9h1A==}+ dependencies:+ '@codemirror/language': 6.10.1+ '@codemirror/state': 6.4.1+ '@codemirror/view': 6.26.2+ '@lezer/common': 1.2.1+ dev: false++ /@codemirror/[email protected]:+ resolution: {integrity: sha512-+T1flHdgpqDDlJZ2Lkil/rLiRy684WMLc74xUnjJH48GQdfJo/pudlTRreZmKwzP8/tGdKf83wlbAdOCzlJOGQ==}+ dependencies:+ '@codemirror/language': 6.10.1+ '@lezer/json': 1.0.2+ dev: false++ /@codemirror/[email protected]:+ resolution: {integrity: sha512-5GrXzrhq6k+gL5fjkAwt90nYDmjlzTIJV8THnxNFtNKWotMIlzzN+CpqxqwXOECnUdOndmSeWntVrVcv5axWRQ==}+ dependencies:+ '@codemirror/state': 6.4.1+ '@codemirror/view': 6.26.2+ '@lezer/common': 1.2.1+ '@lezer/highlight': 1.2.0+ '@lezer/lr': 1.4.0+ style-mod: 4.1.2+ dev: false++ /@codemirror/[email protected]:+ resolution: {integrity: sha512-+5YyicIaaAZKU8K43IQi8TBy6mF6giGeWAH7N96Z5LC30Wm5JMjqxOYIE9mxwMG1NbhT2mA3l9hA4uuKUM3E5g==}+ dependencies:+ '@codemirror/state': 6.4.1+ '@codemirror/view': 6.26.2+ crelt: 1.0.6+ dev: false++ /@codemirror/[email protected]:+ resolution: {integrity: sha512-rpMgcsh7o0GuCDUXKPvww+muLA1pDJaFrpq/CCHtpQJYz8xopu4D1hPcKRoDD0YlF8gZaqTNIRa4VRBWyhyy7Q==}+ dependencies:+ '@codemirror/state': 6.4.1+ '@codemirror/view': 6.26.2+ crelt: 1.0.6+ dev: false++ /@codemirror/[email protected]:+ resolution: {integrity: sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==}+ dev: false++ /@codemirror/[email protected]:+ resolution: {integrity: sha512-F+sH0X16j/qFLMAfbciKTxVOwkdAS336b7AXTKOZhy8BR3eH/RelsnLgLFINrpST63mmN2OuwUt0W2ndUgYwUA==}+ dependencies:+ '@codemirror/language': 6.10.1+ '@codemirror/state': 6.4.1+ '@codemirror/view': 6.26.2+ '@lezer/highlight': 1.2.0+ dev: false++ /@codemirror/[email protected]:+ resolution: {integrity: sha512-j6V48PlFC/O7ERAR5vRW5QKDdchzmyyfojDdt+zPsB0YXoWgcjlC1IWjmlYfx08aQZ3HN5BtALcgGgtSKGMe7A==}+ dependencies:+ '@codemirror/state': 6.4.1+ style-mod: 4.1.2+ w3c-keyname: 2.2.8+ dev: false+/@cspotcode/[email protected]:resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}engines: {node: '>=12'}@@ -2765,6 +2791,30 @@ packages:- encodingdev: false+ /@lezer/[email protected]:+ resolution: {integrity: sha512-yemX0ZD2xS/73llMZIK6KplkjIjf2EvAHcinDi/TfJ9hS25G0388+ClHt6/3but0oOxinTcQHJLDXh6w1crzFQ==}+ dev: false++ /@lezer/[email protected]:+ resolution: {integrity: sha512-WrS5Mw51sGrpqjlh3d4/fOwpEV2Hd3YOkp9DBt4k8XZQcoTHZFB7sx030A6OcahF4J1nDQAa3jXlTVVYH50IFA==}+ dependencies:+ '@lezer/common': 1.2.1+ dev: false++ /@lezer/[email protected]:+ resolution: {integrity: sha512-xHT2P4S5eeCYECyKNPhr4cbEL9tc8w83SPwRC373o9uEdrvGKTZoJVAGxpOsZckMlEh9W23Pc72ew918RWQOBQ==}+ dependencies:+ '@lezer/common': 1.2.1+ '@lezer/highlight': 1.2.0+ '@lezer/lr': 1.4.0+ dev: false++ /@lezer/[email protected]:+ resolution: {integrity: sha512-Wst46p51km8gH0ZUmeNrtpRYmdlRHUpN1DQd3GFAyKANi8WVz8c2jHYTf1CVScFaCjQw1iO3ZZdqGDxQPRErTg==}+ dependencies:+ '@lezer/common': 1.2.1+ dev: false+/@ljharb/[email protected]:resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==}engines: {node: '>= 0.4'}@@ -4810,7 +4860,7 @@ packages:'@sentry/vercel-edge': 7.109.0'@sentry/webpack-plugin': 1.21.0chalk: 3.0.0react: 18.2.0resolve: 1.22.8rollup: 2.78.0@@ -5620,7 +5670,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.2react: 18.2.0react-dom: 18.2.0([email protected])dev: false@@ -6306,6 +6356,75 @@ packages:eslint-visitor-keys: 3.4.3dev: true+ /@uiw/[email protected](@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected]):+ resolution: {integrity: sha512-eeUKlmEE8aSoSgelS8OR2elcPGntpRo669XinAqPCLa0eKorT2B0d3ts+AE+njAeGk744tiyAEbHb2n+6OQmJw==}+ peerDependencies:+ '@codemirror/autocomplete': '>=6.0.0'+ '@codemirror/commands': '>=6.0.0'+ '@codemirror/language': '>=6.0.0'+ '@codemirror/lint': '>=6.0.0'+ '@codemirror/search': '>=6.0.0'+ '@codemirror/state': '>=6.0.0'+ '@codemirror/view': '>=6.0.0'+ dependencies:+ '@codemirror/autocomplete': 6.15.0(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected])+ '@codemirror/commands': 6.3.3+ '@codemirror/language': 6.10.1+ '@codemirror/lint': 6.5.0+ '@codemirror/search': 6.5.6+ '@codemirror/state': 6.4.1+ '@codemirror/view': 6.26.2+ dev: false++ /@uiw/[email protected](@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected]):+ resolution: {integrity: sha512-RDS9s/Lbi1uIvupIXNiREFMryZjd7X4xRMKzmf6NfZuXWVdDATTA1b5smzxXldJgl8bY4QoOevczRncFTVRfGA==}+ dependencies:+ '@uiw/codemirror-themes': 4.21.25(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])+ transitivePeerDependencies:+ - '@codemirror/language'+ - '@codemirror/state'+ - '@codemirror/view'+ dev: false++ /@uiw/[email protected](@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected]):+ resolution: {integrity: sha512-C3t/voELxQj0eaVhrlgzaOnSALNf8bOcRbL5xN9r2+RkdsbFOmvNl3VVhlxEB7PSGc1jUZwVO4wQsB2AP178ag==}+ peerDependencies:+ '@codemirror/language': '>=6.0.0'+ '@codemirror/state': '>=6.0.0'+ '@codemirror/view': '>=6.0.0'+ dependencies:+ '@codemirror/language': 6.10.1+ '@codemirror/state': 6.4.1+ '@codemirror/view': 6.26.2+ dev: false++ /@uiw/[email protected](@babel/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])([email protected])([email protected])([email protected]):+ resolution: {integrity: sha512-mBrCoiffQ+hbTqV1JoixFEcH7BHXkS3PjTyNH7dE8Gzf3GSBRazhtSM5HrAFIiQ5FIRGFs8Gznc4UAdhtevMmw==}+ peerDependencies:+ '@babel/runtime': '>=7.11.0'+ '@codemirror/state': '>=6.0.0'+ '@codemirror/theme-one-dark': '>=6.0.0'+ '@codemirror/view': '>=6.0.0'+ codemirror: '>=6.0.0'+ react: '>=16.8.0'+ react-dom: '>=16.8.0'+ dependencies:+ '@babel/runtime': 7.24.0+ '@codemirror/commands': 6.3.3+ '@codemirror/state': 6.4.1+ '@codemirror/theme-one-dark': 6.1.2+ '@codemirror/view': 6.26.2+ '@uiw/codemirror-extensions-basic-setup': 4.21.25(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])+ codemirror: 6.0.1(@lezer/[email protected])+ react: 18.2.0+ react-dom: 18.2.0([email protected])+ transitivePeerDependencies:+ - '@codemirror/autocomplete'+ - '@codemirror/language'+ - '@codemirror/lint'+ - '@codemirror/search'+ dev: false+/@ungap/[email protected]:resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}dev: true@@ -7512,6 +7631,20 @@ packages:periscopic: 3.1.0dev: false+ /[email protected](@lezer/[email protected]):+ resolution: {integrity: sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==}+ dependencies:+ '@codemirror/autocomplete': 6.15.0(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])(@lezer/[email protected])+ '@codemirror/commands': 6.3.3+ '@codemirror/language': 6.10.1+ '@codemirror/lint': 6.5.0+ '@codemirror/search': 6.5.6+ '@codemirror/state': 6.4.1+ '@codemirror/view': 6.26.2+ transitivePeerDependencies:+ - '@lezer/common'+ dev: false+resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==}dev: true@@ -7704,6 +7837,10 @@ packages:resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==}+ resolution: {integrity: sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==}+ dev: false+resolution: {integrity: sha512-Q6j2XtBYUUZyhTFueUdDrfe0/JF9fDob6+HuoHN3/DP0KPnpQhQ+YpKEIXkAwK9Nx5V7Km531SbBUaXsp6QqNw==}requiresBuild: true@@ -12309,7 +12446,7 @@ packages:'@panva/hkdf': 1.1.1cookie: 0.5.0jose: 4.15.5nodemailer: 6.9.13oauth: 0.9.15openid-client: 5.6.5@@ -12327,13 +12464,13 @@ packages:react: ^16.8.0 || ^17.0.0 || ^18.0.0use-query-params: ^2.0.0dependencies:react: 18.2.0tslib: 2.6.2use-query-params: 2.2.1([email protected])([email protected])dev: falseresolution: {integrity: sha512-1WTaXeSrUwlz/XcnhGTY7+8eiaFvdet5z9u3V2jb+Ek1vFo0VhHKSAIJvDWfQpttWjnyw14kBeq28TPq7bTeEQ==}engines: {node: '>=18.17.0'}hasBin: true@@ -12356,7 +12493,7 @@ packages:postcss: 8.4.31react: 18.2.0react-dom: 18.2.0([email protected])- styled-jsx: 5.1.1(@babel/[email protected])([email protected])+ styled-jsx: 5.1.1(@babel/[email protected])([email protected])optionalDependencies:'@next/swc-darwin-arm64': 14.1.4'@next/swc-darwin-x64': 14.1.4@@ -14893,7 +15030,11 @@ packages:resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==}dev: false+ resolution: {integrity: sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==}+ dev: false+resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==}engines: {node: '>= 12.0.0'}peerDependencies:@@ -14906,7 +15047,7 @@ packages:babel-plugin-macros:optional: truedependencies:- '@babel/core': 7.24.4+ '@babel/core': 7.24.3client-only: 0.0.1react: 18.2.0dev: false@@ -15928,6 +16069,10 @@ packages:typescript: 5.4.4dev: false+ resolution: {integrity: sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==}+ dev: false+resolution: {integrity: sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==}engines: {node: '>=14'}diff --git a/web/package.json b/web/package.jsonindex 4d833ea29c..8c88ec92c0 100644--- a/web/package.json+++ b/web/package.json@@ -25,6 +25,7 @@"@aws-sdk/client-s3": "^3.550.0","@aws-sdk/lib-storage": "^3.550.0","@aws-sdk/s3-request-presigner": "^3.540.0",+ "@codemirror/lang-json": "^6.0.1","@headlessui/react": "^1.7.18","@heroicons/react": "^2.1.3","@hookform/resolvers": "^3.3.4",@@ -71,6 +72,8 @@"@trpc/next": "^10.45.0","@trpc/react-query": "^10.45.0","@trpc/server": "^10.45.0",+ "@uiw/codemirror-theme-github": "^4.21.25",+ "@uiw/react-codemirror": "^4.21.25","ai": "^3.0.20","bcryptjs": "^2.4.3","class-variance-authority": "^0.7.0",diff --git a/web/src/components/json-editor.tsx b/web/src/components/json-editor.tsxnew file mode 100644index 0000000000..e011ccd9e2--- /dev/null+++ b/web/src/components/json-editor.tsx@@ -0,0 +1,33 @@+import CodeMirror, { EditorView } from "@uiw/react-codemirror";+import { githubLight } from "@uiw/codemirror-theme-github";+import { json } from "@codemirror/lang-json";++// todo: add json linting++export function JsonEditor({+ defaultValue,+ onChange,+ editable = true,+ lineWrapping = true,+}: {+ defaultValue: string;+ onChange?: (value: string) => void;+ editable?: boolean;+ lineWrapping?: boolean;+}) {+ return (+ <CodeMirror+ value={defaultValue}+ theme={githubLight}+ basicSetup={{+ foldGutter: true,+ }}+ lang={"json"}+ extensions={[json(), ...(lineWrapping ? [EditorView.lineWrapping] : [])]}+ defaultValue={defaultValue}+ onChange={onChange}+ className="overflow-hidden rounded-md border"+ editable={editable}+ />+ );+}diff --git a/web/src/components/table/use-cases/traces.tsx b/web/src/components/table/use-cases/traces.tsxindex a2fce7a653..497acc617f 100644--- a/web/src/components/table/use-cases/traces.tsx+++ b/web/src/components/table/use-cases/traces.tsx@@ -467,9 +467,7 @@ export default function TracesTable({id: "input",cell: ({ row }) => {const traceId: string = row.getValue("id");- return (- <TracesIOCell traceId={traceId} projectId={projectId} io="input" />- );+ return <TracesIOCell traceId={traceId} io="input" />;},enableHiding: true,defaultHidden: true,@@ -480,9 +478,7 @@ export default function TracesTable({id: "output",cell: ({ row }) => {const traceId: string = row.getValue("id");- return (- <TracesIOCell traceId={traceId} projectId={projectId} io="output" />- );+ return <TracesIOCell traceId={traceId} io="output" />;},enableHiding: true,defaultHidden: true,@@ -644,11 +640,9 @@ export default function TracesTable({}const TracesIOCell = ({- projectId,traceId,io,}: {- projectId: string;traceId: string;io: "input" | "output";}) => {diff --git a/web/src/features/datasets/components/EditDatasetItem.tsx b/web/src/features/datasets/components/EditDatasetItem.tsxindex c274b2de48..4483acd9c9 100644--- a/web/src/features/datasets/components/EditDatasetItem.tsx+++ b/web/src/features/datasets/components/EditDatasetItem.tsx@@ -11,9 +11,9 @@ import {FormLabel,FormMessage,} from "@/src/components/ui/form";-import { Textarea } from "@/src/components/ui/textarea";import { Button } from "@/src/components/ui/button";import { useHasAccess } from "@/src/features/rbac/utils/checkAccess";+import { JsonEditor } from "@/src/components/json-editor";import { type RouterOutput } from "@/src/utils/types";const formSchema = z.object({@@ -27,7 +27,10 @@ const formSchema = z.object({return false;}},- { message: "Invalid JSON" },+ {+ message:+ "Invalid input. Please provide a JSON object or double-quoted string.",+ },),expectedOutput: z.string().refine((value) => {@@ -39,7 +42,10 @@ const formSchema = z.object({return false;}},- { message: "Invalid JSON" },+ {+ message:+ "Invalid input. Please provide a JSON object or double-quoted string.",+ },),});@@ -114,10 +120,13 @@ export const EditDatasetItem = ({<FormItem><FormLabel>Input</FormLabel><FormControl>- <Textarea- {...field}- className="min-h-[200px] font-mono text-xs"- disabled={!hasAccess}+ <JsonEditor+ defaultValue={field.value}+ onChange={(v) => {+ setHasChanges(true);+ field.onChange(v);+ }}+ editable={hasAccess}/></FormControl><FormMessage />@@ -131,10 +140,13 @@ export const EditDatasetItem = ({<FormItem><FormLabel>Expected output</FormLabel><FormControl>- <Textarea- {...field}- className="min-h-[200px] font-mono text-xs"- disabled={!hasAccess}+ <JsonEditor+ defaultValue={field.value}+ onChange={(v) => {+ setHasChanges(true);+ field.onChange(v);+ }}+ editable={hasAccess}/></FormControl><FormMessage />diff --git a/web/src/features/datasets/components/NewDatasetItemForm.tsx b/web/src/features/datasets/components/NewDatasetItemForm.tsxindex e72ae8c5b2..f2f5cb40bf 100644--- a/web/src/features/datasets/components/NewDatasetItemForm.tsx+++ b/web/src/features/datasets/components/NewDatasetItemForm.tsx@@ -20,7 +20,7 @@ import {import { api } from "@/src/utils/api";import { useState } from "react";import { usePostHog } from "posthog-js/react";-import { Textarea } from "@/src/components/ui/textarea";+import { JsonEditor } from "@/src/components/json-editor";import { type Prisma } from "@langfuse/shared/src/db";import { cn } from "@/src/utils/tailwind";@@ -38,7 +38,7 @@ const formSchema = z.object({},{message:- "Invalid input. Please provide a JSON object or a string value enclosed in double quotes.",+ "Invalid input. Please provide a JSON object or double-quoted string.",},),expectedOutput: z.string().refine(@@ -53,7 +53,7 @@ const formSchema = z.object({},{message:- "Invalid input. Please provide a JSON object or a string value enclosed in double quotes.",+ "Invalid input. Please provide a JSON object or double-quoted string.",},),});@@ -149,9 +149,9 @@ export const NewDatasetItemForm = (props: {<FormItem className="flex flex-col gap-2"><FormLabel>Input</FormLabel><FormControl>- <Textarea- {...field}- className="min-h-[150px] flex-1 font-mono text-xs"+ <JsonEditor+ defaultValue={field.value}+ onChange={field.onChange}/></FormControl><FormMessage />@@ -165,9 +165,9 @@ export const NewDatasetItemForm = (props: {<FormItem className="flex flex-col gap-2"><FormLabel>Expected output</FormLabel><FormControl>- <Textarea- {...field}- className="min-h-[150px] flex-1 font-mono text-xs"+ <JsonEditor+ defaultValue={field.value}+ onChange={field.onChange}/></FormControl><FormMessage />diff --git a/web/src/pages/project/[projectId]/datasets/[datasetId]/items/[itemId].tsx b/web/src/pages/project/[projectId]/datasets/[datasetId]/items/[itemId].tsxindex 0127fab33b..ed186e4df1 100644--- a/web/src/pages/project/[projectId]/datasets/[datasetId]/items/[itemId].tsx+++ b/web/src/pages/project/[projectId]/datasets/[datasetId]/items/[itemId].tsx@@ -18,11 +18,16 @@ export default function Dataset() {datasetId,projectId,});- const item = api.datasets.itemById.useQuery({- datasetId,- projectId,- datasetItemId: itemId,- });+ const item = api.datasets.itemById.useQuery(+ {+ datasetId,+ projectId,+ datasetItemId: itemId,+ },+ {+ refetchOnWindowFocus: false, // breaks dirty form state+ },+ );return (<div>