Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
86b8eaa
feat(reports): leftover-map origin on leftover-map comparison graphic…
seonghobae Aug 31, 2026
f13a689
test(red): reconstruct comparison graphic origin-tick contract
seonghobae Sep 11, 2026
ff7d467
chore(stack): converge #877 onto repaired #875 head
seonghobae Sep 12, 2026
1955b70
chore(stack): converge #877 onto repaired #875
seonghobae Sep 12, 2026
677643a
chore(stack): converge #877 onto repaired ancestry
seonghobae Sep 13, 2026
cbb2802
chore(stack): converge repaired #875 into #877
seonghobae Sep 15, 2026
1e59c11
fix(reports): model comparison origin tick identity
seonghobae Sep 15, 2026
70b81b3
fix(reports): render comparison origin tick identity
seonghobae Sep 15, 2026
73f8bf8
chore(stack): converge #875 into #877 without force
seonghobae Sep 15, 2026
2d859c9
merge: converge comparison-origin lane onto repaired v2.91.0 parent
seonghobae Sep 15, 2026
73aa923
fix(stack): adopt comparison graphic badge repair in #877
seonghobae Sep 15, 2026
2f89543
test(stack): carry comparison graphic badge wiring contract into #877
seonghobae Sep 15, 2026
a0a2b6f
chore(stack): converge #877 onto repaired #875
seonghobae Sep 15, 2026
ba9101f
chore(stack): converge #877 onto current #875
seonghobae Sep 15, 2026
cd645e4
merge(reports): converge report-axis missingness repair into origin lane
seonghobae Sep 15, 2026
caca41e
merge(reports): converge #877 onto #875 RED contract head
seonghobae Sep 15, 2026
23c0988
chore(stack): converge current #875 into #877
seonghobae Sep 15, 2026
8503b0f
test(reports): align comparison tick contract with evidence projection
seonghobae Sep 15, 2026
a61db0a
chore(stack): converge current #875 into #877 after tick-contract repair
seonghobae Sep 15, 2026
ef77654
test(i18n): require comparison tick accessibility translations
seonghobae Sep 15, 2026
6e89fed
chore(stack): converge semantic RED harness onto #877
seonghobae Sep 16, 2026
ddaa592
chore(stack): converge #875 product repair into #877
seonghobae Sep 16, 2026
e428976
chore(stack): converge #877 on repaired report tick foundation
seonghobae Sep 16, 2026
8b157b4
chore(stack): converge #877 on repaired comparison tick foundation
seonghobae Sep 16, 2026
7ab3973
chore(stack): converge #877 on repaired comparison-strip tick foundation
seonghobae Sep 16, 2026
3f3a673
chore(stack): converge #877 on repaired report-axis tick foundation
seonghobae Sep 16, 2026
f96eb03
chore(stack): converge #877 on repaired comparison tick share foundation
seonghobae Sep 16, 2026
ee44c80
chore(stack): adopt repaired tick-share foundation without losing ori…
seonghobae Sep 16, 2026
686996d
chore(stack): adopt repaired report axis tick share foundation
seonghobae Sep 16, 2026
2b3363d
chore(stack): converge #877 on repaired report tick-share foundation
seonghobae Sep 16, 2026
d08dafb
fix(i18n): translate comparison tick accessibility copy
github-actions[bot] Sep 16, 2026
19856fa
chore(stack): converge #877 on repaired #875 contracts
seonghobae Sep 16, 2026
edcf5ba
Merge parent #875 convergence into #877
seonghobae Sep 17, 2026
b5d053b
merge: converge comparison origin ticks onto report-axis evidence
seonghobae Sep 18, 2026
950c5de
test(reports): execute comparison origin tick projection
seonghobae Sep 18, 2026
0f1adc5
merge: converge report-axis tick contract repair into origin-badge lane
seonghobae Sep 19, 2026
a7d57b9
chore(stack): converge v2.84 contract repair while preserving origin …
seonghobae Sep 19, 2026
34b5682
merge: converge #877 on report contract repairs
seonghobae Sep 19, 2026
f0a99af
chore(stack): converge #877 onto #875 owner stack
seonghobae Sep 20, 2026
f294cc4
chore(reports): converge #877 onto repaired #875 ancestry
seonghobae Sep 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions frontend/src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,14 @@ const TRANSLATIONS: Partial<Record<Locale, Record<string, string>>> = {
"leftover-map axis 2": "잔여 지도 축 2",
"leftover-map axis {axis} ({share}%)": "잔여 지도 축 {axis} ({share}%)",
"leftover-map axis {axis} tick {value}": "잔여 지도 축 {axis} 눈금 {value}",
"leftover map comparison graphic leftover-map axis {axis} tick {value}": "잔여 지도 비교 그래픽 잔여 지도 축 {axis} 눈금 {value}",
"leftover map comparison graphic leftover-map axis {axis} tick {value} {share}%": "잔여 지도 비교 그래픽 잔여 지도 축 {axis} 눈금 {value} {share}%",
"leftover map comparison graphic leftover-map axis {axis} tick {value} σ {singular}": "잔여 지도 비교 그래픽 잔여 지도 축 {axis} 눈금 {value} σ {singular}",
"leftover map comparison graphic leftover-map axis {axis} tick {value} σ {singular} {share}%": "잔여 지도 비교 그래픽 잔여 지도 축 {axis} 눈금 {value} σ {singular} {share}%",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value}": "잔여 지도 비교 그래픽 잔여 지도 축 {axis} 원점 눈금 {value}",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} {share}%": "잔여 지도 비교 그래픽 잔여 지도 축 {axis} 원점 눈금 {value} {share}%",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} σ {singular}": "잔여 지도 비교 그래픽 잔여 지도 축 {axis} 원점 눈금 {value} σ {singular}",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} σ {singular} {share}%": "잔여 지도 비교 그래픽 잔여 지도 축 {axis} 원점 눈금 {value} σ {singular} {share}%",
"leftover-map distance {label}": "잔여 지도 거리 {label}",
"leftover-map reconstruction {label}": "잔여 지도 재구성 {label}",
"leftover-map explained leftover share {label}": "잔여 지도 설명 잔여 점유율 {label}",
Expand Down Expand Up @@ -1270,6 +1278,14 @@ const TRANSLATIONS: Partial<Record<Locale, Record<string, string>>> = {
"leftover-map axis 2": "残差图轴 2",
"leftover-map axis {axis} ({share}%)": "残差图轴 {axis} ({share}%)",
"leftover-map axis {axis} tick {value}": "残差图轴 {axis} 刻度 {value}",
"leftover map comparison graphic leftover-map axis {axis} tick {value}": "残差图比较图形 残差图轴 {axis} 刻度 {value}",
"leftover map comparison graphic leftover-map axis {axis} tick {value} {share}%": "残差图比较图形 残差图轴 {axis} 刻度 {value} {share}%",
"leftover map comparison graphic leftover-map axis {axis} tick {value} σ {singular}": "残差图比较图形 残差图轴 {axis} 刻度 {value} σ {singular}",
"leftover map comparison graphic leftover-map axis {axis} tick {value} σ {singular} {share}%": "残差图比较图形 残差图轴 {axis} 刻度 {value} σ {singular} {share}%",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value}": "残差图比较图形 残差图轴 {axis} 原点刻度 {value}",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} {share}%": "残差图比较图形 残差图轴 {axis} 原点刻度 {value} {share}%",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} σ {singular}": "残差图比较图形 残差图轴 {axis} 原点刻度 {value} σ {singular}",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} σ {singular} {share}%": "残差图比较图形 残差图轴 {axis} 原点刻度 {value} σ {singular} {share}%",
"leftover-map distance {label}": "残差图距离 {label}",
"leftover-map reconstruction {label}": "残差图重建 {label}",
"leftover-map explained leftover share {label}": "残差图已解释残差份额 {label}",
Expand Down Expand Up @@ -1910,6 +1926,14 @@ const TRANSLATIONS: Partial<Record<Locale, Record<string, string>>> = {
"leftover-map axis 2": "残差マップ軸 2",
"leftover-map axis {axis} ({share}%)": "残差マップ軸 {axis} ({share}%)",
"leftover-map axis {axis} tick {value}": "残差マップ軸 {axis} 目盛 {value}",
"leftover map comparison graphic leftover-map axis {axis} tick {value}": "残差マップ比較グラフィック 残差マップ軸 {axis} 目盛 {value}",
"leftover map comparison graphic leftover-map axis {axis} tick {value} {share}%": "残差マップ比較グラフィック 残差マップ軸 {axis} 目盛 {value} {share}%",
"leftover map comparison graphic leftover-map axis {axis} tick {value} σ {singular}": "残差マップ比較グラフィック 残差マップ軸 {axis} 目盛 {value} σ {singular}",
"leftover map comparison graphic leftover-map axis {axis} tick {value} σ {singular} {share}%": "残差マップ比較グラフィック 残差マップ軸 {axis} 目盛 {value} σ {singular} {share}%",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value}": "残差マップ比較グラフィック 残差マップ軸 {axis} 原点目盛 {value}",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} {share}%": "残差マップ比較グラフィック 残差マップ軸 {axis} 原点目盛 {value} {share}%",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} σ {singular}": "残差マップ比較グラフィック 残差マップ軸 {axis} 原点目盛 {value} σ {singular}",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} σ {singular} {share}%": "残差マップ比較グラフィック 残差マップ軸 {axis} 原点目盛 {value} σ {singular} {share}%",
"leftover-map distance {label}": "残差マップ距離 {label}",
"leftover-map reconstruction {label}": "残差マップ再構成 {label}",
"leftover-map explained leftover share {label}": "残差マップ説明済み残差割合 {label}",
Expand Down Expand Up @@ -2550,6 +2574,14 @@ const TRANSLATIONS: Partial<Record<Locale, Record<string, string>>> = {
"leftover-map axis 2": "trục bản đồ phần dư 2",
"leftover-map axis {axis} ({share}%)": "trục bản đồ phần dư {axis} ({share}%)",
"leftover-map axis {axis} tick {value}": "vạch trục bản đồ phần dư {axis} {value}",
"leftover map comparison graphic leftover-map axis {axis} tick {value}": "đồ họa so sánh bản đồ phần dư, trục {axis}, vạch {value}",
"leftover map comparison graphic leftover-map axis {axis} tick {value} {share}%": "đồ họa so sánh bản đồ phần dư, trục {axis}, vạch {value}, {share}%",
"leftover map comparison graphic leftover-map axis {axis} tick {value} σ {singular}": "đồ họa so sánh bản đồ phần dư, trục {axis}, vạch {value}, σ {singular}",
"leftover map comparison graphic leftover-map axis {axis} tick {value} σ {singular} {share}%": "đồ họa so sánh bản đồ phần dư, trục {axis}, vạch {value}, σ {singular}, {share}%",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value}": "đồ họa so sánh bản đồ phần dư, trục {axis}, vạch gốc {value}",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} {share}%": "đồ họa so sánh bản đồ phần dư, trục {axis}, vạch gốc {value}, {share}%",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} σ {singular}": "đồ họa so sánh bản đồ phần dư, trục {axis}, vạch gốc {value}, σ {singular}",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} σ {singular} {share}%": "đồ họa so sánh bản đồ phần dư, trục {axis}, vạch gốc {value}, σ {singular}, {share}%",
"leftover-map distance {label}": "khoảng cách bản đồ phần dư {label}",
"leftover-map reconstruction {label}": "tái dựng bản đồ phần dư {label}",
"leftover-map explained leftover share {label}": "tỷ phần phần dư được giải thích trên bản đồ phần dư {label}",
Expand Down
48 changes: 48 additions & 0 deletions frontend/src/leftoverMapPlotAxisSingular.origin.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { describe, expect, it } from "vitest";
import {
LEFTOVER_MAP_COMPARE_PLOT_ORIGIN_TICK,
LEFTOVER_MAP_COMPARE_PLOT_ORIGIN_TICK_SHARE,
LEFTOVER_MAP_COMPARE_PLOT_ORIGIN_TICK_SINGULAR,
LEFTOVER_MAP_COMPARE_PLOT_ORIGIN_TICK_SINGULAR_SHARE,
LEFTOVER_MAP_COMPARE_PLOT_TICK,
leftoverMapComparePlotTickAxisBadge,
leftoverMapPlotTickIsOrigin,
} from "./leftoverMapPlotAxisSingular";

