From e4670959cca60a94bc0ebf54a503f3b4d38d535d Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Tue, 15 Sep 2026 20:50:45 +0900 Subject: [PATCH 1/2] test(reports): pin comparison graphic axis badge wiring --- ...grouping_comparison_graphic_axis_badge_contract.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_grouping_comparison_graphic_axis_badge_contract.py b/tests/test_grouping_comparison_graphic_axis_badge_contract.py index f1bdcefed..9801e7b03 100644 --- a/tests/test_grouping_comparison_graphic_axis_badge_contract.py +++ b/tests/test_grouping_comparison_graphic_axis_badge_contract.py @@ -5,6 +5,7 @@ ROOT = Path(__file__).resolve().parents[1] SINGULAR_SOURCE = ROOT / "frontend" / "src" / "leftoverMapPlotAxisSingular.ts" +PLOT_SOURCE = ROOT / "frontend" / "src" / "components" / "LeftoverMapPlot.tsx" def test_comparison_graphic_axis_badge_preserves_singular_when_share_is_missing() -> None: @@ -31,3 +32,13 @@ def test_comparison_graphic_axis_badge_keeps_sigma_and_share_independent() -> No assert "Number.isFinite" in source assert "Math.sqrt" not in source assert "Math.max" not in source + + +def test_comparison_graphic_renders_graphic_specific_axis_badges() -> None: + """Comparison plot badges must use graphic naming, not comparison-strip naming.""" + assert PLOT_SOURCE.exists(), "comparison plot component is missing" + source = PLOT_SOURCE.read_text(encoding="utf-8") + + assert "leftoverMapComparePlotAxisBadge" in source + assert ".map((axis) => leftoverMapComparePlotAxisBadge(axis))" in source + assert ".map((axis) => leftoverMapCompareAxisBadge(axis))" not in source From 9e9e38dab1120585d41cb4f2ee81778689b0256a Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Tue, 15 Sep 2026 20:51:49 +0900 Subject: [PATCH 2/2] fix(reports): render comparison graphic axis badges with graphic copy --- frontend/src/components/LeftoverMapPlot.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/LeftoverMapPlot.tsx b/frontend/src/components/LeftoverMapPlot.tsx index 435d92fe8..83451e678 100644 --- a/frontend/src/components/LeftoverMapPlot.tsx +++ b/frontend/src/components/LeftoverMapPlot.tsx @@ -29,7 +29,7 @@ import { } from "../leftoverMapPlotAxisShare"; import { formatLeftoverMapPlotAxisSingular, - leftoverMapCompareAxisBadge, + leftoverMapComparePlotAxisBadge, leftoverSingularForAxis, LEFTOVER_MAP_COMPARE_PLOT_AXIS_SINGULAR, LEFTOVER_MAP_COMPARE_PLOT_AXIS_SINGULAR_SHARE, @@ -77,10 +77,12 @@ export type LeftoverMapPlotProps = { variant?: LeftoverMapPlotVariant; }; +/** Return the four vertices for a diamond marker centered at the persisted plot point. */ function diamondPoints(x: number, y: number, radius: number): string { return `${x},${y - radius} ${x + radius},${y} ${x},${y + radius} ${x - radius},${y}`; } +/** Compose one axis caption from persisted share and singular evidence for the requested surface. */ function leftoverMapPlotAxisText( axisIndex: 1 | 2, leftoverMapAxes: LeftoverMapAxis[] | undefined, @@ -234,7 +236,7 @@ export function LeftoverMapPlot({ const comparisonAxisBadges = variant === "comparison" ? (leftoverMapAxes ?? []) - .map((axis) => leftoverMapCompareAxisBadge(axis)) + .map((axis) => leftoverMapComparePlotAxisBadge(axis)) .filter((badge): badge is NonNullable => badge !== null) : [];