Skip to content

Claude/travel cost estimator g2t ey#8

Open
dnfisher wants to merge 191 commits into
jamigibbs:gh-pagesfrom
dnfisher:claude/travel-cost-estimator-G2tEY
Open

Claude/travel cost estimator g2t ey#8
dnfisher wants to merge 191 commits into
jamigibbs:gh-pagesfrom
dnfisher:claude/travel-cost-estimator-G2tEY

Conversation

@dnfisher
Copy link
Copy Markdown

No description provided.

claude added 30 commits January 29, 2026 18:07
Search bounds fix:
- Drive mode now uses 60 mph for radius (not 500 mph flight speed)
- 6-hour drive from London now searches ~360 miles, not 3000 miles
- This returns local cities instead of global mega-cities

Added 10 UK destinations:
- Manchester, Birmingham, Bristol, Liverpool
- Glasgow, Bath, York, Cambridge, Oxford

London with 6-hour drive should now show:
Manchester (4h), Birmingham (2.5h), Bristol (2.5h), Liverpool (4.5h),
Bath (2.5h), Cambridge (1.5h), Oxford (1.5h), York (4h)

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
Major improvements to drive time accuracy:
- ORS now fetches accurate times for ALL driving destinations (up to 30)
- Happens BEFORE sorting/filtering, not just for top 15
- Re-filters results based on actual ORS travel times
- Initial filter uses 30% buffer to avoid excluding reachable destinations

Search bounds also improved:
- Drive mode: uses 60 mph for bounds calculation
- Fly mode: uses 500 mph minus airport time
- Results in tighter, more relevant local searches

This ensures users see accurate drive times everywhere, not estimates.

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
The issue: home city from Nominatim uses "United Kingdom" but
curated destinations use "UK". Strict comparison failed.

Fix: Added normalizeCountry() function that converts:
- "United Kingdom", "Great Britain", "England", "Scotland", "Wales" → "uk"
- "United States", "United States of America", "US" → "usa"

Now London → Manchester correctly allows driving since both normalize to "uk".

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
Logs:
- homeCountry in search debug
- Number of UK destinations found
- When UK destinations are marked as not drivable and why

Check browser console for output.

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
Track each UK destination through all filter stages to identify why
they're not showing when searching from London in drive mode.

Bump version to v1.9.2

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
- Implement fetchDrivingIsochrone() to get reachable area polygons from ORS
- Add isPointInIsochrone() for point-in-polygon checking
- Display isochrone on map with dashed orange border
- Filter destinations using isochrone when available (more accurate than simple distance)
- Fall back to distance-based filtering when isochrone unavailable
- Track isochroneFilter stats separately in debug output

This should fix UK destinations not showing when searching from London,
as the isochrone provides accurate road-based reachability instead of
simple distance calculations.

Bump version to v1.10.0

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
- Remove the simple circular radius when isochrone is displayed
- Add detailed console logging to debug isochrone fetch
- Fit map bounds to isochrone polygon
- Improve isochrone styling (thicker border, better tooltip)

Bump version to v1.10.1

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
- ORS free tier limits isochrones to 1 hour maximum
- Cap isochrone requests at 1 hour to avoid 400 errors
- Only display isochrone when time matches request (not capped)
- Only use isochrone for filtering when not capped
- Fall back to distance-based filtering for longer travel times

Bump version to v1.10.2

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
- Replace OpenRouteService isochrones with TravelTime API
- TravelTime supports up to 4 hours vs ORS's 1 hour limit
- Add TravelTime API credentials (appId and apiKey)
- Handle both Polygon and MultiPolygon responses
- Update MAX_ISOCHRONE_HOURS from 1 to 4

Bump version to v1.11.0

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
Add cities within driving distance of each other in Europe:
- Germany: Dresden, Leipzig, Hamburg, Frankfurt, Cologne
- Central Europe: Prague, Vienna, Salzburg, Krakow, Warsaw, Budapest, Zurich, Brussels

Now searching from Berlin, Munich, Copenhagen etc. will show
nearby destinations for road trips.

Bump version to v1.12.0

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
Denmark:
- Aarhus, Odense, Aalborg

Sweden:
- Gothenburg, Malmö, Uppsala, Helsingborg

Norway:
- Oslo, Bergen, Stavanger, Trondheim, Tromsø

Finland:
- Helsinki, Turku, Tampere

Now road trips from Copenhagen can reach Malmö (~30min), Gothenburg (~3h),
Oslo (~6h), Aarhus (~3h). From Stockholm: Uppsala (~1h), Gothenburg (~5h).

Bump version to v1.13.0

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
When no destinations are found:
- Show helpful message explaining the issue
- Offer clickable suggestions to expand search:
  - Increase travel time (e.g., 3h → 6h)
  - Switch to "both" mode (include flights)
  - Search worldwide
- Prevent showing an empty/confusing result

Bump version to v1.14.0

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
- Fix ray casting algorithm to work directly with coords array
- Add bounds check before detailed ray casting (optimization)
- Add error handling with graceful fallback
- Add detailed logging for UK destinations during isochrone check
- Debug log shows each UK city and whether it's inside the isochrone