describe("comparison-graphic origin tick projection", () => {
it("recognizes only the canonical formatted zero coordinate as origin", () => {
expect(leftoverMapPlotTickIsOrigin("0.00")).toBe(true);
expect(leftoverMapPlotTickIsOrigin("+0.00")).toBe(false);
expect(leftoverMapPlotTickIsOrigin("−0.00")).toBe(false);
expect(leftoverMapPlotTickIsOrigin("0")).toBe(false);
});

it("keeps origin identity independent from persisted share and singular evidence", () => {
expect(leftoverMapComparePlotTickAxisBadge(1, "0.00", null, null).template).toBe(
LEFTOVER_MAP_COMPARE_PLOT_ORIGIN_TICK,
);
expect(leftoverMapComparePlotTickAxisBadge(1, "0.00", null, 0.25).template).toBe(
LEFTOVER_MAP_COMPARE_PLOT_ORIGIN_TICK_SHARE,
);
expect(leftoverMapComparePlotTickAxisBadge(1, "0.00", 1.5, null).template).toBe(
LEFTOVER_MAP_COMPARE_PLOT_ORIGIN_TICK_SINGULAR,
);
expect(leftoverMapComparePlotTickAxisBadge(1, "0.00", 1.5, 0.25).template).toBe(
LEFTOVER_MAP_COMPARE_PLOT_ORIGIN_TICK_SINGULAR_SHARE,
);
});

it("fails invalid evidence closed without turning a non-origin tick into origin", () => {
const badge = leftoverMapComparePlotTickAxisBadge(
2,
"+0.50",
Number.NaN,
Number.POSITIVE_INFINITY,
);

expect(badge).toEqual({
template: LEFTOVER_MAP_COMPARE_PLOT_TICK,
values: { axis: 2, value: "+0.50" },
});
});
});
98 changes: 66 additions & 32 deletions frontend/src/leftoverMapPlotAxisSingular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
formatLeftoverMapPlotAxisShare,
LEFTOVER_MAP_COMPARE_PLOT_AXIS_SHARE,
} from "./leftoverMapPlotAxisShare";
import { formatSignedLeftoverValue } from "./leftoverMapUnexplained";

