Skip to content

Night strips, stay check-in/out and PDF itinerary export - #3

Merged
Torgh merged 4 commits into
mainfrom
stay-nights
Oct 14, 2026
Merged

Torgh merged 4 commits into
mainfrom
stay-nights

Conversation

@Torgh

@Torgh Torgh commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Summary

Four commits, each typechecked and tested on its own:

  • Night strips – every day column ends with where you sleep that night: the stay with "Night n of N" and check-in / check-out-tomorrow hints, an overnight flight or boat, or an orange "No accommodation" warning with + Add stay (opens the editor preset to Stay). Each stay keeps one colour on all its nights (same-name stays share it), using hues separate from the day colours. Clicking a strip highlights the stay card and its pin. Logic in lib/stays.ts with tests.
  • Stay check-in / check-out – stays no longer use a fixed start time and duration. The editor shows Nights, "Check-in from", "Check-out by" and the date range. Check-in is not a fixed start, so arriving later is not flagged as late; older stays with a fixed start time move it into check-in when edited. Shown on cards, night strips and the MCP summary; add_item / update_item accept stay_check_in / stay_check_out.
  • PDF itinerary export – the trip's Export button is now a menu: JSON (existing backup) or PDF. PDF opens /trip/print?id=…, a print-ready itinerary (overview of days and nights, bookings table, day-by-day plan with times, legs, booking refs, addresses, notes, warnings). "Save as PDF" uses the browser print dialog, so text stays selectable; always light, with its own print styles.
  • Map in the PDF – zoomed on the trip's area. Flights more than 1000 km from every stay or visited place (e.g. flights from home) are left off the map entirely. The map's height follows the area's shape; it's a static picture and MapLibre keeps its drawing buffer so the canvas prints. Overview rows show each day's colour.

Test plan

  • bun run typecheck
  • vitest run – 28 tests pass (new: lib/stays.test.ts, focusItems / mercatorAspect in lib/geo.test.ts)
  • Headless Chrome screenshot of a 22-day trip: night strips, stay colours, overnight flights
  • Headless Chrome PDF of the same trip: 9 pages; map framed on Thailand without the Warsaw/Doha flights
  • Export menu, stay editor and PDF checked manually in the app
  • PDF map with the OpenStreetMap (no Google key) map

🤖 Generated with Claude Code

Torgh and others added 3 commits October 14, 2026 19:54
Each day column ends with a night strip: the stay you sleep in, with
"Night n of N", check-in and check-out-tomorrow hints, or an overnight
flight/boat, or a "No accommodation" warning with "+ Add stay". Every
stay keeps one colour on all its nights (stays with the same name share
it), using hues kept apart from the day colours. Clicking a stay strip
highlights the stay card and its map pin.

The night logic lives in lib/stays.ts (nightsOf, stayColorIndex) with
tests. The item editor can now be opened with a preset type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stays no longer use a fixed start time and duration. The editor shows a
Stay section with nights, "check-in from" and "check-out by" times and
the date range. Check-in is not a fixed start, so arriving later than
it is not flagged as late; older stays with a fixed start time move it
into check-in when edited.

The times appear on the stay card, in the night strip and in the MCP
trip summary, and add_item / update_item accept stay_check_in and
stay_check_out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The trip's Export button now opens a menu: JSON (the existing backup
download) or PDF. PDF opens a print-ready itinerary page
(trip/print?id=…) with an overview of days and nights, a table of all
bookings with references and prices, and a day-by-day plan with times,
travel legs, booking details, addresses, notes, warnings and where each
night is spent. "Save as PDF" uses the browser's print dialog, so the
text stays selectable; the page has its own print styles and is always
light.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Torgh
Torgh merged commit cbbba5a into main Oct 14, 2026
1 check passed
The printable itinerary starts with a map zoomed on where the trip
happens. Flights more than 1000 km from every place you stay or visit
(e.g. the flights from home) are left off the map, pins and lines, so
the map frames the destination instead of the whole route there. The
map's height follows the shape of that area (tall trips get a tall map)
and it is a still picture: no controls, no gestures, light colours,
and MapLibre keeps its drawing buffer so the canvas prints. The
overview table shows each day's colour to match the route lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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