Skip to content

Filters apply live everywhere, and every route calendar honours the trip-span cap - #65

Merged
davd-gzl merged 1 commit into
mainfrom
claude/max-correspondence-calendar-sync-0ew6s7
Jul 27, 2026
Merged

davd-gzl merged 1 commit into
mainfrom
claude/max-correspondence-calendar-sync-0ew6s7

Conversation

@davd-gzl

Copy link
Copy Markdown
Collaborator

Follow-up to #64, closing the two gaps that fix left open.

1. A filter now applies live — the results follow it, not just the form calendar

#64 made the form calendar repaint on a filter change, but the results — the list and the possible-days / return calendars inside it — kept grading the old budget until Search was pressed again. Changing "Max correspondances" while looking at a route left the page half-updated.

A filter is one deliberate choice, not a half-typed field, so applyFilterChange now repaints the form calendar and refreshes the results for that route in place: same history entry, applied value in the URL. Wired to every filter plus the radius, the trip span, hidden trains and the Ideas/tour region.

The staged-edit model is untouched where it earns its keep:

  • a typed route (departure, destination, legs, cities) still waits for Search — the search must not chase keystrokes;
  • a filter change never smuggles a staged route in: the refresh is skipped whenever the form's route, legs, cities or date no longer match what is on screen;
  • the bare landing form and the post-reload "press Search" prompt stay staged — nothing on screen to bring up to date, and a search must not start behind that prompt.

2. Every exact-route calendar honours "max trip span (days)"

The Advanced span cap applied to the journey lists only, so a calendar could show a green day whose list the cap then emptied — a dead-end day. odJourneyOptsFor now returns the widened day pool and the accept-filter together, and the one-way calendar, the round-trip return calendar and the form calendar all grade with it: the same sweep their list runs. It also collapses the three duplicated passesVia + withinSpan filter pairs into one accept.

Verification

  • Real browser, built app + committed snapshot: Paris → Toulouse, raising the filter refreshes the page live (0 → 8 green days, 69 journeys, conn=2 in the URL, no new history entry); with 3 changes the results calendar drops from 8 green days to 6 under a 1-day span, matching the trains actually listed.
  • Tests: staged route edit vs live filter change (and that a filter can't commit a staged route), the reload prompt still owning the first run, and odJourneyOptsFor's span cap + via hub — 156 unit tests, plus a new E2E scenario for the live filter (15/15).
  • Gates: tsc --noEmit, npm test, npm run build, npm run test:e2e.

docs/user-flows.md updated with the live-filter/staged-route contract and the span-aware calendars (and two stale builder names in the calendar table corrected).


Generated by Claude Code

…rip-span cap

Two gaps left over from the form-calendar fix.

1. A filter only ever repainted the form calendar. Change "Max correspondances" while
   results were on screen and the list — and the possible-days / return calendars inside
   it — kept grading the old budget until Search was pressed again. A filter is one
   deliberate choice, not a half-typed field, so it now applies live: applyFilterChange
   repaints the form calendar AND refreshes the results for that route in place (same
   history entry, applied value in the URL). Wired to every filter, the radius, the trip
   span, hidden trains and the Ideas/tour region.

   The staged-edit model is untouched where it earns its keep: a typed route (departure,
   destination, legs, cities) still waits for Search, and a filter change never smuggles
   one in — the refresh is skipped when the form's route or date no longer matches what is
   on screen. The bare landing form and the post-reload "press Search" prompt stay staged
   too: nothing on screen to bring up to date.

2. The Advanced "max trip span (days)" applied to the journey LISTS only, so an exact-route
   calendar could show a green day whose list the span cap then emptied. odJourneyOptsFor
   now returns the widened day pool and the accept-filter together, and the one-way
   calendar, the round-trip return calendar and the form calendar all grade with it — the
   same sweep their list runs. On the committed snapshot, Paris → Toulouse with 3 changes
   drops from 8 green days to 6 under a 1-day span, matching the trains actually listed.

Tests: the smoke suite now covers a staged route edit vs a live filter change (and that a
filter can't commit a staged route), the reload prompt still owning the first run, and the
span cap in odJourneyOptsFor; a new E2E scenario covers the live filter end to end.
@davd-gzl
davd-gzl merged commit 1204697 into main Jul 27, 2026
1 check passed
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.

2 participants