export const LEFTOVER_MAP_PLOT_AXIS_SINGULAR =
"leftover-map axis {axis} σ {value}";
Expand Down Expand Up @@ -36,15 +37,30 @@ export const LEFTOVER_MAP_PLOT_TICK_SHARE =
export const LEFTOVER_MAP_PLOT_TICK_SINGULAR_SHARE =
"leftover-map axis {axis} tick {value} σ {singular} {share}%";

export const LEFTOVER_MAP_COMPARE_PLOT_TICK_SINGULAR =
"leftover map comparison graphic leftover-map axis {axis} tick {value} σ {singular}";
export const LEFTOVER_MAP_COMPARE_PLOT_TICK =
"leftover map comparison graphic leftover-map axis {axis} tick {value}";

export const LEFTOVER_MAP_COMPARE_PLOT_TICK_SHARE =
"leftover map comparison graphic leftover-map axis {axis} tick {value} {share}%";

export const LEFTOVER_MAP_COMPARE_PLOT_TICK_SINGULAR =
"leftover map comparison graphic leftover-map axis {axis} tick {value} σ {singular}";

export const LEFTOVER_MAP_COMPARE_PLOT_TICK_SINGULAR_SHARE =
"leftover map comparison graphic leftover-map axis {axis} tick {value} σ {singular} {share}%";

