From b18a71a0c5db149ff2d813030b5eb7179937d657 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Wed, 12 Mar 2025 10:04:56 -0600 Subject: [PATCH] fix the broken chart rendering --- web/package-lock.json | 202 +++++++++--------- web/package.json | 16 +- .../ui/charts/BusterChartErrorWrapper.tsx | 2 +- .../BusterChartJS/BusterChartJSComponent.tsx | 4 +- .../ui/charts/BusterChartJS/ChartJSTheme.ts | 4 +- .../hooks/useOptions/useXAxis.ts | 8 - .../hooks/useOptions/useYAxis.ts | 2 - .../MetricController/MetricController.tsx | 11 +- .../MetricViewChart/MetricViewChartHeader.tsx | 12 +- web/src/hooks/useMemoizedFn.ts | 28 ++- web/src/layouts/AppAssetCheckLayout.tsx | 2 - .../ChatResponseReasoning.tsx | 9 +- web/src/lib/chat.ts | 1 + 13 files changed, 155 insertions(+), 146 deletions(-) diff --git a/web/package-lock.json b/web/package-lock.json index eed3e296a..867bcf662 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -28,12 +28,12 @@ "@radix-ui/react-tabs": "^1.1.3", "@radix-ui/react-tooltip": "^1.1.8", "@supabase/ssr": "^0.5.2", - "@tanstack/react-query": "^5.67.2", - "@tanstack/react-query-devtools": "^5.67.2", + "@tanstack/react-query": "^5.67.3", + "@tanstack/react-query-devtools": "^5.67.3", "@types/jest": "^29.5.14", "@types/prettier": "^2.7.3", "@types/react-color": "^3.0.13", - "axios": "^1.8.2", + "axios": "^1.8.3", "canvas-confetti": "^1.9.3", "chart.js": "^4.4.8", "chartjs-adapter-dayjs-4": "^1.0.4", @@ -44,7 +44,7 @@ "dayjs": "^1.11.13", "email-validator": "^2.0.4", "font-color-contrast": "^11.1.0", - "framer-motion": "^12.4.10", + "framer-motion": "^12.5.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "js-cookie": "^3.0.5", @@ -54,10 +54,10 @@ "monaco-yaml": "^5.3.1", "mutative": "^1.1.0", "next": "14.2.24", - "next-themes": "^0.4.5", + "next-themes": "^0.4.6", "papaparse": "^5.5.2", "pluralize": "^8.0.0", - "posthog-js": "^1.229.5", + "posthog-js": "^1.230.2", "prettier": "^3.5.3", "prettier-plugin-tailwindcss": "^0.6.11", "react": "^18", @@ -87,7 +87,7 @@ "@storybook/nextjs": "^8.6.4", "@storybook/react": "^8.6.4", "@storybook/test": "^8.6.4", - "@tailwindcss/postcss": "4.0.12", + "@tailwindcss/postcss": "4.0.13", "@testing-library/react": "^16.2.0", "@types/canvas-confetti": "^1.9.0", "@types/js-cookie": "^3.0.6", @@ -105,7 +105,7 @@ "msw-storybook-addon": "^2.0.4", "sass": "^1.85.1", "tailwind-scrollbar": "^4.0.1", - "tailwindcss": "4.0.12", + "tailwindcss": "4.0.13", "tailwindcss-animate": "^1.0.7", "typescript": "^5" }, @@ -6395,44 +6395,44 @@ } }, "node_modules/@tailwindcss/node": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.0.12.tgz", - "integrity": "sha512-a6J11K1Ztdln9OrGfoM75/hChYPcHYGNYimqciMrvKXRmmPaS8XZTHhdvb5a3glz4Kd4ZxE1MnuFE2c0fGGmtg==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.0.13.tgz", + "integrity": "sha512-P9TmtE9Vew0vv5FwyD4bsg/dHHsIsAuUXkenuGUc5gm8fYgaxpdoxIKngCyEMEQxyCKR8PQY5V5VrrKNOx7exg==", "dev": true, "license": "MIT", "dependencies": { "enhanced-resolve": "^5.18.1", "jiti": "^2.4.2", - "tailwindcss": "4.0.12" + "tailwindcss": "4.0.13" } }, "node_modules/@tailwindcss/oxide": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.0.12.tgz", - "integrity": "sha512-DWb+myvJB9xJwelwT9GHaMc1qJj6MDXRDR0CS+T8IdkejAtu8ctJAgV4r1drQJLPeS7mNwq2UHW2GWrudTf63A==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.0.13.tgz", + "integrity": "sha512-pTH3Ex5zAWC9LbS+WsYAFmkXQW3NRjmvxkKJY3NP1x0KHBWjz0Q2uGtdGMJzsa0EwoZ7wq9RTbMH1UNPceCpWw==", "dev": true, "license": "MIT", "engines": { "node": ">= 10" }, "optionalDependencies": { - "@tailwindcss/oxide-android-arm64": "4.0.12", - "@tailwindcss/oxide-darwin-arm64": "4.0.12", - "@tailwindcss/oxide-darwin-x64": "4.0.12", - "@tailwindcss/oxide-freebsd-x64": "4.0.12", - "@tailwindcss/oxide-linux-arm-gnueabihf": "4.0.12", - "@tailwindcss/oxide-linux-arm64-gnu": "4.0.12", - "@tailwindcss/oxide-linux-arm64-musl": "4.0.12", - "@tailwindcss/oxide-linux-x64-gnu": "4.0.12", - "@tailwindcss/oxide-linux-x64-musl": "4.0.12", - "@tailwindcss/oxide-win32-arm64-msvc": "4.0.12", - "@tailwindcss/oxide-win32-x64-msvc": "4.0.12" + "@tailwindcss/oxide-android-arm64": "4.0.13", + "@tailwindcss/oxide-darwin-arm64": "4.0.13", + "@tailwindcss/oxide-darwin-x64": "4.0.13", + "@tailwindcss/oxide-freebsd-x64": "4.0.13", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.0.13", + "@tailwindcss/oxide-linux-arm64-gnu": "4.0.13", + "@tailwindcss/oxide-linux-arm64-musl": "4.0.13", + "@tailwindcss/oxide-linux-x64-gnu": "4.0.13", + "@tailwindcss/oxide-linux-x64-musl": "4.0.13", + "@tailwindcss/oxide-win32-arm64-msvc": "4.0.13", + "@tailwindcss/oxide-win32-x64-msvc": "4.0.13" } }, "node_modules/@tailwindcss/oxide-android-arm64": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.0.12.tgz", - "integrity": "sha512-dAXCaemu3mHLXcA5GwGlQynX8n7tTdvn5i1zAxRvZ5iC9fWLl5bGnjZnzrQqT7ttxCvRwdVf3IHUnMVdDBO/kQ==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.0.13.tgz", + "integrity": "sha512-+9zmwaPQ8A9ycDcdb+hRkMn6NzsmZ4YJBsW5Xqq5EdOu9xlIgmuMuJauVzDPB5BSbIWfhPdZ+le8NeRZpl1coA==", "cpu": [ "arm64" ], @@ -6447,9 +6447,9 @@ } }, "node_modules/@tailwindcss/oxide-darwin-arm64": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.0.12.tgz", - "integrity": "sha512-vPNI+TpJQ7sizselDXIJdYkx9Cu6JBdtmRWujw9pVIxW8uz3O2PjgGGzL/7A0sXI8XDjSyRChrUnEW9rQygmJQ==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.0.13.tgz", + "integrity": "sha512-Bj1QGlEJSjs/205CIRfb5/jeveOqzJ4pFMdRxu0gyiYWxBRyxsExXqaD+7162wnLP/EDKh6S1MC9E/1GwEhLtA==", "cpu": [ "arm64" ], @@ -6464,9 +6464,9 @@ } }, "node_modules/@tailwindcss/oxide-darwin-x64": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.0.12.tgz", - "integrity": "sha512-RL/9jM41Fdq4Efr35C5wgLx98BirnrfwuD+zgMFK6Ir68HeOSqBhW9jsEeC7Y/JcGyPd3MEoJVIU4fAb7YLg7A==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.0.13.tgz", + "integrity": "sha512-lRTkxjTpMGXhLLM5GjZ0MtjPczMuhAo9j7PeSsaU6Imkm7W7RbrXfT8aP934kS7cBBV+HKN5U19Z0WWaORfb8Q==", "cpu": [ "x64" ], @@ -6481,9 +6481,9 @@ } }, "node_modules/@tailwindcss/oxide-freebsd-x64": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.0.12.tgz", - "integrity": "sha512-7WzWiax+LguJcMEimY0Q4sBLlFXu1tYxVka3+G2M9KmU/3m84J3jAIV4KZWnockbHsbb2XgrEjtlJKVwHQCoRA==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.0.13.tgz", + "integrity": "sha512-p/YLyKhs+xFibVeAPlpMGDVMKgjChgzs12VnDFaaqRSJoOz+uJgRSKiir2tn50e7Nm4YYw35q/DRBwpDBNo1MQ==", "cpu": [ "x64" ], @@ -6498,9 +6498,9 @@ } }, "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.0.12.tgz", - "integrity": "sha512-X9LRC7jjE1QlfIaBbXjY0PGeQP87lz5mEfLSVs2J1yRc9PSg1tEPS9NBqY4BU9v5toZgJgzKeaNltORyTs22TQ==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.0.13.tgz", + "integrity": "sha512-Ua/5ydE/QOTX8jHuc7M9ICWnaLi6K2MV/r+Ws2OppsOjy8tdlPbqYainJJ6Kl7ofm524K+4Fk9CQITPzeIESPw==", "cpu": [ "arm" ], @@ -6515,9 +6515,9 @@ } }, "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.0.12.tgz", - "integrity": "sha512-i24IFNq2402zfDdoWKypXz0ZNS2G4NKaA82tgBlE2OhHIE+4mg2JDb5wVfyP6R+MCm5grgXvurcIcKWvo44QiQ==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.0.13.tgz", + "integrity": "sha512-/W1+Q6tBAVgZWh/bhfOHo4n7Ryh6E7zYj4bJd9SRbkPyLtRioyK3bi6RLuDj57sa7Amk/DeomSV9iycS0xqIPA==", "cpu": [ "arm64" ], @@ -6532,9 +6532,9 @@ } }, "node_modules/@tailwindcss/oxide-linux-arm64-musl": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.0.12.tgz", - "integrity": "sha512-LmOdshJBfAGIBG0DdBWhI0n5LTMurnGGJCHcsm9F//ISfsHtCnnYIKgYQui5oOz1SUCkqsMGfkAzWyNKZqbGNw==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.0.13.tgz", + "integrity": "sha512-GQj6TWevNxwsYw20FdT2r2d1f7uiRsF07iFvNYxPIvIyPEV74eZ0zgFEsAH1daK1OxPy+LXdZ4grV17P5tVzhQ==", "cpu": [ "arm64" ], @@ -6549,9 +6549,9 @@ } }, "node_modules/@tailwindcss/oxide-linux-x64-gnu": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.0.12.tgz", - "integrity": "sha512-OSK667qZRH30ep8RiHbZDQfqkXjnzKxdn0oRwWzgCO8CoTxV+MvIkd0BWdQbYtYuM1wrakARV/Hwp0eA/qzdbw==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.0.13.tgz", + "integrity": "sha512-sQRH09faifF9w9WS6TKDWr1oLi4hoPx0EIWXZHQK/jcjarDpXGQ2DbF0KnALJCwWBxOIP/1nrmU01fZwwMzY3g==", "cpu": [ "x64" ], @@ -6566,9 +6566,9 @@ } }, "node_modules/@tailwindcss/oxide-linux-x64-musl": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.0.12.tgz", - "integrity": "sha512-uylhWq6OWQ8krV8Jk+v0H/3AZKJW6xYMgNMyNnUbbYXWi7hIVdxRKNUB5UvrlC3RxtgsK5EAV2i1CWTRsNcAnA==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.0.13.tgz", + "integrity": "sha512-Or1N8DIF3tP+LsloJp+UXLTIMMHMUcWXFhJLCsM4T7MzFzxkeReewRWXfk5mk137cdqVeUEH/R50xAhY1mOkTQ==", "cpu": [ "x64" ], @@ -6583,9 +6583,9 @@ } }, "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.0.12.tgz", - "integrity": "sha512-XDLnhMoXZEEOir1LK43/gHHwK84V1GlV8+pAncUAIN2wloeD+nNciI9WRIY/BeFTqES22DhTIGoilSO39xDb2g==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.0.13.tgz", + "integrity": "sha512-u2mQyqCFrr9vVTP6sfDRfGE6bhOX3/7rInehzxNhHX1HYRIx09H3sDdXzTxnZWKOjIg3qjFTCrYFUZckva5PIg==", "cpu": [ "arm64" ], @@ -6600,9 +6600,9 @@ } }, "node_modules/@tailwindcss/oxide-win32-x64-msvc": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.0.12.tgz", - "integrity": "sha512-I/BbjCLpKDQucvtn6rFuYLst1nfFwSMYyPzkx/095RE+tuzk5+fwXuzQh7T3fIBTcbn82qH/sFka7yPGA50tLw==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.0.13.tgz", + "integrity": "sha512-sOEc4iCanp1Yqyeu9suQcEzfaUcHnqjBUgDg0ZXpjUMUwdSi37S1lu1RGoV1BYInvvGu3y3HHTmvsSfDhx2L8w==", "cpu": [ "x64" ], @@ -6617,24 +6617,24 @@ } }, "node_modules/@tailwindcss/postcss": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@tailwindcss/postcss/-/postcss-4.0.12.tgz", - "integrity": "sha512-r59Sdr8djCW4dL3kvc4aWU8PHdUAVM3O3te2nbYzXsWwKLlHPCuUoZAc9FafXb/YyNDZOMI7sTbKTKFmwOrMjw==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@tailwindcss/postcss/-/postcss-4.0.13.tgz", + "integrity": "sha512-zTmnPGDYb2HKClTBTBwB+lLQH+Rq4etnQXFXs2lisRyXryUnoJIBByFTljkaK9F1d7o14h6t4NJIlfbZuOHR+A==", "dev": true, "license": "MIT", "dependencies": { "@alloc/quick-lru": "^5.2.0", - "@tailwindcss/node": "4.0.12", - "@tailwindcss/oxide": "4.0.12", - "lightningcss": "^1.29.1", + "@tailwindcss/node": "4.0.13", + "@tailwindcss/oxide": "4.0.13", + "lightningcss": "1.29.2", "postcss": "^8.4.41", - "tailwindcss": "4.0.12" + "tailwindcss": "4.0.13" } }, "node_modules/@tanstack/query-core": { - "version": "5.67.2", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.67.2.tgz", - "integrity": "sha512-+iaFJ/pt8TaApCk6LuZ0WHS/ECVfTzrxDOEL9HH9Dayyb5OVuomLzDXeSaI2GlGT/8HN7bDGiRXDts3LV+u6ww==", + "version": "5.67.3", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.67.3.tgz", + "integrity": "sha512-pq76ObpjcaspAW4OmCbpXLF6BCZP2Zr/J5ztnyizXhSlNe7fIUp0QKZsd0JMkw9aDa+vxDX/OY7N+hjNY/dCGg==", "license": "MIT", "funding": { "type": "github", @@ -6652,12 +6652,12 @@ } }, "node_modules/@tanstack/react-query": { - "version": "5.67.2", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.67.2.tgz", - "integrity": "sha512-6Sa+BVNJWhAV4QHvIqM73norNeGRWGC3ftN0Ix87cmMvI215I1wyJ44KUTt/9a0V9YimfGcg25AITaYVel71Og==", + "version": "5.67.3", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.67.3.tgz", + "integrity": "sha512-u/n2HsQeH1vpZIOzB/w2lqKlXUDUKo6BxTdGXSMvNzIq5MHYFckRMVuFABp+QB7RN8LFXWV6X1/oSkuDq+MPIA==", "license": "MIT", "dependencies": { - "@tanstack/query-core": "5.67.2" + "@tanstack/query-core": "5.67.3" }, "funding": { "type": "github", @@ -6668,9 +6668,9 @@ } }, "node_modules/@tanstack/react-query-devtools": { - "version": "5.67.2", - "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.67.2.tgz", - "integrity": "sha512-cmj2DxBc+/9btQ66n5xI8wTtAma2BLVa403K7zIYiguzJ/kV201jnGensYqJeu1Rd8uRMLLRM74jLVMLDWNRJA==", + "version": "5.67.3", + "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.67.3.tgz", + "integrity": "sha512-+PM2UnCyXAQozXB32cnawx38wwnaHPTtFAhX1V5QmHy/FL1u9k7nd8nxn2+GTwf15SGbUaGfxA/vq/9EARUEIQ==", "license": "MIT", "dependencies": { "@tanstack/query-devtools": "5.67.2" @@ -6680,7 +6680,7 @@ "url": "https://github.com/sponsors/tannerlinsley" }, "peerDependencies": { - "@tanstack/react-query": "^5.67.2", + "@tanstack/react-query": "^5.67.3", "react": "^18 || ^19" } }, @@ -8340,9 +8340,9 @@ } }, "node_modules/axios": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.2.tgz", - "integrity": "sha512-ls4GYBm5aig9vWx8AWDSGLpnpDQRtWAfrjU+EuytuODrFBkqesN2RkOQCBzrA1RQNHw1SmRMSDDDSwzNAYQ6Rg==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.3.tgz", + "integrity": "sha512-iP4DebzoNlP/YN2dpwCgb8zoCmhtkajzS48JvwmkSkXvPI3DHc7m+XYL5tGnSlJtR6nImXZmdCuN5aP8dh1d8A==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", @@ -11874,13 +11874,13 @@ } }, "node_modules/framer-motion": { - "version": "12.4.10", - "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.4.10.tgz", - "integrity": "sha512-3Msuyjcr1Pb5hjkn4EJcRe1HumaveP0Gbv4DBMKTPKcV/1GSMkQXj+Uqgneys+9DPcZM18Hac9qY9iUEF5LZtg==", + "version": "12.5.0", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.5.0.tgz", + "integrity": "sha512-buPlioFbH9/W7rDzYh1C09AuZHAk2D1xTA1BlounJ2Rb9aRg84OXexP0GLd+R83v0khURdMX7b5MKnGTaSg5iA==", "license": "MIT", "dependencies": { - "motion-dom": "^12.4.10", - "motion-utils": "^12.4.10", + "motion-dom": "^12.5.0", + "motion-utils": "^12.5.0", "tslib": "^2.4.0" }, "peerDependencies": { @@ -16388,18 +16388,18 @@ } }, "node_modules/motion-dom": { - "version": "12.4.10", - "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.4.10.tgz", - "integrity": "sha512-ISP5u6FTceoD6qKdLupIPU/LyXBrxGox+P2e3mBbm1+pLdlBbwv01YENJr7+1WZnW5ucVKzFScYsV1eXTCG4Xg==", + "version": "12.5.0", + "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.5.0.tgz", + "integrity": "sha512-uH2PETDh7m+Hjd1UQQ56yHqwn83SAwNjimNPE/kC+Kds0t4Yh7+29rfo5wezVFpPOv57U4IuWved5d1x0kNhbQ==", "license": "MIT", "dependencies": { - "motion-utils": "^12.4.10" + "motion-utils": "^12.5.0" } }, "node_modules/motion-utils": { - "version": "12.4.10", - "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-12.4.10.tgz", - "integrity": "sha512-NPwZd94V013SwRf++jMrk2+HEBgPkeIE2RiOzhAuuQlqxMJPkKt/LXVh6Upl+iN8oarSGD2dlY5/bqgsYXDABA==", + "version": "12.5.0", + "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-12.5.0.tgz", + "integrity": "sha512-+hFFzvimn0sBMP9iPxBa9OtRX35ZQ3py0UHnb8U29VD+d8lQ8zH3dTygJWqK7av2v6yhg7scj9iZuvTS0f4+SA==", "license": "MIT" }, "node_modules/ms": { @@ -16583,9 +16583,9 @@ } }, "node_modules/next-themes": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.4.5.tgz", - "integrity": "sha512-E8/gYKBxZknOXBiDk/sRokAvkOw35PTUD4Gxtq1eBhd0r4Dx5S42zU65/q8ozR5rcSG2ZlE1E3+ShlUpC7an+A==", + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.4.6.tgz", + "integrity": "sha512-pZvgD5L0IEvX5/9GWyHMf3m8BKiVQwsCMHfoFosXtXBMnaS0ZnIJ9ST4b4NqLVKDEm8QBxoNNGNaBv2JNF6XNA==", "license": "MIT", "peerDependencies": { "react": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc", @@ -17564,9 +17564,9 @@ "license": "MIT" }, "node_modules/posthog-js": { - "version": "1.229.5", - "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.229.5.tgz", - "integrity": "sha512-M7WewK9nltttOpQ7TVksrTYun+A4MOC3auHQ7IGTEariXfTrRApvWnQFbRTZ1C4kLWFvsvsamotJf9nC+PgCug==", + "version": "1.230.2", + "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.230.2.tgz", + "integrity": "sha512-MciEotiLuByI2L7NMrGYR48yVvurekkCETjPoCmI8XLeDi33L+6glR7mCUH8xQxaoFr3FqK61HlUmvTApnzOgg==", "license": "MIT", "dependencies": { "core-js": "^3.38.1", @@ -20057,9 +20057,9 @@ } }, "node_modules/tailwindcss": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.0.12.tgz", - "integrity": "sha512-bT0hJo91FtncsAMSsMzUkoo/iEU0Xs5xgFgVC9XmdM9bw5MhZuQFjPNl6wxAE0SiQF/YTZJa+PndGWYSDtuxAg==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.0.13.tgz", + "integrity": "sha512-gbvFrB0fOsTv/OugXWi2PtflJ4S6/ctu6Mmn3bCftmLY/6xRsQVEJPgIIpABwpZ52DpONkCA3bEj5b54MHxF2Q==", "dev": true, "license": "MIT" }, diff --git a/web/package.json b/web/package.json index 72b7d981d..1f38fd669 100644 --- a/web/package.json +++ b/web/package.json @@ -36,12 +36,12 @@ "@radix-ui/react-tabs": "^1.1.3", "@radix-ui/react-tooltip": "^1.1.8", "@supabase/ssr": "^0.5.2", - "@tanstack/react-query": "^5.67.2", - "@tanstack/react-query-devtools": "^5.67.2", + "@tanstack/react-query": "^5.67.3", + "@tanstack/react-query-devtools": "^5.67.3", "@types/jest": "^29.5.14", "@types/prettier": "^2.7.3", "@types/react-color": "^3.0.13", - "axios": "^1.8.2", + "axios": "^1.8.3", "canvas-confetti": "^1.9.3", "chart.js": "^4.4.8", "chartjs-adapter-dayjs-4": "^1.0.4", @@ -52,7 +52,7 @@ "dayjs": "^1.11.13", "email-validator": "^2.0.4", "font-color-contrast": "^11.1.0", - "framer-motion": "^12.4.10", + "framer-motion": "^12.5.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "js-cookie": "^3.0.5", @@ -62,10 +62,10 @@ "monaco-yaml": "^5.3.1", "mutative": "^1.1.0", "next": "14.2.24", - "next-themes": "^0.4.5", + "next-themes": "^0.4.6", "papaparse": "^5.5.2", "pluralize": "^8.0.0", - "posthog-js": "^1.229.5", + "posthog-js": "^1.230.2", "prettier": "^3.5.3", "prettier-plugin-tailwindcss": "^0.6.11", "react": "^18", @@ -95,7 +95,7 @@ "@storybook/nextjs": "^8.6.4", "@storybook/react": "^8.6.4", "@storybook/test": "^8.6.4", - "@tailwindcss/postcss": "4.0.12", + "@tailwindcss/postcss": "4.0.13", "@testing-library/react": "^16.2.0", "@types/canvas-confetti": "^1.9.0", "@types/js-cookie": "^3.0.6", @@ -113,7 +113,7 @@ "msw-storybook-addon": "^2.0.4", "sass": "^1.85.1", "tailwind-scrollbar": "^4.0.1", - "tailwindcss": "4.0.12", + "tailwindcss": "4.0.13", "tailwindcss-animate": "^1.0.7", "typescript": "^5" }, diff --git a/web/src/components/ui/charts/BusterChartErrorWrapper.tsx b/web/src/components/ui/charts/BusterChartErrorWrapper.tsx index c5ae9f21c..a35f5e992 100644 --- a/web/src/components/ui/charts/BusterChartErrorWrapper.tsx +++ b/web/src/components/ui/charts/BusterChartErrorWrapper.tsx @@ -10,7 +10,7 @@ interface Props { const ErrorCardComponent: React.FC = () => { return ( diff --git a/web/src/components/ui/charts/BusterChartJS/BusterChartJSComponent.tsx b/web/src/components/ui/charts/BusterChartJS/BusterChartJSComponent.tsx index 45ecf70e7..4df8bcdd8 100644 --- a/web/src/components/ui/charts/BusterChartJS/BusterChartJSComponent.tsx +++ b/web/src/components/ui/charts/BusterChartJS/BusterChartJSComponent.tsx @@ -8,7 +8,7 @@ import { OutLabelsPlugin } from './core'; import { ChartJSOrUndefined, ChartProps } from './core/types'; -import type { ChartType as ChartJSChartType } from 'chart.js'; +import type { ChartType as ChartJSChartType, ChartOptions } from 'chart.js'; import { useColors } from '../chartHooks'; import { useGoalLines, useOptions, useSeriesOptions } from './hooks'; import { useChartSpecificOptions } from './hooks/useChartSpecificOptions'; @@ -123,7 +123,7 @@ export const BusterChartJSComponent = React.memo( y2AxisKeys }); - const options = useOptions({ + const options: ChartOptions = useOptions({ goalLinesAnnotations, trendlineAnnotations, colors, diff --git a/web/src/components/ui/charts/BusterChartJS/ChartJSTheme.ts b/web/src/components/ui/charts/BusterChartJS/ChartJSTheme.ts index 87417d214..a60b5ac25 100644 --- a/web/src/components/ui/charts/BusterChartJS/ChartJSTheme.ts +++ b/web/src/components/ui/charts/BusterChartJS/ChartJSTheme.ts @@ -64,14 +64,14 @@ ChartJS.defaults.color = 'var(--text-secondary)'; ChartJS.defaults.backgroundColor = DEFAULT_CHART_THEME; ChartJS.defaults.font = { family: 'var(--font-sans)', - size: 10, + size: 12, weight: 'normal' }; export const DEFAULT_CHART_LAYOUT = { autoPadding: true, padding: { - top: 10, + top: 14, bottom: 0, left: 4, right: 4 diff --git a/web/src/components/ui/charts/BusterChartJS/hooks/useOptions/useXAxis.ts b/web/src/components/ui/charts/BusterChartJS/hooks/useOptions/useXAxis.ts index 81224d6f8..781c26b96 100644 --- a/web/src/components/ui/charts/BusterChartJS/hooks/useOptions/useXAxis.ts +++ b/web/src/components/ui/charts/BusterChartJS/hooks/useOptions/useXAxis.ts @@ -210,11 +210,3 @@ export const useXAxis = ({ return memoizedXAxisOptions; }; - -const arrayOfValidTimeUnits: XAxisConfig['xAxisTimeInterval'][] = [ - 'day', - 'week', - 'month', - 'quarter', - 'year' -]; diff --git a/web/src/components/ui/charts/BusterChartJS/hooks/useOptions/useYAxis.ts b/web/src/components/ui/charts/BusterChartJS/hooks/useOptions/useYAxis.ts index 9bc95bc99..b50403a12 100644 --- a/web/src/components/ui/charts/BusterChartJS/hooks/useOptions/useYAxis.ts +++ b/web/src/components/ui/charts/BusterChartJS/hooks/useOptions/useYAxis.ts @@ -87,8 +87,6 @@ export const useYAxis = ({ }); const tickCallback = useMemoizedFn(function (this: Scale, value: string | number, index: number) { - // const labelValue = this.getLabelForValue(index); - // const flipValue = this.getLabelForValue(index); return formatYAxisLabel( value, yAxisKeys, diff --git a/web/src/controllers/MetricController/MetricController.tsx b/web/src/controllers/MetricController/MetricController.tsx index eb2f01ade..a5b5a3b46 100644 --- a/web/src/controllers/MetricController/MetricController.tsx +++ b/web/src/controllers/MetricController/MetricController.tsx @@ -18,14 +18,17 @@ export const MetricController: React.FC<{ const showLoader = !isFetchedConfig || !isFetchedMetricData; - const Component = selectedFileView - ? MetricViewComponents[selectedFileView as MetricFileView] - : () => null; + const Component = + selectedFileView in MetricViewComponents + ? MetricViewComponents[selectedFileView as MetricFileView] + : () => <>; + + console.log(selectedFileView); return ( <> {showLoader && } - + {Component && } ); }); diff --git a/web/src/controllers/MetricController/MetricViewChart/MetricViewChartHeader.tsx b/web/src/controllers/MetricController/MetricViewChart/MetricViewChartHeader.tsx index 743d80d82..eaa2949a5 100644 --- a/web/src/controllers/MetricController/MetricViewChart/MetricViewChartHeader.tsx +++ b/web/src/controllers/MetricController/MetricViewChart/MetricViewChartHeader.tsx @@ -13,16 +13,20 @@ export const MetricViewChartHeader: React.FC<{ const hasTitleOrDescription = !!title || !!description; return ( -
+
{hasTitleOrDescription ? ( <> - + {title}
{!!timeFrame && ( <> - + {timeFrame} @@ -31,7 +35,7 @@ export const MetricViewChartHeader: React.FC<{ )} - + {description}
diff --git a/web/src/hooks/useMemoizedFn.ts b/web/src/hooks/useMemoizedFn.ts index 57b5893cd..58d97ca5d 100644 --- a/web/src/hooks/useMemoizedFn.ts +++ b/web/src/hooks/useMemoizedFn.ts @@ -1,17 +1,27 @@ 'use client'; -import { useRef, useMemo } from 'react'; +import { useMemo, useRef } from 'react'; -type AnyFunction = (...args: any[]) => any; +type noop = (this: any, ...args: any[]) => any; -export function useMemoizedFn(fn: T): T { +type PickFunction = ( + this: ThisParameterType, + ...args: Parameters +) => ReturnType; + +export function useMemoizedFn(fn: T) { const fnRef = useRef(fn); - fnRef.current = fn; - return useMemo(() => { - const memoizedFn = (...args: Parameters): ReturnType => { - return fnRef.current(...args); + // why not write `fnRef.current = fn`? + // https://github.com/alibaba/hooks/issues/728 + fnRef.current = useMemo(() => fn, [fn]); + + const memoizedFn = useRef>(); + if (!memoizedFn.current) { + memoizedFn.current = function (this, ...args) { + return fnRef.current.apply(this, args); }; - return memoizedFn as T; - }, []); + } + + return memoizedFn.current as T; } diff --git a/web/src/layouts/AppAssetCheckLayout.tsx b/web/src/layouts/AppAssetCheckLayout.tsx index 334ebe353..3ca5984d9 100644 --- a/web/src/layouts/AppAssetCheckLayout.tsx +++ b/web/src/layouts/AppAssetCheckLayout.tsx @@ -52,8 +52,6 @@ export const AppAssetCheckLayout: React.FC< const { has_access, password_required, public: pagePublic } = res; - console.log('has_access', has_access, password_required, res); - if (has_access || (pagePublic && !password_required)) { return {children}; } diff --git a/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatResponseMessages/ChatResponseReasoning.tsx b/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatResponseMessages/ChatResponseReasoning.tsx index a5d546f58..5f80d0d30 100644 --- a/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatResponseMessages/ChatResponseReasoning.tsx +++ b/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatResponseMessages/ChatResponseReasoning.tsx @@ -1,3 +1,5 @@ +'use client'; + import React, { useMemo } from 'react'; import { ShimmerText } from '@/components/ui/typography/ShimmerText'; import { useMemoizedFn } from '@/hooks'; @@ -29,7 +31,8 @@ export const ChatResponseReasoning: React.FC<{ const finalReasoningMessage = useMessageIndividual(messageId, (x) => x?.final_reasoning_message); const onSetSelectedFile = useChatLayoutContextSelector((x) => x.onSetSelectedFile); const selectedFileType = useChatLayoutContextSelector((x) => x.selectedFileType); - const isReasonginFileSelected = selectedFileType === 'reasoning' && isCompletedStream; + const isReasonginFileSelected = selectedFileType === 'reasoning'; + const showShimmerText = isReasonginFileSelected ? false : !isCompletedStream; const blackBoxMessage = useQuery({ ...queryKeys.chatsBlackBoxMessages(messageId), @@ -57,8 +60,8 @@ export const ChatResponseReasoning: React.FC<{ key={text} className="mb-3.5 flex h-[14px] max-h-[14px] w-fit cursor-pointer items-center" onClick={onClickReasoning}> - {isReasonginFileSelected ? ( - + {!showShimmerText ? ( + {text} ) : ( diff --git a/web/src/lib/chat.ts b/web/src/lib/chat.ts index 07e50d238..d5e3ff3cf 100644 --- a/web/src/lib/chat.ts +++ b/web/src/lib/chat.ts @@ -40,6 +40,7 @@ export const updateChatToIChat = ( chat.messages, isNewChat ? last(chat.message_ids) : undefined ); + console.log(iChatMessages); return { iChat, iChatMessages