Bump version to v1.14.1

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
- Redesign popup card with horizontal cost row (more compact)
- Add "Why visit" highlights section showing top 3 reasons for each destination
- Add Google Flights and Kayak links for flight destinations
- Add Booking.com and Airbnb links for accommodation booking
- Add 40+ European cities for driving coverage (France, Spain, Italy, Netherlands, etc.)
- Add highlights to major cities (London, Paris, Rome, Barcelona, etc.)
- Widen popup to 520px for better horizontal layout
- Update to v1.15.0

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
- Find the largest polygon in MultiPolygon responses by point count
- Previously took first polygon which could be a tiny fragment
- Add maxZoom limit (8) to fitBounds to prevent extreme zoom on small polygons

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
- Changed departureDate/returnDate to startDate/endDate
- These are the actual IDs of the date picker inputs in the HTML

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
- Fix startLocation -> homeCity (correct element ID)
- Add optional chaining (?.) for null safety on DOM elements
- Add fallback for empty date strings when splitting
- Bump version to v1.15.1

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
- Use departureDate/returnDate directly in Google Flights URL
- Previous fix removed variable definitions but not their usage

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
- Wrap each destination enrichment in try/catch to prevent single failure from breaking search
- Wrap marker creation in try/catch to handle popup errors gracefully
- Add null safety for date inputs in enrichment phase

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
- Add touristScore field (1-10 scale) to rate destination popularity
- Add Long Island destinations: Montauk, East Hampton, Southampton, Sag Harbor, Greenport, Shelter Island, Fire Island
- Add tourist score badges to destination cards (World Famous, Must Visit, Popular, Worth a Trip, Hidden Gem)
- Add score indicators to alternatives panel (🌟🔥⭐💎)
- Add highlights to all new destinations
- Score scale: 10=world famous, 7-8=must visit, 5-6=popular, 3-4=worth trip, 1-2=hidden gem

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
Card improvements:
- Move estimated total price to prominent footer at bottom
- Add placeholder images (8 varied Unsplash images) for destinations without photos
- Cleaner information hierarchy: badges at top, description, highlights, costs, booking
- Collapsible "Book This Trip" drawer for flights and accommodation links
- Cost breakdown as clean list instead of cramped grid
- Google Flights + Kayak links for flight destinations
- Booking.com + Airbnb links for all destinations
- Better visual separation between sections

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
- Replace varied Unsplash placeholders with single world map image
- Prevents misleading imagery (e.g., cityscape for beach towns)
- Neutral placeholder works for any destination type/climate

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
- Replace marker emojis with text labels (Drive/Fly)
- Increase marker icon size from 90x60 to 100x65
- Increase marker text sizes (city: 13px, price: 16px, details: 11px)
- Increase destination card text sizes across all elements
- Update description, badges, cost breakdown, and footer text

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
- Implement 3-tier destination system based on touristScore:
  - Tier 1 (score 7-10): Large markers, real images, full popup
  - Tier 2 (score 4-6): Medium markers, placeholder image, full popup
  - Tier 3 (score 1-3 or unrated): Dot markers, minimal popup
- Add touristScore to 60 major destinations (world-famous cities)
- Create getDestinationTier() helper function
- Add CSS styles for tiered markers (tier1, tier2, dot)
- Create minimal popup for tier 3 destinations
- Unrated destinations default to tier 3 for safety

This helps users focus on quality destinations with rich content
while still showing nearby options as simple dots.

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
Major refactor:
- Split UI into separate Driving Planner and Flying Planner tabs
- Isochrones now only used for driving mode
- Improved mobile-responsive layout with better breakpoints
- Real images now shown for Tier 1 AND Tier 2 destinations
- Updated travel time controls for each planner mode

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
- Fix popup cropping: removed Tier 3 minimal popup branch so all destinations show
  the full card with hero image, weather, cost breakdown, and booking links
- Road trip generator: new feature in Driving Planner tab
  - Enter a destination city (and optional end city for A→B trips)
  - Set trip duration in days (2–21)
  - Algorithm finds best intermediate stops from the destination dataset
    using a geographic corridor (perpendicular distance from home→dest axis)
  - Stops selected using bucket-based even spacing with tourist score tiebreaker
  - Route drawn on map as an orange dashed polyline with numbered markers
  - Sidebar results panel shows each stop with leg distances and total driving miles
  - Click any stop in the results to pan the map to it
  - Round trip (out-and-back) supported by default; A→B trips with optional end city
- Add setupCityAutocomplete() helper (reusable Nominatim autocomplete)
- Wire initRoadTripAutocomplete() into initPlannerTabs()

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
Road trip is now a first-class tab alongside Driving and Flying, with its
own clean sidebar UX instead of being crammed inside the drive-options panel.

Changes:
- Add 🗺️ Road Trip as 3rd top-level planner tab (orange active state)
- Road trip tab shows minimal sidebar: home city display, destination input,
  optional end city (A→B trips), days stepper, travelers, and Generate button
- Results render inline as a day-by-day timeline (Day 1, Day 2–3, etc.)
  with leg distances and drive time estimates between each stop
- Map shows route + nearby destination markers from the dataset so users
  can see what's available around their corridor
- switchPlannerTab('roadtrip') clears isochrone, shows destinations,
  updates home city display; leaving roadtrip tab clears the route
- selectHomeCity() now also refreshes the road trip home display
- clearRoadTripRoute() targets new #roadtripTimeline instead of old panel
- Mobile: tab labels hidden at 480px (icon-only), 3 tabs fit cleanly
- Removed embedded .roadtrip-section from drive-options
- Removed standalone .roadtrip-results bottom panel from sidebar
- Replaced old roadtrip-stop/connector CSS with new timeline CSS classes

https://claude.ai/code/session_01USGVmiQaFe4apraXwbg77A
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