From a7070d71c4c38fb703d2a617dd0fdf5f79858859 Mon Sep 17 00:00:00 2001 From: thepoy Date: Tue, 20 Oct 2026 14:19:34 +0800 Subject: [PATCH] fix(stage): reveal the sun readout on hover, not permanently The strip sat at the top right of the track and overlapped the sun marker whenever the sun was in the western sky. It now appears while the marker is hovered, with the numbers also in the marker's title so keyboard and screen-reader users lose nothing. The marker gains a 20px hit area around its 10px dot, since pointing at the dot was the only way to reach the readout. --- src/stage/SunPathPanel.tsx | 45 +++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/src/stage/SunPathPanel.tsx b/src/stage/SunPathPanel.tsx index 3c93c444..8c68d52e 100644 --- a/src/stage/SunPathPanel.tsx +++ b/src/stage/SunPathPanel.tsx @@ -41,6 +41,7 @@ interface Props { export function SunPathPanel(props: Props) { const [hover, setHover] = createSignal(null); + const [hoverSun, setHoverSun] = createSignal(false); /** A track without a selector reports the frames; it does not choose them. */ const interactive = () => props.onSelect !== undefined; @@ -210,15 +211,25 @@ export function SunPathPanel(props: Props) { }} + {/* The sun: a 20px hit area around a 10px dot, because the dot alone is a hard thing + to point at — and pointing at it is what reveals the readout below. */}
+ class="absolute flex size-5 -translate-x-1/2 -translate-y-1/2 items-center justify-center" + onMouseEnter={() => setHoverSun(true)} + onMouseLeave={() => setHoverSun(false)} + title={`${t("stage.altitude")} ${formatAngle(props.current.altitude)}° · ${t("stage.azimuth")} ${formatAngle(props.current.azimuth)}°`} + > +
+
{/* Horizon label: sits in the empty middle band (the track hangs high here, no path crosses it) */} ))} - - - {props.current.altitude < 0 ? "☾" : "☀"} + {/* Hovering the sun reveals the readout, so it is not a permanent label sitting on + top of the marker it describes. */} + + + + {props.current.altitude < 0 ? "☾" : "☀"} + + + {props.current.altitude.toFixed(1)}° ·{" "} + {props.current.azimuth.toFixed(1)}° + - - {props.current.altitude.toFixed(1)}° ·{" "} - {props.current.azimuth.toFixed(1)}° - - +
);