Commit graph

7 commits

Author SHA1 Message Date
Edward Betts 3ad11b070a More tests 2025-07-16 06:54:35 +02:00
Edward Betts 9dd033ba77 Fix location tracking for all remaining weekend test failures
Expand return-home heuristic to cover more countries and reorganize logic
to prioritize trip-based location detection over individual travel data.

Key changes:
1. Add Balkan countries (GR, AL, XK, HR, etc.) to European heuristic
2. Add major international countries (US, CA, IN, JP, etc.) to heuristic
3. Change condition from >1 day to >=1 day for faster return detection
4. Move trip heuristic check before individual flight/accommodation lookup

This fixes cases where stopovers or connections (like Kosovo→Albania on
July 1) were overriding the trip-based "return home" logic. Now correctly
detects return home from all types of trips including Balkan and
international destinations.

All weekend location tests now pass - ensures locations show "Bristol"
when free (no events) or show trip locations when traveling.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 06:54:35 +02:00
Edward Betts fcd0e9c1cd Fix European trip return heuristic for weekend location tracking
Adjust European short trip heuristic from >3 days to >1 day to correctly
detect when user has returned home from European trips. This fixes the
April 29-30, 2023 case where the location incorrectly showed "Sankt Georg, Hamburg"
instead of "Bristol" when the user was free (no events scheduled) after
the foss-north trip ended on April 27.

The previous logic required more than 3 days to pass before assuming
return home from European countries, but for short European trips by
rail/ferry, users typically return within 1-2 days.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 06:54:26 +02:00
Edward Betts 80e12b77ce Handle short European trips with rail/ferry returns
When traveling to nearby European countries by rail or ferry,
return journeys often aren't recorded in flight/accommodation
data. Added logic to assume you've returned home after short
European trips that ended >3 days ago.

Covers common rail/ferry destinations: Belgium, Netherlands,
France, Germany, Switzerland, Austria, Italy, Spain.

Example: Feb 2-5 trip to Brussels (by rail), Feb 18 now
correctly shows "Bristol" instead of "Brussels".

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 04:28:58 +02:00
Edward Betts 6533165bef Fix location tracking for trips ending in UK
When a trip ended in the UK but had foreign accommodations during
the trip, location tracking would incorrectly show the foreign
location even after returning home.

Added logic to detect when the most recent travel occurred within
a completed trip that ended in the UK, and override foreign
accommodations to show "Bristol" (home) for dates after the trip.

Example: Trip Sep 8-17 with accommodation in Kochi, India on Sep 10,
but trip ended at Gatwick Airport, UK. Oct 7 now correctly shows
"Bristol" instead of "Kochi".

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 04:18:56 +02:00
Edward Betts a92debea5b Fix same-day flight location tracking
When multiple flights arrived on the same date, location tracking
only compared dates and missed later flights. Now compares both
date and time to handle same-day connecting flights correctly.

Example: Nov 21, 2023
- 06:15: Arrive Madrid (MVD → MAD)
- 09:15: Arrive London (MAD → LHR) ← Now properly detected as most recent

This ensures users show as "home" when they've returned to UK on
the same day as an international connection.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 04:10:25 +02:00
Edward Betts af492750cb Add location tracking to weekend page
Weekend page now shows specific location (city and country) for each
Saturday and Sunday based on travel history:

- Analyzes flight arrivals and accommodation check-ins to determine exact location
- Shows "home" when at Bristol, UK
- Shows "City, 🏴 Country" format when traveling
- Handles multi-location trips by finding most recent travel within trip period
- Optimized to parse YAML files once instead of per-date lookup

Closes #191

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 03:59:35 +02:00