Revert map marker permanent label to city name (not IATA code)

Earlier §4.1.24.3 R24 fix (commit 0bb6bf2) set the permanent on-map
label to the IATA city code. That mis-read the TZ: §4.1.24.3 describes
the hover tooltip (всплывающая подсказка) as showing the airport
code, not the always-visible marker label. Angular reference + the
user-facing baseline render the permanent label as the localized
city name.

- FlightsMapStartPage: label = city.name (localized via dictionary).
- Updated two test assertions that had codified the previous IATA-
  based form.

Live retest: map now shows "Москва", "Санкт-Петербург", "Сочи", etc.
on its markers. 2044 tests pass, typecheck clean.
This commit is contained in:
2026-04-22 02:56:45 +03:00
parent 26d116f18e
commit 06b1aba530
2 changed files with 16 additions and 12 deletions
@@ -187,8 +187,10 @@ describe("FlightsMapStartPage — markers from dictionaries", () => {
const mow = markers.find((m) => m["id"] === "MOW")!;
expect(mow["countryType"]).toBe("ru");
expect(mow["zoomLevel"]).toBe(2);
// TZ §4.1.24.3 R24: tooltip label is the IATA city code, not the city name
expect(mow["label"]).toBe("MOW");
// Permanent marker label is the localized city name. (The IATA code
// belongs to a separate hover tooltip per TZ §4.1.24.3 R24 — not to
// this always-visible label.)
expect(mow["label"]).toBe("Москва");
const par = markers.find((m) => m["id"] === "PAR")!;
expect(par["countryType"]).toBe("other");
@@ -790,10 +792,12 @@ describe("4.1.1-R14/R21: Flight-Map first-entry toggle defaults per TZ §4.1.1",
});
// ---------------------------------------------------------------------------
// TZ §4.1.24.3 R24: marker labels are IATA codes (not city names)
// Permanent marker label shows the localized city name. TZ §4.1.24.3 R24
// prescribes the separate hover tooltip (not the always-visible label)
// as showing the IATA code.
// ---------------------------------------------------------------------------
describe("§4.1.24.3 R24: map markers use IATA code as tooltip label", () => {
describe("map markers use localized city name as permanent label", () => {
beforeEach(() => {
lastMapCanvasProps = null;
dictState.loading = false;
@@ -804,7 +808,7 @@ describe("§4.1.24.3 R24: map markers use IATA code as tooltip label", () => {
resetCrossSectionStore();
});
it("4.1.24-R24: marker label equals city code (IATA), not city name", () => {
it("marker label equals the localized city name, not the IATA code", () => {
dictState.dictionaries = buildDictionaries({
regions: [],
countries: [],
@@ -832,9 +836,8 @@ describe("§4.1.24.3 R24: map markers use IATA code as tooltip label", () => {
const markers = lastMapCanvasProps!["markers"] as Array<Record<string, unknown>>;
const mow = markers.find((m) => m["id"] === "MOW")!;
// TZ §4.1.24.3 R24: tooltip shows the IATA airport code, not the city name
expect(mow["label"]).toBe("MOW");
expect(mow["label"]).not.toBe("Москва");
expect(mow["label"]).toBe("Москва");
expect(mow["label"]).not.toBe("MOW");
});
});
@@ -243,10 +243,11 @@ export const FlightsMapStartPage: FC<FlightsMapStartPageProps> = ({
id: city.code,
lat: city.location.lat,
lng: city.location.lon,
// TZ §4.1.24.3 R24: hover tooltip shows the IATA airport code, not
// the city name. The city code doubles as IATA here since our
// dictionaries use IATA city codes (MOW, LED, …).
label: city.code,
// Permanent on-map label shows the localized city name (dictionary
// is loaded per current locale). TZ §4.1.24.3 R24 describes the
// separate hover tooltip as showing the IATA code; that's not the
// same element as this always-visible marker label.
label: city.name,
tooltipPermanent: true,
style: isHighlighted ? "orange" : "blue-small",
zoomLevel: getCityZoomLevel(city.code),