Skip to content

Calendars: green days and counts match the trip they open - #72

Open
davd-gzl wants to merge 3 commits into
fix/lists-linksfrom
fix/calendar-truth
Open

davd-gzl wants to merge 3 commits into
fix/lists-linksfrom
fix/calendar-truth

Conversation

@davd-gzl

@davd-gzl davd-gzl commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

7/10, high

A green day, a count or a duration on a list could promise a trip that the page it opens does not have. Each section below is one place where the number and the trip disagreed; after this change every one of them is computed by the same sweep as the list it leads to.

This sits on the lists-links branch, #71, and merges after it. Every capture below is Chromium headless at 390px wide unless it names another width, main 5e514c5 on the left and this branch on the right.


stayCalendar: a fixed stay's green day has no return

Paris to Lyon at 3 nights showed 17 green days, and 7 of them opened on an empty return list. stayCalendar graded every stay with flexibleNights, so a day was green when any stay up to N nights worked. A fixed stay is now graded by exactly N nights: 10 green days, none empty.

The form calendar for Paris to Lyon at 3 nights.

before: 17 green days, 7 of them counting fewer than 3 nights; after: 10 green days, every one 3


reverseGetawayIdeas: same-day discovery into a station loses origins

Into Lyon for the day on Sep 30 listed 5 origins and left out Valence, Montpellier and Paris, which the exact-trip page reaches with hours on site. The reverse search took the fastest outbound and whichever return came first. It now takes the earliest arrival and the latest return home, like the forward search: 13 origins that day.

Same-day trips into Lyon on Sep 30.

before: 5 possible departure points; after: 13, Valence, Montpellier and Paris among them


dedupe: a train shows its slower arrival

Train 6627 reaches LYON (intramuros) twice, at 19:54 and 20:10, and the list showed 20:10 because dedupe kept whichever row came first in the data. It now keeps the shortest row of each chain, and that row is the one displayed and booked.

Paris to Lyon on Sep 30, train 6627.

before: 17:52 to 20:10, 2 h 18; after: 17:52 to 19:54, 2 h 02


windowStats and browse cards: counts and times from the wrong days

"This month" counted trains dated before today, since windowStats took the whole snapshot: Lille from Paris read 179 against 170 bookable. Browse cards showed the month's fastest time, not the chosen day's, and discovery cards rounded hours the trip then printed exactly. Counts now cover today onward, times are the chosen day's, and cards print the trip's own figure.

The Lille row of a Paris browse, today being Sep 29.

before: 179 this month; after: 170


The form calendar and Flexible mode: two answers on one screen

Picking a day on the results page left "When to leave?" on the old day, and in Flexible the header, the date and the results could each name a different range. A day pick now repaints the form calendar, and in Flexible the first tap reads as a pending departure until the return tap runs the range, with days before the departure grey meanwhile.

Paris to Lyon on Oct 1, then Oct 3 picked on the results page, 1280px wide.

before: the form still reads Departure: Thu, Oct 1; after: Sat, Oct 3

Flexible, first tap on Oct 5.

before: the days before Oct 5 stay green; after: they are grey while the return is awaited

A discovery card now counts the time on site of the return the trip opens on, so the two figures agree. That costs a cold two-night list about 1.4 seconds more, since each card now runs the trip's own return search.

A fixed 2 or 3 night stay graded days by any stay up to that length, so
green days led to an empty return. The stay calendar now keeps the exact
length unless the stay is flexible.

Reverse same-day discovery now pairs the earliest arrival with the
latest return home, as the forward search does, so no origin is lost
and the hours on site match the trip. A train listed at two stations of
one group keeps its shortest row.

Browse and Ideas count trains from today only, and a card's time is the
chosen day's. Discovery cards and trip rows show the exact time on site,
and a stay's first return is the one the card counts.

The form calendar follows days picked under the results. In Flexible,
every range tap runs at once, so the header, date pill, URL and results
agree; days before the departure are not offered as a return, the inert
stepper reads the range, and the same-day minimum stays in place.
A stay's return list is fastest first again, and its first stays the
default return. A stay's discovery card now counts that return, so its
travel time matches the trip it opens.

The first Flexible range tap stages the departure on the form again and
runs nothing. It no longer rewrites the query, so the URL and the results
keep the range on screen while the form header reads the departure as
pending. The return tap runs the range.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant