Commit Graph

529 Commits

Author SHA1 Message Date
gnezim b7a358dadc CityAutocomplete item: 48px row height + bottom divider (Angular parity) 2026-04-20 12:42:04 +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 ce57c982da gitignore: exclude .claude/ and .dev.pid scratch files 2026-04-20 12:17:48 +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 d2f418f494 Show CityAutocomplete clear (×) button for any truthy value, not just resolved cities
Previously hasValue was computed from `selectedCity` — which required
the dictionaries to be loaded AND the raw code to map to a known city.
If the dictionaries were slow or the user typed free text, the clear
button stayed hidden and the filter became stuck with no way to wipe it.

Angular's CityAutocomplete uses `[ngClass]="{'has-value': city}"` on
the raw two-way-bound model, so any truthy value reveals the clear
button. Mirror that: `hasValue` is now true whenever the resolved
city, the outbound code, or the AutoComplete inputValue (free text or
suggestion object) is truthy.
2026-04-20 11:55:48 +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
gnezim 8e476b5883 OnlineBoardStartPage: background-position: left center (matches Angular) 2026-04-20 07:29:51 +03:00
gnezim 68e7b3e9ec Normalize 4/6/8px radii to vars.$border-radius (3px) across 5 SCSS files 2026-04-20 07:10:12 +03:00
gnezim 69020946b8 Card border-radius 8px→$border-radius (3px) on FlightsMiniList + FullRouteTimeline 2026-04-20 07:07:43 +03:00
gnezim 6faa01a998 DayTabs: 3px top-corner radius matching Angular date-tabs carousel arrows 2026-04-20 07:02:38 +03:00
gnezim 3577745477 Style Breadcrumbs as Angular's translucent pill (dark-blue-opacity bg, 3/10 padding) 2026-04-20 06:40:33 +03:00
gnezim da3f2713ac CityPickerPopup: gps-button uses $blue-light / $white / $blue-light--hover tokens 2026-04-20 06:38:14 +03:00
gnezim b6ed257a6a ErrorPage: use design tokens for code/input/focus colors 2026-04-20 06:35:33 +03:00
gnezim ef845f587f Final token sweep: pastel blues, blues, greys to design tokens (8 files) 2026-04-20 06:14:55 +03:00
gnezim b10e78f6a6 Token cleanup for OnlineBoardFilter + FlightsMap switch/tooltip colors 2026-04-20 06:11:26 +03:00
gnezim b8ab5af8aa Token cleanup for TimeGroup + FlightCard (#333/#f37b09/#fff/#e68200/#5b6b80 → tokens) 2026-04-20 06:08:43 +03:00
gnezim 2fdd7ac0ff Use tokens for FlightDetailsAccordion status colors (#c8102e/#f37b09/#4a90e2/#333/#657282) 2026-04-20 05:47:25 +03:00
gnezim 4d741c18e1 Token cleanup in OnlineBoardDetailsPage (#333/#657282/#d1dcea/#d0d5dd/#eee → tokens) 2026-04-20 05:44:41 +03:00
gnezim 8b0f4f75c2 Use tokens for FlightSchedule colors and FlightsMiniList flight-number navy 2026-04-20 05:41:35 +03:00
gnezim c1534bba44 Token cleanup for online-board components (#fff/#333/#657282/#d0dae5 → tokens) 2026-04-20 05:20:46 +03:00
gnezim 94e7180a2f Use colors.$white token across schedule components (6 files) 2026-04-20 05:16:56 +03:00
gnezim 928d072577 Align DetailsBackButton to Angular: left-aligned label, $button-height, tokens 2026-04-20 05:14:11 +03:00
gnezim d960e469ed Use colors.$white token for ScheduleFlightBody backgrounds/button text 2026-04-20 04:53:23 +03:00
gnezim 8e37fac674 Use design tokens for share-panel background/border/padding and 10px element gap 2026-04-20 04:49:13 +03:00
gnezim 89dd51cbaf Match Angular flight-events chip shape (squared 3px corners, 0/10 padding, line-height 16) 2026-04-20 04:47:01 +03:00
gnezim c8257baf26 Replace border-radius: 4px with vars.$border-radius (3px) to match Angular 2026-04-20 04:26:19 +03:00
gnezim 627f155f87 Replace #022040/#1a3a5c navy hex with colors.$blue-dark token 2026-04-20 04:21:47 +03:00
gnezim 2d7646d793 Replace custom brand hex with design tokens ($blue, $orange, $green, $red) across 13 SCSS files 2026-04-20 04:19:43 +03:00
gnezim fb82fc6ad1 Replace pastel-blue dividers/bg with $border and $blue-extra-light tokens (6 files) 2026-04-20 03:58:13 +03:00
gnezim 3bae0ee98f Replace hardcoded #e0e0e0 borders with $border-input and normalize $border-radius to 3px 2026-04-20 03:54:06 +03:00
gnezim 4aadab25e9 Normalize body-text #222 to colors.$text-color across 10 SCSS files 2026-04-20 03:50:54 +03:00