Commit Graph

310 Commits

Author SHA1 Message Date
gnezim bb49a5d609 Fix Schedule "Details" button + search-history sync
Schedule:
- ScheduleSearchPage wires handleFlightClick to DayGroupedFlightList so
  the "Детали рейса" button in the expanded flight body navigates to
  /{lang}/schedule/{carrier}{flightNumber}-{yyyyMMdd} (Angular's
  ScheduleNavigationService.toDetailsPage equivalent). Previously the
  Details button fired onStatus → no handler → no-op.

Search history:
- useSearchHistory now broadcasts a custom `afl:search-history-changed`
  window event on add/clear and listens for it in a useEffect. Fixes
  the case where a route-level component (ScheduleSearchPage) adds to
  storage while a sibling SearchHistory sidebar had already captured
  an empty initial value via useState — the sidebar now re-reads
  storage and shows the history without a page reload.
2026-04-20 16:34:52 +03:00
gnezim d44f97d312 OnlineBoardSearchPage retry button: $blue-light fill + $blue-light--hover (brand button parity) 2026-04-20 16:22:03 +03:00
gnezim 3806e8371a ScheduleSearchPage direction-switch: $space-xl margin + bottom border (Angular .schedule-home-page-header parity) 2026-04-20 16:18:37 +03:00
gnezim 67bf78d22e BoardDetailsHeader actions: transparent button hover uses $blue-extra-light (brand palette) 2026-04-20 15:51:46 +03:00
gnezim ea25f5c017 Replace 4 rgba(46,87,255,0.04/0.06/0.08) hover tints with $blue-extra-light / $blue-icon (brand palette) 2026-04-20 15:50:30 +03:00
gnezim d063281b09 ScheduleFlightBody share-btn: hover uses $blue-icon (Angular share-button parity) 2026-04-20 15:48:13 +03:00
gnezim f823aafb35 FlightCard/FlightDetailsAccordion: #8a8a8a → $light-gray (brand palette parity) 2026-04-20 15:28:15 +03:00
gnezim 23b5a35c70 DayTabs: mobile breakpoint 768px→640px, non-standard 8px radius→vars.$border-radius (Angular parity)
CI / ci (push) Failing after 51s
Deploy / build-and-deploy (push) Failing after 6s
2026-04-20 15:25:03 +03:00
gnezim 15f3356a75 ScheduleSearchPage: add Angular page-footer-notes to results frame 2026-04-20 15:17:34 +03:00
gnezim 81d979aa34 OnlineBoardSearchPage footer: render Angular page-footer-notes DOM + styling (blue-extra-light card, sort-note *) 2026-04-20 15:15:12 +03:00
gnezim 71b836ec7b FlightsMapFilter exchange button: 35x40 pill with +/-10px margin overlap (Angular .button-change parity) 2026-04-20 14:37:03 +03:00
gnezim 0665799555 FlightsMap loader: overlay + 60×60 ring with plane glyph (Angular loader-sheet parity) 2026-04-20 14:33:23 +03:00
gnezim e66661cee9 FlightsMap: no-directions overlay mirrors Angular no-directions-sheet (translucent bg + white card) 2026-04-20 14:28:21 +03:00
gnezim 6947e07fd1 FlightsMiniList selected: blue-light border (Angular parity, not blue) 2026-04-20 14:07:42 +03:00
gnezim c91fec16c2 FlightSchedule days strip: filled -color pills (Angular .days .day parity) 2026-04-20 14:00:33 +03:00
gnezim d7a9ae5d79 FlightCard schedule grid: match Angular schedule-list-flight-header (80px number, minmax(45,240)px stations) 2026-04-20 13:52:59 +03:00
gnezim 3e0b19f633 FlightDetailsAccordion: 1.3px dotted divider between tabs (Angular parity) 2026-04-20 13:32:20 +03:00
gnezim 21a557b875 ScheduleFilter: search button uses Angular blue-light 48px pill styling (Angular parity) 2026-04-20 13:28:30 +03:00
gnezim e4c8948cdc ScheduleFilter: add return-flight date range + time slider when round-trip (Angular parity) 2026-04-20 13:26:35 +03:00
gnezim 9134a830da ScheduleStartPage: add validation-tooltip SCSS for same-cities error 2026-04-20 13:23:08 +03:00
gnezim d44eb2fe71 ScheduleStartPage: add departure===arrival same-cities validation (Angular parity) 2026-04-20 13:21:51 +03:00
gnezim 02c6003225 ScheduleStartPage: Calendar min/max ±1/+330 days, return dates as single range picker (Angular parity) 2026-04-20 13:20:29 +03:00
gnezim 922e41e5c9 ScheduleStartPage: use shared CityAutocomplete (adds clear button + regional picker parity) 2026-04-20 13:18:29 +03:00
gnezim 0e74d9d196 FlightCard schedule mode + DayGroupedFlightList headers: number column 80→60px (Angular parity) 2026-04-20 13:00:51 +03:00
gnezim a361eeb7a5 ScheduleSearchPage: direction-switch exact Angular styles (130×40, extra-blue segmented) 2026-04-20 12:53:39 +03:00
gnezim 85deac7b54 ScheduleStartPage: bottom-description matches Angular's plain styling (no gray text, no link restyle) 2026-04-20 12:51:48 +03:00
gnezim 3d29c93eb6 DayGroupedFlightList: day header padding 12px 18px → 20px (Angular parity) 2026-04-20 12:50:11 +03:00
gnezim 5afebecfe7 FlightsMapFilter: add Angular's 'ROUTE' header above departure/arrival inputs 2026-04-20 12:48:35 +03:00
gnezim e8453ba66c FlightsMapFilter: resize toggle switch to 42×24 with 20px thumb (Angular parity) 2026-04-20 12:40:43 +03:00
gnezim 13926314d0 ScheduleFilter: add validation-tooltip SCSS style for inline errors 2026-04-20 12:36:16 +03:00
gnezim fc27e6c476 ScheduleFilter: validate departure===arrival mismatch with inline error (Angular parity) 2026-04-20 12:34:59 +03:00
gnezim 2434bd702b OnlineBoardFilter: validate departure===arrival mismatch with inline error (Angular parity) 2026-04-20 12:33:21 +03:00
gnezim 3a3a7cda5f DayGroupedFlightList: auto-expand first flight of today's group (Angular expandDefaultFlight parity) 2026-04-20 12:31:15 +03:00
gnezim 45a8023b68 OnlineBoardFilter: seed time range from URL params (Angular parity) 2026-04-20 12:28:02 +03:00
gnezim c456de9f9f OnlineBoardFilter: wire time range slider to route-search URL (Angular parity) 2026-04-20 12:26:29 +03:00
gnezim 6d87521634 ScheduleFilter: constrain Calendar to ±1/+330 day window (Angular scheduleMin/MaxDate parity) 2026-04-20 12:24:57 +03:00
gnezim 001b3f993d OnlineBoardFilter: constrain Calendar to ±1/+7 day window (Angular boardMin/MaxDate parity) 2026-04-20 12:23:23 +03:00
gnezim 62d3d68c1b ScheduleFilter: wire time range slider to schedule URL + seed from URL 2026-04-20 12:21:04 +03:00
gnezim 14242d8574 FlightsMapFilter: auto-fill date to today when departure picked (Angular parity) 2026-04-20 12:17:23 +03:00
gnezim 2ce6164b13 FlightsMapFilter: reset toggles when departure cleared; add disabled-title hint
Angular's FlightsMapFiltersStateService.setDeparture(undefined) also
resets domestic/international/connections to false — none of them make
sense without a departure anchor. React now mirrors that reset on clear
so a re-opened filter doesn't show phantom 'on' toggles.

