From 06b1aba530ca1c2f27f3dd09211fbbb590800862 Mon Sep 17 00:00:00 2001 From: gnezim Date: Wed, 22 Apr 2026 02:56:45 +0300 Subject: [PATCH] Revert map marker permanent label to city name (not IATA code) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../components/FlightsMapStartPage.test.tsx | 19 +++++++++++-------- .../components/FlightsMapStartPage.tsx | 9 +++++---- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/features/flights-map/components/FlightsMapStartPage.test.tsx b/src/features/flights-map/components/FlightsMapStartPage.test.tsx index d3397c45..875851ce 100644 --- a/src/features/flights-map/components/FlightsMapStartPage.test.tsx +++ b/src/features/flights-map/components/FlightsMapStartPage.test.tsx @@ -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>; 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"); }); }); diff --git a/src/features/flights-map/components/FlightsMapStartPage.tsx b/src/features/flights-map/components/FlightsMapStartPage.tsx index 422c6d66..ea1d80df 100644 --- a/src/features/flights-map/components/FlightsMapStartPage.tsx +++ b/src/features/flights-map/components/FlightsMapStartPage.tsx @@ -243,10 +243,11 @@ export const FlightsMapStartPage: FC = ({ 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),