From ecabe7ef770780dc7c1b23e3103c0ef7b5c14daf Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 09:10:25 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Bolt:=20Memoize=20WBGraph=20compone?= =?UTF-8?q?nt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Wraps WBGraph in React.memo to prevent unnecessary re-renders when parent state changes (e.g. toggling UI options) - Removes unused 'Label' import and commented-out code - Adds type safety to Recharts custom render functions --- components/WBGraph.tsx | 28 +++---- lint_output.txt | 174 +++++++++++++++++++++++++++++++++++++++++ lint_output_2.txt | 170 ++++++++++++++++++++++++++++++++++++++++ server.log | 21 +++++ 4 files changed, 374 insertions(+), 19 deletions(-) create mode 100644 lint_output.txt create mode 100644 lint_output_2.txt create mode 100644 server.log diff --git a/components/WBGraph.tsx b/components/WBGraph.tsx index 712ab99..b2eacb2 100644 --- a/components/WBGraph.tsx +++ b/components/WBGraph.tsx @@ -1,5 +1,6 @@ "use client"; +import { memo } from "react"; import { ScatterChart, Scatter, @@ -9,7 +10,6 @@ import { Tooltip, ResponsiveContainer, ReferenceLine, - Label, } from "recharts"; import { EnvelopePoint } from "../data/aircraft"; @@ -22,21 +22,21 @@ interface WBGraphProps { isDark: boolean; } -const RenderTakeoffPoint = (props: any) => { +const RenderTakeoffPoint = (props: { cx: number; cy: number }) => { const { cx, cy } = props; return ( ); }; -const RenderLandingPoint = (props: any) => { +const RenderLandingPoint = (props: { cx: number; cy: number }) => { const { cx, cy } = props; return ( ); }; -export default function WBGraph({ envelope, takeoffWeight, takeoffCG, landingWeight, landingCG, isDark }: WBGraphProps) { +function WBGraph({ envelope, takeoffWeight, takeoffCG, landingWeight, landingCG, isDark }: WBGraphProps) { const takeoffPoint = [{ cg: takeoffCG, weight: takeoffWeight }]; const landingPoint = landingWeight ? [{ cg: landingCG, weight: landingWeight }] : []; @@ -72,13 +72,7 @@ export default function WBGraph({ envelope, takeoffWeight, takeoffCG, landingWei stroke={axisColor} tick={{ fill: axisColor, fontSize: 12 }} > - {/*