Fix theme text visibility, tooltip colours, and chart hover states

- Extract shared TOOLTIP_STYLE and ACTIVE_DOT to utils/chartTheme.ts so
  all four chart files use one source of truth
- itemStyle now uses card-foreground (not muted-foreground) — guarantees
  tooltip text is readable on all themes including Terminal, Vault, Synthwave
- cursor now uses primary at 12% opacity — always visible and thematic,
  replaces near-invisible muted-foreground at 8% opacity
- activeDot is now explicit on every Line/Area — prevents Recharts default
  white dot breaking dark themes
- Terminal: muted-foreground bumped 38%→55% lightness, border lightened,
  warning brightened, text-shadow scoped to headings/labels/table cells
  (was applying to every p and span, causing tooltip glow bleed)
- Synthwave: muted-foreground bumped 56%→68% lightness for legibility
- Vault: muted-foreground bumped 52%→60% lightness

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
megaproxy 2026-04-23 23:14:36 +00:00
parent 54f6f66ff8
commit 1854026a76
6 changed files with 69 additions and 65 deletions

View file

@ -4,26 +4,13 @@ import {
} from "recharts";
import { formatCurrency } from "@/utils/currency";
import type { PortfolioSummary, HoldingResponse } from "@/api/investments";
import { TOOLTIP_STYLE } from "@/utils/chartTheme";
const COLORS = [
"#6366f1","#22c55e","#f97316","#ec4899","#14b8a6",
"#f59e0b","#8b5cf6","#06b6d4","#84cc16","#ef4444",
];
const TOOLTIP_STYLE = {
contentStyle: {
background: "hsl(var(--card))",
border: "1px solid hsl(var(--border))",
borderRadius: "8px",
fontSize: "12px",
color: "hsl(var(--foreground))",
boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
},
labelStyle: { color: "hsl(var(--foreground))", fontWeight: 500, marginBottom: "4px" },
itemStyle: { color: "hsl(var(--muted-foreground))" },
cursor: { fill: "hsl(var(--muted-foreground))", fillOpacity: 0.08 },
};
const TYPE_COLORS: Record<string, string> = {
stock: "#6366f1",
etf: "#22c55e",