From 65192448092e21aa680494312447c806e57a8587 Mon Sep 17 00:00:00 2001 From: Blake Bauman Date: Mon, 20 Jul 2026 00:47:23 -0700 Subject: [PATCH] Polish residual shell chrome and Containers Stop label. Honor reduced motion on live metrics, drop fake GPU history bars, clean Tip placement and skeleton copy, and keep the bulk Stop (n) label as one string so Spectrum alignment stays even. Co-authored-by: Cursor --- app/src/components/ConsolePanel.tsx | 2 -- app/src/components/CopyButton.tsx | 2 -- app/src/components/ExecTerminal.tsx | 2 -- app/src/components/GlassSheet.tsx | 2 -- app/src/components/GpuPanel.tsx | 21 +++++------- app/src/components/HelpHint.tsx | 2 -- app/src/components/InspectFields.tsx | 2 -- app/src/components/ListPane.tsx | 38 +++++++++++++-------- app/src/components/SettingRow.tsx | 2 -- app/src/components/StatusDock.tsx | 37 +++++++------------- app/src/components/charts/MetricChart.tsx | 23 ++++++------- app/src/components/spectrum/StatusBadge.tsx | 8 ++--- app/src/components/spectrum/Tip.tsx | 14 ++++---- app/src/hooks/useEasedSeries.ts | 28 ++++++++++----- app/src/index.css | 6 ++-- app/src/routes/ContainersPage.tsx | 2 +- app/src/routes/DashboardPage.tsx | 14 ++------ 17 files changed, 90 insertions(+), 115 deletions(-) diff --git a/app/src/components/ConsolePanel.tsx b/app/src/components/ConsolePanel.tsx index 7e430d2..51c1ccd 100644 --- a/app/src/components/ConsolePanel.tsx +++ b/app/src/components/ConsolePanel.tsx @@ -25,8 +25,6 @@ export function ConsolePanel({ }: { url: string | null; title?: string; - /** @deprecated Unused — kept for call-site compatibility. */ - className?: string; follow?: boolean; downloadName?: string; }) { diff --git a/app/src/components/CopyButton.tsx b/app/src/components/CopyButton.tsx index ec339c0..03462b9 100644 --- a/app/src/components/CopyButton.tsx +++ b/app/src/components/CopyButton.tsx @@ -29,8 +29,6 @@ export function CopyButton({ value: string; label?: string; copiedLabel?: string; - /** @deprecated Unused — kept for call-site compatibility. */ - className?: string; iconOnly?: boolean; /** Prefer quiet static color on dark console chrome */ dark?: boolean; diff --git a/app/src/components/ExecTerminal.tsx b/app/src/components/ExecTerminal.tsx index 9246d1a..0ce7edc 100644 --- a/app/src/components/ExecTerminal.tsx +++ b/app/src/components/ExecTerminal.tsx @@ -53,8 +53,6 @@ export function ExecTerminal({ }: { /** Base WebSocket URL; `shell` query is appended. */ wsUrl: string; - /** @deprecated Unused — kept for call-site compatibility. */ - className?: string; title?: string; }) { const hostRef = useRef(null); diff --git a/app/src/components/GlassSheet.tsx b/app/src/components/GlassSheet.tsx index ac81a78..0f7d7af 100644 --- a/app/src/components/GlassSheet.tsx +++ b/app/src/components/GlassSheet.tsx @@ -84,8 +84,6 @@ export function TerminalBlock({ copyValue, }: { children: ReactNode; - /** @deprecated Unused — kept for call-site compatibility. */ - className?: string; copyValue?: string; }) { const text = copyValue ?? (typeof children === "string" ? children : ""); diff --git a/app/src/components/GpuPanel.tsx b/app/src/components/GpuPanel.tsx index 69afd91..b592259 100644 --- a/app/src/components/GpuPanel.tsx +++ b/app/src/components/GpuPanel.tsx @@ -5,6 +5,7 @@ import { Content, Heading, IllustratedMessage, + ProgressCircle, Text, Tooltip, TooltipTrigger, @@ -13,7 +14,7 @@ import { style } from "@react-spectrum/s2/style" with { type: "macro" }; import CloudStateError from "@react-spectrum/s2/illustrations/linear/CloudStateError"; import { api, type GPUStatus } from "@/lib/api"; import { HelpHint } from "@/components/HelpHint"; -import { MetricCard, RingGauge, WaveBars } from "@/components/charts/MetricChart"; +import { RingGauge } from "@/components/charts/MetricChart"; export function GpuPanel() { const gpus = useQuery({ queryKey: ["gpus"], queryFn: api.gpus, refetchInterval: 4000 }); @@ -32,7 +33,7 @@ export function GpuPanel() { textAlign: "center", })} > - + Probing GPUs… ); @@ -155,17 +156,13 @@ export function GpuPanel() {
- - + - + ); diff --git a/app/src/components/HelpHint.tsx b/app/src/components/HelpHint.tsx index 2409cec..a231aec 100644 --- a/app/src/components/HelpHint.tsx +++ b/app/src/components/HelpHint.tsx @@ -18,8 +18,6 @@ export function HelpHint({ /** Optional popover title; omit for tip-only content. */ title?: string; side?: "top" | "right" | "bottom" | "left"; - /** @deprecated Unused — kept for call-site compatibility. */ - className?: string; }) { return ( diff --git a/app/src/components/InspectFields.tsx b/app/src/components/InspectFields.tsx index 15ebd7e..7c8a0ee 100644 --- a/app/src/components/InspectFields.tsx +++ b/app/src/components/InspectFields.tsx @@ -7,8 +7,6 @@ export function InspectFields({ rows, }: { rows: { label: string; value?: ReactNode; copy?: string; mono?: boolean }[]; - /** @deprecated Unused — kept for call-site compatibility. */ - className?: string; }) { const visible = rows.filter((r) => r.value != null && r.value !== ""); if (!visible.length) return null; diff --git a/app/src/components/ListPane.tsx b/app/src/components/ListPane.tsx index 920e16c..69ce238 100644 --- a/app/src/components/ListPane.tsx +++ b/app/src/components/ListPane.tsx @@ -176,15 +176,30 @@ export function ListSkeleton({ rows = 6 }: { rows?: number }) { borderRadius: "lg", paddingX: 12, paddingY: 12, + display: "flex", + flexDirection: "column", + gap: 8, })} style={{ opacity: 1 - i * 0.1 }} > - - Loading item title placeholder - - - Secondary loading detail line - +
+
))} @@ -245,21 +260,16 @@ export function ListEmpty({ export function ListPaneScroll({ className, - contentClassName, style: inlineStyle, children, empty, loading, }: { className?: string; - /** @deprecated Unused — header is no longer absolutely positioned. */ - contentClassName?: string; style?: CSSProperties; children: ReactNode; empty?: ReactNode; loading?: boolean; - /** @deprecated Unused — header is no longer absolutely positioned. */ - hasSearch?: boolean; }) { const hasItems = Array.isArray(children) ? children.length > 0 @@ -342,7 +352,7 @@ export function ListPane({ /> ) : null} - + {children} @@ -388,11 +398,10 @@ export const ListItem = forwardRef< { active?: boolean; onClick?: () => void; - onContextMenu?: (e: React.MouseEvent) => void; children: React.ReactNode; className?: string; } ->(function ListItem({ active, onClick, onContextMenu, children, className }, ref) { +>(function ListItem({ active, onClick, children, className }, ref) { return (
- {children} - {label} - - ); -} - const chipBtn = style({ display: "inline-flex", alignItems: "center", @@ -82,7 +68,7 @@ function RuntimeChip({ const tone = ok ? "ok" : warn ? "idle" : "error"; return ( - + - + ); } @@ -197,7 +183,7 @@ export function StatusDock() { minWidth: 0, })} > - + - + {latest ? ( - +
- + ) : ( - - + )}
diff --git a/app/src/components/charts/MetricChart.tsx b/app/src/components/charts/MetricChart.tsx index 2724e0a..6c649d8 100644 --- a/app/src/components/charts/MetricChart.tsx +++ b/app/src/components/charts/MetricChart.tsx @@ -1,4 +1,4 @@ -import { motion } from "framer-motion"; +import { motion, useReducedMotion } from "framer-motion"; import { useId, useMemo } from "react"; import { Text } from "@react-spectrum/s2"; import { style } from "@react-spectrum/s2/style" with { type: "macro" }; @@ -12,13 +12,11 @@ export function WaveBars({ }: { values: number[]; max?: number; - /** @deprecated Unused — kept for call-site compatibility. */ - className?: string; - /** @deprecated Unused — Spectrum tokens drive color. */ - color?: string; }) { + const reduceMotion = useReducedMotion(); const peak = Math.max(max ?? 0, ...values, 1); const pads = values.length ? values : Array.from({ length: 24 }, () => 0); + const duration = reduceMotion ? 0 : 0.35; return (
))}
@@ -59,8 +61,6 @@ export function AreaChart({ }: { values: number[]; max?: number; - /** @deprecated Unused — kept for call-site compatibility. */ - className?: string; stroke?: string; fill?: string; }) { @@ -126,9 +126,8 @@ export function RingGauge({ max?: number; label: string; sub?: string; - /** @deprecated Unused — kept for call-site compatibility. */ - className?: string; }) { + const reduceMotion = useReducedMotion(); const pct = Math.min(100, Math.max(0, (value / max) * 100)); const r = 34; const c = 2 * Math.PI * r; @@ -148,7 +147,7 @@ export function RingGauge({ strokeLinecap="round" strokeDasharray={c} animate={{ strokeDashoffset: offset }} - transition={{ duration: 0.45, ease }} + transition={{ duration: reduceMotion ? 0 : 0.45, ease }} />
@@ -186,8 +185,6 @@ export function MetricCard({ children?: React.ReactNode; /** Skip raised fill when nested inside another layer surface. */ flat?: boolean; - /** @deprecated Unused — kept for call-site compatibility. */ - className?: string; }) { return (
+ {children} {label} diff --git a/app/src/hooks/useEasedSeries.ts b/app/src/hooks/useEasedSeries.ts index 4acae08..784d1ba 100644 --- a/app/src/hooks/useEasedSeries.ts +++ b/app/src/hooks/useEasedSeries.ts @@ -1,3 +1,4 @@ +import { useReducedMotion } from "framer-motion"; import { useEffect, useMemo, useRef, useState } from "react"; /** Ease-out cubic — finishes before the next ~1s Docker sample. */ @@ -8,8 +9,10 @@ function easeOutCubic(t: number) { /** * Live series easing: committed history stays at true values (spikes stay visible); * only the newest tip lerps toward the latest sample. + * Snaps instantly when prefers-reduced-motion is set. */ export function useEasedSeries(target: number[], durationMs = 280): number[] { + const reduceMotion = useReducedMotion(); const [tip, setTip] = useState(() => target[target.length - 1] ?? 0); const tipRef = useRef(tip); const fromRef = useRef(tip); @@ -36,9 +39,6 @@ export function useEasedSeries(target: number[], durationMs = 280): number[] { return; } - fromRef.current = tipRef.current; - toRef.current = nextTip; - startRef.current = performance.now(); cancelAnimationFrame(rafRef.current); if (target.length === 0) { @@ -47,13 +47,17 @@ export function useEasedSeries(target: number[], durationMs = 280): number[] { return; } - // First point: snap. - if (prev.length === 0) { + // First point, or reduced motion: snap. + if (prev.length === 0 || reduceMotion) { tipRef.current = nextTip; setTip(nextTip); return; } + fromRef.current = tipRef.current; + toRef.current = nextTip; + startRef.current = performance.now(); + const tick = (now: number) => { const t = Math.min(1, (now - startRef.current) / durationMs); const e = easeOutCubic(t); @@ -65,7 +69,7 @@ export function useEasedSeries(target: number[], durationMs = 280): number[] { rafRef.current = requestAnimationFrame(tick); return () => cancelAnimationFrame(rafRef.current); - }, [target, durationMs]); + }, [target, durationMs, reduceMotion]); return useMemo(() => { if (target.length === 0) return []; @@ -77,6 +81,7 @@ export function useEasedSeries(target: number[], durationMs = 280): number[] { /** Same short ease for headline metric numbers (keep in sync with sparkline tip). */ export function useEasedNumber(target: number, durationMs = 280): number { + const reduceMotion = useReducedMotion(); const [display, setDisplay] = useState(target); const displayRef = useRef(target); const fromRef = useRef(target); @@ -85,10 +90,17 @@ export function useEasedNumber(target: number, durationMs = 280): number { const rafRef = useRef(0); useEffect(() => { + cancelAnimationFrame(rafRef.current); + + if (reduceMotion) { + displayRef.current = target; + setDisplay(target); + return; + } + fromRef.current = displayRef.current; toRef.current = target; startRef.current = performance.now(); - cancelAnimationFrame(rafRef.current); const tick = (now: number) => { const t = Math.min(1, (now - startRef.current) / durationMs); @@ -101,7 +113,7 @@ export function useEasedNumber(target: number, durationMs = 280): number { rafRef.current = requestAnimationFrame(tick); return () => cancelAnimationFrame(rafRef.current); - }, [target, durationMs]); + }, [target, durationMs, reduceMotion]); return display; } diff --git a/app/src/index.css b/app/src/index.css index 32bdf5c..78168ca 100644 --- a/app/src/index.css +++ b/app/src/index.css @@ -240,10 +240,10 @@ button.dh-metric-tile:focus-visible { background: transparent; } -/* Keep Spectrum icons square inside circular sidebar hits */ +/* Keep Lucide rail icons square inside circular sidebar hits (lucideProps M = 18) */ aside nav button svg { - width: 20px !important; - height: 20px !important; + width: 18px !important; + height: 18px !important; flex-shrink: 0; } diff --git a/app/src/routes/ContainersPage.tsx b/app/src/routes/ContainersPage.tsx index 9603b31..751e722 100644 --- a/app/src/routes/ContainersPage.tsx +++ b/app/src/routes/ContainersPage.tsx @@ -241,7 +241,7 @@ export function ContainersPage() { ) } > - Stop ({selectedIds.length}) + {`Stop (${selectedIds.length})`} diff --git a/app/src/routes/DashboardPage.tsx b/app/src/routes/DashboardPage.tsx index 05c9bbc..a8083ea 100644 --- a/app/src/routes/DashboardPage.tsx +++ b/app/src/routes/DashboardPage.tsx @@ -32,7 +32,6 @@ export function DashboardPage() { const status = useQuery({ queryKey: ["status"], queryFn: api.status }); const info = useQuery({ queryKey: ["docker-info"], queryFn: api.dockerInfo, retry: false }); const contexts = useQuery({ queryKey: ["docker-contexts"], queryFn: api.dockerContexts, retry: false }); - const gpus = useQuery({ queryKey: ["gpus"], queryFn: api.gpus, refetchInterval: 8000 }); const pushRunning = useMetricsStore((s) => s.pushRunning); const clearRunning = useMetricsStore((s) => s.clearRunning); const runningHistory = useMetricsStore((s) => s.runningHistory); @@ -161,16 +160,9 @@ export function DashboardPage() { })} >
-
-
- GPUs - -
- {gpus.data?.devices?.length ? ( - - {gpus.data.devices.length} detected - - ) : null} +
+ GPUs +