export const LEFTOVER_MAP_COMPARE_PLOT_ORIGIN_TICK =
"leftover map comparison graphic leftover-map axis {axis} origin tick {value}";

export const LEFTOVER_MAP_COMPARE_PLOT_ORIGIN_TICK_SHARE =
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} {share}%";

export const LEFTOVER_MAP_COMPARE_PLOT_ORIGIN_TICK_SINGULAR =
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} σ {singular}";

export const LEFTOVER_MAP_COMPARE_PLOT_ORIGIN_TICK_SINGULAR_SHARE =
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} σ {singular} {share}%";
Comment thread
coderabbitai[bot] marked this conversation as resolved.

export const LEFTOVER_MAP_COMPARE_AXIS_TICK_SINGULAR =
"leftover map comparison leftover axis {axis} tick {value} σ {singular}";

Expand Down Expand Up @@ -124,6 +140,54 @@ export function leftoverMapComparePlotAxisBadge(
};
}

/** Exact origin identity follows the canonical persisted-coordinate formatter only. */
export function leftoverMapPlotTickIsOrigin(tickLabel: string): boolean {
const originLabel = formatSignedLeftoverValue(0);
return originLabel !== null && tickLabel === originLabel;
}

/**
* Project one comparison-graphic tick without deriving origin, share, or σ from
* each other. Each persisted evidence field can therefore fail closed on its own.
*/
export function leftoverMapComparePlotTickAxisBadge(
axisIndex: number,
tickLabel: string,
leftoverSingular: number | null | undefined,
leftoverShare?: number | null,
): LeftoverMapCompareAxisBadge {
const singular = formatLeftoverMapPlotAxisSingular(leftoverSingular);
const percent = formatLeftoverMapPlotAxisShare(leftoverShare);
const origin = leftoverMapPlotTickIsOrigin(tickLabel);

if (singular === null && percent === null) {
return {
template: origin ? LEFTOVER_MAP_COMPARE_PLOT_ORIGIN_TICK : LEFTOVER_MAP_COMPARE_PLOT_TICK,
values: { axis: axisIndex, value: tickLabel },
};
}
if (singular === null) {
return {
template: origin ? LEFTOVER_MAP_COMPARE_PLOT_ORIGIN_TICK_SHARE : LEFTOVER_MAP_COMPARE_PLOT_TICK_SHARE,
values: { axis: axisIndex, value: tickLabel, share: percent as string },
};
}
if (percent === null) {
return {
template: origin
? LEFTOVER_MAP_COMPARE_PLOT_ORIGIN_TICK_SINGULAR
: LEFTOVER_MAP_COMPARE_PLOT_TICK_SINGULAR,
values: { axis: axisIndex, value: tickLabel, singular },
};
}
return {
template: origin
? LEFTOVER_MAP_COMPARE_PLOT_ORIGIN_TICK_SINGULAR_SHARE
: LEFTOVER_MAP_COMPARE_PLOT_TICK_SINGULAR_SHARE,
values: { axis: axisIndex, value: tickLabel, singular, share: percent },
};
}

