From 4eefc3739f9abb0fedb6a639a866b8995643c2ee Mon Sep 17 00:00:00 2001 From: Florent Tapponnier Date: Sat, 23 May 2026 16:27:56 +0200 Subject: [PATCH] fix: float view switcher in card top-right corner instead of footer row User feedback: the bottom footer row I added for the view switcher created a visible gap because the row reserved its own band and the single button sat alone at the right edge with the rest of the row empty. Switch to absolute positioning in the card's top-right corner: the button sits inside the existing card padding, the chart fills the card top-to-bottom, no extra row reserved, no white gap. z-10 so the popover stays above the chart geometry. Default downward popover direction is fine again (room below the corner). --- src/components/benchmark-body.tsx | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/components/benchmark-body.tsx b/src/components/benchmark-body.tsx index 326d3573..7104bd79 100644 --- a/src/components/benchmark-body.tsx +++ b/src/components/benchmark-body.tsx @@ -291,7 +291,20 @@ export function BenchmarkBody({ {!isDraft && ( <> -
+
+ {/* View switcher floats in the card's top-right corner so it + doesn't reserve a vertical band of its own. The chart fills + the card top-to-bottom; the switcher sits in the existing + card padding and never competes with the chart for space. + Popover opens downward (default) since there's room below + the corner before the chart geometry begins. */} +
+ +
{/* Fade-in until the localStorage view preference resolves. Without this the SSR-default view paints first, then useViewPreference swaps to the saved view in a visible @@ -332,20 +345,6 @@ export function BenchmarkBody({ /> )}
- {/* Footer row hosts the view switcher. Sat at the top before - this revision and ate ~40 px of header to a button most - readers never used; bottom placement keeps the chart - pinned to the top of the card and lets the control hide - in the visual margin. Popover opens upward so it doesn't - spill into the product ledger below. */} -
- -