Skip to content

Show Interrail reservation fees as an opt-in setting - #97

Open
davd-gzl wants to merge 5 commits into
interrail-passfrom
interrail-fees
Open

davd-gzl wants to merge 5 commits into
interrail-passfrom
interrail-fees

Conversation

@davd-gzl

@davd-gzl davd-gzl commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Before: an Interrail holder sees which trains run, but not what each pass-holder reservation costs.

After: a new setting, Interrail reservation fees (off by default), shows each trip's reservation fee on the Interrail exact-trip list, for example "Reservation €10–€20" on a TGV INOUI or €31 to Turin. A connection adds up its trains. A Cheapest reservation sort appears, along with a note that the fees are indicative, 2nd class, with a link to Interrail's fee page. With the setting off, or on a MAX pass, nothing changes.

Stacked on #83 (base interrail-pass). It retargets to main once #83 merges.

Screenshots

At 390 px, with the bundled snapshot.

French English
[![Exact trip Paris to Toulouse with the fees setting on: the note linking Interrail's fees, then a direct train with "Résa 10 €-20 €" next to "Direct"](https://raw.githubusercontent.com/offware-apps/MAX-Finder/4afa855f09b1efd3f6def919f80ddd2b8f019940/docs/pr-fees/fees-mobile-fr.png)](https://raw.githubusercontent.com/offware-apps/MAX-Finder/4afa855f09b1efd3f6def919f80ddd2b8f019940/docs/pr-fees/fees-mobile-fr.png) [![The same in English: "Reservation €10–€20"](https://raw.githubusercontent.com/offware-apps/MAX-Finder/4afa855f09b1efd3f6def919f80ddd2b8f019940/docs/pr-fees/fees-mobile-en.png)](https://raw.githubusercontent.com/offware-apps/MAX-Finder/4afa855f09b1efd3f6def919f80ddd2b8f019940/docs/pr-fees/fees-mobile-en.png)

Try it

git fetch origin interrail-fees && git checkout interrail-fees
npm ci && npm run dev

Open http://localhost:5173/?card=interrail&mode=od&from=PARIS%20(intramuros)&to=TOULOUSE%20MATABIAU, then turn on Settings → Interrail reservation fees.

How

  • Fees. src/data/fees.ts uses the same table that train-api publishes as v1/sncf/interrail/fees.json (Publish the Interrail reservation fees for SNCF trains train-api#11). It was hand-entered from Interrail's fee pages on 2026-10-12. If a stop is abroad, that country's fee applies (Germany €19, Lyria €25, Italy €31, Brussels €20–35, Spain €25 or €35). Otherwise the axe sets the domestic fee (TGV INOUI and Intercités €10–20, Intercités de Nuit €10–25). SNCF coaches have no published fee, so they show none and sort last.
  • Setting. fees in mj.settings defaults to off and sits in the Settings dialog. ctx.fee is set only when it is on and the pass is Interrail.
  • Display. The chip sits next to Direct/via in each journey's head. cheapest is a new sort key (it survives in the URL), offered only while fees show.
  • No-reservation filter. It is not added here: every train in the SNCF feed needs a reservation for pass holders, so the filter would always come back empty in France.
  • Copy. Six new keys in all 11 locales. docs/user-flows.md is updated.

Checks

tsc, npm test (235 passed, including tests/fees.test.ts), npm run build, npm run verify and npm run test:e2e (23/23) all pass. The chip and note wrap without cutting text at 390 px.

Refs #92

A new setting, off by default, adds each trip's pass-holder reservation fee (2nd class)
to the Interrail exact-trip list, adds up the trains of a connection, offers a
"Cheapest reservation" sort and links Interrail's fee page. The fee table in
src/data/fees.ts is the one train-api publishes: a stop abroad sets the fee for its
country, otherwise the axe sets the domestic one.

Refs #92

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