Also added a `title` attribute on each disabled toggle that points
users to the missing city input. The toggles are still disabled (per
Angular behavior) but the hint explains *why* they can't be toggled,
which was the source of confusion in the 'feature not fully
implemented' report.
2026-04-20 12:03:57 +03:00
gnezim 37ebda8455 Allow departure-only / arrival-only online-board search submits
Previously handleRouteSubmit required both fields and returned silently
when only one was filled. Angular's
OnlineBoardUrlBuilderService.getRoutePageUrl switches on which side is
populated, routing to /onlineboard/departure/{dep}-{date} or
/onlineboard/arrival/{arr}-{date} for one-sided searches. React now
mirrors the same branch and only no-ops when neither side is filled
(matching Angular's `if (!departure && !arrival) return;` in
OnlineBoardFilterService.toRoutePage).
2026-04-20 11:53:36 +03:00
gnezim 0c1701086d Upgrade Schedule prefill codes to CitySuggestion objects once dictionaries load
ScheduleStartPage previously stored the raw IATA code from the prefill
in departureAirport / arrivalAirport state, so PrimeReact's AutoComplete
would render 'MOW' (or 'SVO' before the prior commit) literally in the
input. Now, once dictionaries resolve, the effect replaces each string
slot with a { code, name } object so the autocomplete shows 'Москва'.

Mirrors Angular CityAutocomplete.writeValue → getCityOrAirport, which
upgrades the bound string to a CityModel for display while keeping the
code as the outbound form value.
2026-04-20 11:44:38 +03:00
gnezim af473f9877 Resolve popular-request airport codes to city codes before prefill
Popular-requests API returns mixed airport (SVO) and city (MOW) IATA
codes. Clicking a "Шереметьево → Санкт-Петербург" entry used to paste
SVO into the departure field, leaving a specific airport pinned even
though the visible label already resolves to the owning city name.

