From d220c76be7f1890283708e76aa8c82ebffb3cc8f Mon Sep 17 00:00:00 2001 From: gnezim Date: Wed, 22 Apr 2026 17:24:15 +0300 Subject: [PATCH] =?UTF-8?q?Persist=20Schedule=20filter=20into=20cross-sect?= =?UTF-8?q?ion=20store=20on=20submit=20(TZ=20=C2=A74.1.8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ScheduleFilter's handleSubmit now calls setScheduleFilter with the submitted outbound + optional return snapshot. This completes the cross-section wiring: OnlineBoardFilter already wrote to the store and both start pages read getBoardFilter/getScheduleFilter for Table-10 projection on subsystem switch. --- .../schedule/components/ScheduleFilter.tsx | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/features/schedule/components/ScheduleFilter.tsx b/src/features/schedule/components/ScheduleFilter.tsx index 9c74abd9..202e3710 100644 --- a/src/features/schedule/components/ScheduleFilter.tsx +++ b/src/features/schedule/components/ScheduleFilter.tsx @@ -19,6 +19,7 @@ import { useDictionaries } from "@/shared/dictionaries/index.js"; import { useScheduleCalendar } from "../hooks/useScheduleCalendar.js"; import type { IScheduleCalendarParams } from "../types.js"; import { buildScheduleUrl } from "../url.js"; +import { setScheduleFilter } from "@/shared/state/crossSectionNavigation.js"; import type { ScheduleParams } from "../url.js"; import { formatScheduleDateRangeWithCurrentWeek } from "../dateLabels.js"; import { scheduleWindowBounds } from "@/shared/dateWindow.js"; @@ -374,6 +375,29 @@ export const ScheduleFilter: FC = ({ params = { type: "route", outbound }; } const url = buildScheduleUrl(params); + // TZ §4.1.8: persist Schedule filter into the cross-section + // store so a subsequent visit to Board/Schedule within the same + // session can read/project it. + setScheduleFilter({ + mode: "route", + ...(dep ? { departure: dep } : {}), + ...(arr ? { arrival: arr } : {}), + dateFrom: outbound.dateFrom, + dateTo: outbound.dateTo, + timeFrom: outbound.timeFrom ?? "0000", + timeTo: outbound.timeTo ?? "2400", + onlyDirect: directOnly, + showReturn: returnFlights, + ...(returnFlights && params.type === "roundtrip" + ? { + returnDateFrom: params.inbound.dateFrom, + returnDateTo: params.inbound.dateTo, + returnTimeFrom: params.inbound.timeFrom ?? "0000", + returnTimeTo: params.inbound.timeTo ?? "2400", + } + : {}), + searchExecuted: true, + }); // Lock submit for 30 seconds (§4.1.11 — hardcoded, not configurable) setSubmitLockedUntil(Date.now() + 30_000); setNowTs(Date.now());