/**
* Compose comparison-strip axis evidence without deriving one persisted
* measurement from the other. Missing or invalid evidence is omitted
Expand Down Expand Up @@ -189,36 +253,6 @@ export function leftoverMapPlotTickAxisBadge(
};
}

/** Compose persisted comparison-graphic tick σ/share without deriving either field. */
export function leftoverMapComparePlotTickAxisBadge(
axisIndex: number,
tickLabel: string,
leftoverSingular: number | null | undefined,
leftoverShare?: LeftoverMapAxis["leftover_share"] | null,
): LeftoverMapCompareAxisBadge | null {
const singular = formatLeftoverMapPlotAxisSingular(leftoverSingular);
const share = formatLeftoverMapPlotAxisShare(leftoverShare);
if (singular === null && share === null) {
return null;
}
if (singular === null) {
return {
template: LEFTOVER_MAP_COMPARE_PLOT_TICK_SHARE,
values: { axis: axisIndex, value: tickLabel, share: share as string },
};
}
if (share === null) {
return {
template: LEFTOVER_MAP_COMPARE_PLOT_TICK_SINGULAR,
values: { axis: axisIndex, value: tickLabel, singular },
};
}
return {
template: LEFTOVER_MAP_COMPARE_PLOT_TICK_SINGULAR_SHARE,
values: { axis: axisIndex, value: tickLabel, singular, share },
};
}