Both start pages now route request.departure/arrival through
getCityCodeByAirportCode(dictionaries, code), so the filter form seeds
with MOW instead of SVO (and falls back to the raw code when
dictionaries aren't loaded yet). buildOnlineBoardPrefillState takes
an optional dictionaries arg for the same reason.

ScheduleStartPage.test mocks @/shared/dictionaries/index.js to preserve
the existing assertions (which expect unresolved codes).
2026-04-20 11:37:27 +03:00
gnezim 706b8f444b Clear the last 19 lint warnings — make check now passes clean
- BuyTicketButton / FlightsMiniListItem: narrow firstLeg/lastLeg with
  explicit null guards (throw / return '').
- FlightSchedule.tsx: `match?.[1] ?? iso` for the regex capture.
- OnlineBoardSearchPage + schedule/api: `split('T')[0] ?? iso` for the
  date-prefix extraction.
- ServicesPanel: icon lookup uses a third '' fallback instead of `!`.
- buildCountryCityRows: explicit `break` if cities[i] is undefined.
- useAppSettings: `match?.[1]` null-check before parseInt.
- datetime/index.ts: guard bare HH:MM capture groups together.
- ScheduleDetailsCatchAllRoute: drop unused `t` + useTranslation import.
- ScheduleDetailsPage.tsx: prefix unused `getLegs` with underscore.
- 4 seo/json-ld tests: drop now-redundant eslint-disable comments.
- calendarRange.test + api.test: prefix unused helper names with `_`.

Warning count: 19 → 0. make check (typecheck + lint + test) exits 0.
2026-04-20 09:30:34 +03:00
gnezim 8d409572b7 Drop 11 more non-null assertions across 5 files
- ErrorPage.tsx: FALLBACK_CONFIG literal instead of ERROR_CONFIG["500"]!
- ErrorBoundary.tsx: hoist FALLBACK_RU / FALLBACK_EN to consts so
  pickStrings returns them without the bang.
- routesToPolylines.ts: narrow spider-mode block on filterState.departure
  truthy; guard each route-code lookup.
- FlightsMapStartPage.tsx: narrow firstRoute/depCode/arrCode together
  instead of asserting each individually.
- OnlineBoardDetailsPage.tsx: IIFE over legs[i+1] for TransferBar;
  `_canonicalOrigin` prefix for currently-unused prop.

Warning count: 30 → 19.
2026-04-20 09:22:49 +03:00
gnezim 298f007463 Drop 11 non-null assertions in api.ts, DayGroupedFlightList, FlightCard
Regex capture groups and array boundary accesses replaced with nullish
fallbacks / explicit guards. Warning count: 41 → 30.
2026-04-20 09:19:14 +03:00
gnezim 1fc96b603e Drop 14 non-null assertions in ScheduleFlightBody + CityPickerPopup
- ScheduleFlightBody.tsx: hms regex capture uses `?? "0"` fallback;
  inline IIFEs expose last-leg and transfer-to-next in narrowed scope.
- CityPickerPopup.tsx: row.city1/city2/city1Airports are lifted into
  locals so the narrowing survives into JSX event handler closures.

Warning count: 55 → 41.
2026-04-20 08:33:33 +03:00
gnezim 6b6724f3de Drop 10 non-null assertions from MapCanvas zoom-layer loops
Replace `zoomLayers[c]![t]!` patterns with explicit null-guard
`continue` branches. The dimensions (2×5) are still initialized the
same way; the narrowing just makes the linter happy without changing
runtime behavior. Warning count: 65 → 55.
2026-04-20 08:28:57 +03:00
gnezim 5c47498472 Allow non-null assertions in tests; refactor two production hotspots to drop them
- eslint.config.js: disable no-non-null-assertion for *.test.ts/tsx and
  tests/** (fixture-driven tests routinely use arr[0]! after a length
  check — signal there is low).
- closestFlight.ts: replace flights.legs[0]! / flights[flights.length-1]!
  with explicit null checks.
- FlightDetailsAccordion.tsx: refactor transition + meal/service
  branches to use local consts narrowed by a preceding truthy check,
  dropping the `leg.transition!.registration!` patterns.

Warning count: 190 → 65. Remaining warnings are pre-existing production-code
non-null assertions spread across the codebase.
2026-04-20 08:24:01 +03:00
gnezim a982d9a669 Fix lint: route sessionStorage through shared storage module, drop dead imports
- storage.ts: add sessionStore wrapper (getRaw/setRaw/delete/clear) so
  transientPrefill + ScheduleStartPage tests don't trip the
  no-restricted-globals rule.
- transientPrefill.ts + ScheduleStartPage.test.tsx: use sessionStore.
- closestFlight.ts: hoist bracket-index key so no newline-before-[ ASI.
- Test files: hoist typeof import(...) into named type alias with
  type-only namespace import.
- Drop unused imports: FlightCard (Link, languageToLocale),
  OnlineBoardDetailsPage (operatingCarrier),
  ScheduleSearchPage (FlightList, inline import() types),
  PageLayout (FeedbackButton).
- Drop react-hooks/exhaustive-deps disable comments for a rule not
  registered in eslint.config.js.
2026-04-20 08:15:21 +03:00