Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d4cfe91
test(i18n): pin comparison rank translations
seonghobae Sep 11, 2026
a4a83e8
test(i18n): reproduce comparison rank locale fallback
seonghobae Sep 11, 2026
2689a80
test(i18n): keep localization contract transport-neutral
seonghobae Sep 11, 2026
b6ae8f7
fix(ui): localize comparison rank accessibility label
seonghobae Sep 11, 2026
2a52d89
refactor(ui): reuse localized rank vocabulary
seonghobae Sep 11, 2026
beb23e9
test(ui): verify composed localized rank accessibility
seonghobae Sep 11, 2026
d207b04
test(ui): pin comparison rank localization wiring
seonghobae Sep 11, 2026
42c7e99
chore(stack): converge #859 onto repaired #858 head
seonghobae Sep 11, 2026
6fbe29b
chore(stack): converge #860 onto repaired #859 head
seonghobae Sep 11, 2026
720b407
chore(stack): converge #861 onto repaired #860 head
seonghobae Sep 11, 2026
0ce9685
chore(stack): converge #862 onto repaired #861 head
seonghobae Sep 11, 2026
b55fddd
chore(stack): converge #863 onto repaired #862 head
seonghobae Sep 11, 2026
4b9f9e9
chore(stack): converge #865 onto repaired #863 head
seonghobae Sep 11, 2026
39dd775
chore(stack): converge #866 onto repaired #865 head
seonghobae Sep 11, 2026
c888b28
chore(stack): converge #867 onto repaired #866 head
seonghobae Sep 12, 2026
94a42d9
chore(stack): converge #868 onto repaired #867 head
seonghobae Sep 12, 2026
f79c609
chore(stack): converge #869 onto repaired #868 head
seonghobae Sep 12, 2026
6822c82
chore(stack): converge #870 onto repaired #869 head
seonghobae Sep 12, 2026
2c509c0
chore(stack): converge #871 onto repaired #870 head
seonghobae Sep 12, 2026
2ae26c9
chore(stack): converge #872 onto repaired #871 head
seonghobae Sep 12, 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
16 changes: 8 additions & 8 deletions frontend/src/components/LeftoverMapPlot.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { LeftoverMapAxis, LeftoverMapCoverage, LeftoverPair } from "../api";
import { t, tf } from "../i18n";
import { formatLeftoverMapCoordinatePair } from "../leftoverMapCoordinates";
import { LEFTOVER_MAP_COMPARE_PLOT_SEGMENT_RANK } from "../leftoverMapRank";
import {
leftoverMapCoverageCounts,
leftoverMapIncompleteItemCount,
Expand Down Expand Up @@ -171,8 +170,8 @@ function leftoverMapPlotAxisText(
* comparison graphic from already-named leftover expected
* with distinct leftover map comparison graphic leftover expected
* labels. ADR 0318 captions leftover-map rank on that comparison graphic
* from already-named leftover-map rank with a distinct comparison graphic
* accessible name.
* from already-named leftover-map rank while composing existing localized
* comparison-graphic and rank labels rather than adding SPA translation debt.
* Never invent a leftover score.
*/
export function LeftoverMapPlot({
Expand Down Expand Up @@ -469,12 +468,13 @@ export function LeftoverMapPlot({
x={segment.rankX}
y={segment.rankY}
textAnchor="middle"
aria-label={tf(
aria-label={
variant === "comparison"
? LEFTOVER_MAP_COMPARE_PLOT_SEGMENT_RANK
: LEFTOVER_MAP_PLOT_SEGMENT_RANK,
{ label: segment.rankLabel },
)}
? `${t(LEFTOVER_MAP_COMPARE_PLOT_LABEL)}: ${tf(LEFTOVER_MAP_PLOT_SEGMENT_RANK, {
label: segment.rankLabel,
})}`
: tf(LEFTOVER_MAP_PLOT_SEGMENT_RANK, { label: segment.rankLabel })
}
>
{segment.rankLabel}
</text>
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/leftoverMapRank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ export const LEFTOVER_RANK_STRUCTURE_ACTION =

export const LEFTOVER_MAP_COMPARE_RANK_LABEL = "Leftover map comparison rank";

export const LEFTOVER_MAP_COMPARE_PLOT_SEGMENT_RANK =
"leftover map comparison graphic leftover-map rank {label}";

/**
* Format persisted rank evidence without coercion or inference.
*
Expand Down
28 changes: 28 additions & 0 deletions frontend/src/leftoverMapRankLocalization.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { afterEach, describe, expect, it } from "vitest";
import { setLocale, t, tf, type Locale } from "./i18n";
import {
LEFTOVER_MAP_COMPARE_PLOT_LABEL,
LEFTOVER_MAP_PLOT_SEGMENT_RANK,
} from "./leftoverMapPlotLayout";

const EXPECTED = [
["ko", "잔여 지도 비교 그림: 잔여 지도 순위 rank 1"],
["zh", "残差地图比较图形: 残差图秩 rank 1"],
["ja", "残差マップの比較図: 残差マップ階数 rank 1"],
["vi", "Đồ họa so sánh bản đồ phần dư: hạng bản đồ phần dư rank 1"],
] as const satisfies readonly (readonly [Exclude<Locale, "en">, string])[];

function comparisonRankAccessibleName(label: string): string {
return `${t(LEFTOVER_MAP_COMPARE_PLOT_LABEL)}: ${tf(LEFTOVER_MAP_PLOT_SEGMENT_RANK, { label })}`;
}

afterEach(() => {
setLocale("en");
});

describe("grouping-comparison leftover-map rank localization", () => {
it.each(EXPECTED)("keeps the accessible rank caption localized in %s", (locale, expected) => {
setLocale(locale);
expect(comparisonRankAccessibleName("rank 1")).toBe(expected);
});
});
19 changes: 8 additions & 11 deletions tests/test_grouping_comparison_graphic_rank_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,20 @@
RANK_SOURCE = ROOT / "frontend" / "src" / "leftoverMapRank.ts"


def test_comparison_graphic_names_the_persisted_rank_with_distinct_copy() -> None:
"""Comparison SVG rank captions must not reuse report or strip accessible names."""
def test_comparison_graphic_names_the_persisted_rank_with_distinct_localized_copy() -> None:
"""Comparison rank names compose existing localized graphic and rank vocabulary."""
plot_source = PLOT_SOURCE.read_text(encoding="utf-8")
rank_source = RANK_SOURCE.read_text(encoding="utf-8")

assert "LEFTOVER_MAP_COMPARE_PLOT_SEGMENT_RANK" not in rank_source
assert "LEFTOVER_MAP_COMPARE_PLOT_SEGMENT_RANK" not in plot_source
assert 'variant === "comparison"' in plot_source
assert (
'export const LEFTOVER_MAP_COMPARE_PLOT_SEGMENT_RANK =\n'
' "leftover map comparison graphic leftover-map rank {label}";'
in rank_source
)
assert "LEFTOVER_MAP_COMPARE_PLOT_SEGMENT_RANK" in plot_source
assert re.search(
r'variant\s*===\s*"comparison"\s*\?\s*LEFTOVER_MAP_COMPARE_PLOT_SEGMENT_RANK\s*:\s*LEFTOVER_MAP_PLOT_SEGMENT_RANK',
plot_source,
re.DOTALL,
'`${t(LEFTOVER_MAP_COMPARE_PLOT_LABEL)}: ${tf(LEFTOVER_MAP_PLOT_SEGMENT_RANK, {'
in plot_source
)
assert "label: segment.rankLabel" in plot_source
assert ': tf(LEFTOVER_MAP_PLOT_SEGMENT_RANK, { label: segment.rankLabel })' in plot_source


def test_rank_projection_consumes_only_persisted_fail_closed_evidence() -> None:
Expand Down
Loading