diff --git a/frontend/components/account/AccountCenter.module.css b/frontend/components/account/AccountCenter.module.css index f8e6c2fe..4c1198d6 100644 --- a/frontend/components/account/AccountCenter.module.css +++ b/frontend/components/account/AccountCenter.module.css @@ -358,7 +358,7 @@ } .spin { - animation: spin 0.9s linear infinite; + animation: :global(spin) 0.9s linear infinite; } @media (max-width: 960px) { diff --git a/frontend/components/dashboard/DashboardMap.module.css b/frontend/components/dashboard/DashboardMap.module.css index 1a3bf206..dbc872ac 100644 --- a/frontend/components/dashboard/DashboardMap.module.css +++ b/frontend/components/dashboard/DashboardMap.module.css @@ -544,7 +544,7 @@ border: 2px solid rgba(34, 211, 238, 0.1); border-top-color: var(--accent-cyan); border-radius: 50%; - animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite; + animation: :global(spin) 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite; box-shadow: 0 0 15px rgba(34, 211, 238, 0.1); } diff --git a/frontend/components/dashboard/DashboardModalGuide.module.css b/frontend/components/dashboard/DashboardModalGuide.module.css index 685f95e9..b56247c6 100644 --- a/frontend/components/dashboard/DashboardModalGuide.module.css +++ b/frontend/components/dashboard/DashboardModalGuide.module.css @@ -86,7 +86,7 @@ } .root :global(.future-refresh-btn.spinning svg) { - animation: spin 1s linear infinite; + animation: :global(spin) 1s linear infinite; color: var(--accent-cyan); } diff --git a/frontend/components/dashboard/DashboardShell.module.css b/frontend/components/dashboard/DashboardShell.module.css index 6d477821..fddf7675 100644 --- a/frontend/components/dashboard/DashboardShell.module.css +++ b/frontend/components/dashboard/DashboardShell.module.css @@ -209,7 +209,7 @@ color: var(--accent-cyan); } .root :global(.refresh-btn.spinning) { - animation: spin 1s linear infinite; + animation: :global(spin) 1s linear infinite; } .root :global(.locale-switch) { diff --git a/frontend/components/dashboard/DetailPanelSections.module.css b/frontend/components/dashboard/DetailPanelSections.module.css index 366ed2f0..98525be7 100644 --- a/frontend/components/dashboard/DetailPanelSections.module.css +++ b/frontend/components/dashboard/DetailPanelSections.module.css @@ -111,7 +111,7 @@ border-radius: 999px; border: 2px solid rgba(34, 211, 238, 0.22); border-top-color: rgba(34, 211, 238, 0.92); - animation: spin 0.8s linear infinite; + animation: :global(spin) 0.8s linear infinite; } .root :global(.panel-meta) { diff --git a/frontend/components/dashboard/FutureForecastModal.module.css b/frontend/components/dashboard/FutureForecastModal.module.css index 442b79cd..7a96c715 100644 --- a/frontend/components/dashboard/FutureForecastModal.module.css +++ b/frontend/components/dashboard/FutureForecastModal.module.css @@ -56,7 +56,7 @@ border: 2px solid rgba(34, 211, 238, 0.18); border-top-color: #22d3ee; border-radius: 999px; - animation: spin 0.8s linear infinite; + animation: :global(spin) 0.8s linear infinite; } .root :global(.future-v2-sync-strip) { diff --git a/frontend/components/dashboard/ScanTerminalCard.module.css b/frontend/components/dashboard/ScanTerminalCard.module.css index 7abedcc0..b3fdf151 100644 --- a/frontend/components/dashboard/ScanTerminalCard.module.css +++ b/frontend/components/dashboard/ScanTerminalCard.module.css @@ -648,7 +648,7 @@ } .root :global(.scan-ai-city-icon-button .spin) { - animation: spin 1s linear infinite; + animation: :global(spin) 1s linear infinite; } .root :global(.scan-ai-city-collapse) { diff --git a/frontend/components/dashboard/ScanTerminalList.module.css b/frontend/components/dashboard/ScanTerminalList.module.css index 6918e25d..778fb5d5 100644 --- a/frontend/components/dashboard/ScanTerminalList.module.css +++ b/frontend/components/dashboard/ScanTerminalList.module.css @@ -95,7 +95,7 @@ } .root :global(.scan-status-chip .spin) { - animation: spin 1s linear infinite; + animation: :global(spin) 1s linear infinite; } .root :global(.scan-table-shell) { diff --git a/frontend/components/dashboard/ScanTerminalShell.module.css b/frontend/components/dashboard/ScanTerminalShell.module.css index 84d78fde..c8531bce 100644 --- a/frontend/components/dashboard/ScanTerminalShell.module.css +++ b/frontend/components/dashboard/ScanTerminalShell.module.css @@ -280,5 +280,5 @@ } .root :global(.scan-ghost-button .spin) { - animation: spin 1s linear infinite; + animation: :global(spin) 1s linear infinite; } diff --git a/frontend/components/dashboard/scan-terminal/AiCityTemperatureChart.tsx b/frontend/components/dashboard/scan-terminal/AiCityTemperatureChart.tsx index c43a8507..f8d8c88c 100644 --- a/frontend/components/dashboard/scan-terminal/AiCityTemperatureChart.tsx +++ b/frontend/components/dashboard/scan-terminal/AiCityTemperatureChart.tsx @@ -1,5 +1,5 @@ import type { ChartConfiguration } from "chart.js"; -import { useMemo, useRef } from "react"; +import { memo, useMemo, useRef } from "react"; import { BarChart3 } from "lucide-react"; import type { CityDetail } from "@/lib/dashboard-types"; import { useChart } from "@/hooks/useChart"; @@ -61,7 +61,7 @@ function buildTemperatureChartSignature(detail: CityDetail) { ].join("::"); } -export function AiCityTemperatureChart({ detail }: { detail: CityDetail }) { +export const AiCityTemperatureChart = memo(function AiCityTemperatureChart({ detail }: { detail: CityDetail }) { const { locale } = useI18n(); const sectionRef = useRef(null); const cityKey = `${detail.name || detail.display_name || ""}:${detail.local_date || ""}`; @@ -71,7 +71,8 @@ export function AiCityTemperatureChart({ detail }: { detail: CityDetail }) { ); const computedChartData = useMemo( () => getTemperatureChartData(detail, locale), - [chartSignature, detail, locale], + // eslint-disable-next-line react-hooks/exhaustive-deps + [chartSignature, locale], ); const lastChartDataRef = useRef<{ cityKey: string; @@ -235,5 +236,5 @@ export function AiCityTemperatureChart({ detail }: { detail: CityDetail }) { ) : null} ); -} +});