/** Compose persisted comparison-strip tick σ/share without deriving either field. */
export function leftoverMapCompareAxisTickBadge(
axisIndex: number,
Expand Down
41 changes: 41 additions & 0 deletions tests/test_grouping_comparison_graphic_origin_tick_contract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""Executable contract for comparison-graphic origin tick captions."""

from pathlib import Path
import re


ROOT = Path(__file__).resolve().parents[1]
SINGULAR_SOURCE = ROOT / "frontend" / "src" / "leftoverMapPlotAxisSingular.ts"


def test_comparison_graphic_origin_tick_has_distinct_four_state_copy() -> None:
"""Origin ticks stay distinct across empty, share-only, singular-only, and combined evidence."""
source = SINGULAR_SOURCE.read_text(encoding="utf-8")

for text in (
"leftover map comparison graphic leftover-map axis {axis} origin tick {value}",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} {share}%",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} σ {singular}",
"leftover map comparison graphic leftover-map axis {axis} origin tick {value} σ {singular} {share}%",
):
assert text in source
assert "leftoverMapPlotTickIsOrigin" in source
assert "leftoverMapComparePlotTickAxisBadge" in source


def test_origin_is_exact_formatted_zero_not_derived_from_share_or_singular() -> None:
"""Origin identity follows the canonical formatted zero tick and does not use evidence magnitude."""
source = SINGULAR_SOURCE.read_text(encoding="utf-8")
helper = re.search(
r"export function leftoverMapPlotTickIsOrigin\(.*?\n}\n",
source,
re.DOTALL,
)
assert helper is not None
helper_source = helper.group(0)

assert "formatSignedLeftoverValue(0)" in helper_source
assert "tickLabel === originLabel" in helper_source
assert "leftover_share" not in helper_source
assert "singular" not in helper_source.lower()
assert "Math.abs" not in helper_source
30 changes: 13 additions & 17 deletions tests/test_grouping_comparison_graphic_tick_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,25 @@
ROOT = Path(__file__).resolve().parents[1]
PLOT_SOURCE = ROOT / "frontend" / "src" / "components" / "LeftoverMapPlot.tsx"
LAYOUT_SOURCE = ROOT / "frontend" / "src" / "leftoverMapPlotLayout.ts"
SINGULAR_SOURCE = ROOT / "frontend" / "src" / "leftoverMapPlotAxisSingular.ts"


def test_comparison_graphic_names_ticks_with_distinct_accessible_copy() -> None:
"""Comparison ticks keep localized comparison copy while report ticks may add persisted σ evidence."""
def test_comparison_graphic_names_ticks_through_evidence_aware_badge_contract() -> None:
"""Comparison ticks consume persisted σ/share evidence and preserve distinct origin copy."""
plot_source = PLOT_SOURCE.read_text(encoding="utf-8")
singular_source = SINGULAR_SOURCE.read_text(encoding="utf-8")

# v2.84 adds a report-only evidence badge. Comparison ticks must keep the
# existing localized comparison + generic tick composition rather than
# inheriting report evidence or introducing a comparison-only translation.
assert "leftoverMapPlotTickAxisBadge" in plot_source
assert "leftoverMapComparePlotTickAxisBadge" in plot_source
assert "leftoverSingularForAxis(leftoverMapAxes, tick.axis)" in plot_source
assert re.search(
r'reportTickBadge\s*=\s*variant\s*===\s*"report"\s*\?\s*leftoverMapPlotTickAxisBadge\(',
plot_source,
re.DOTALL,
)
assert re.search(
r'variant\s*===\s*"comparison"\s*\?\s*`\$\{t\(LEFTOVER_MAP_COMPARE_PLOT_LABEL\)\}:\s*\$\{tf\(LEFTOVER_MAP_PLOT_TICK,\s*\{\s*axis:\s*tick\.axis,\s*value:\s*tick\.label,?\s*\}\)\}`',
plot_source,
re.DOTALL,
assert "leftoverShareForAxis(leftoverMapAxes, tick.axis)" in plot_source
assert "tf(comparisonTickBadge.template, comparisonTickBadge.values)" in plot_source
assert (
'export const LEFTOVER_MAP_COMPARE_PLOT_TICK =\n'
' "leftover map comparison graphic leftover-map axis {axis} tick {value}";'
in singular_source
)
assert "tf(reportTickBadge.template, reportTickBadge.values)" in plot_source
assert "LEFTOVER_MAP_COMPARE_PLOT_TICK" not in plot_source
assert "LEFTOVER_MAP_COMPARE_PLOT_ORIGIN_TICK" in singular_source
assert "LEFTOVER_MAP_COMPARE_PLOT_TICK_SINGULAR_SHARE" in singular_source


def test_tick_positions_come_from_persisted_coordinates_not_distance() -> None:
Expand Down
Loading
Loading