From 28f92d0d8fe5b29114adad67c9a135a298b085b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Thu, 16 Jul 2026 00:32:05 +0200 Subject: [PATCH] feat(planner): restyle color-mode selector + chart header on tokens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The elevation chart's 10-mode color selector now uses the Select primitive (token-styled, consistent with ProfileSelector). Chart-header chrome (top border, title link, legend text) moved onto tokens too. Kept as a dropdown rather than a segmented control — 10 modes don't fit a segmented toggle. Canvas/legend data-viz colors are unchanged (task 1.5). Co-Authored-By: Claude Opus 4.8 --- apps/planner/app/components/ElevationChart.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/planner/app/components/ElevationChart.tsx b/apps/planner/app/components/ElevationChart.tsx index a4b5ada..a411d00 100644 --- a/apps/planner/app/components/ElevationChart.tsx +++ b/apps/planner/app/components/ElevationChart.tsx @@ -14,6 +14,7 @@ import { } from "@trails-cool/map-core"; import { drawElevationChart, PADDING } from "~/lib/elevation-chart-draw"; import { useElevationData } from "~/lib/use-elevation-data"; +import { Select } from "@trails-cool/ui"; import { setColorMode, type ColorMode } from "~/lib/route-data"; interface ElevationChartProps { @@ -378,7 +379,7 @@ export function ElevationChart({ yjs, onHover, highlightDistance, onClickPositio if (points.length < 2) return null; return ( -
+
{(() => { const osmLinks: Record = { @@ -402,14 +403,14 @@ export function ElevationChart({ yjs, onHover, highlightDistance, onClickPositio const title = titles[colorMode] ?? t("elevation.profile"); const link = osmLinks[colorMode]; return link ? ( - + {title} ) : ( -

{title}

+

{title}

); })()} -
+
{colorMode === "grade" && (<> {"<3%"} {"<6%"} @@ -480,10 +481,12 @@ export function ElevationChart({ yjs, onHover, highlightDistance, onClickPositio None )}
- +