mock: wire to the real local OSRM router + L0 trip view, version history, offline cues

- server.js: proxy /route, /table, /router-status to the local OSRM on :5000
- app.js: routeClient (polyline-5 decode, ordered route fetch); legs start as
  straight-line estimates (conf 1) and are upgraded in the background to real
  road geometry + duration (conf 3); out-of-coverage trips (Florence) fall
  back gracefully with a 'estimate — outside router coverage' source
- L3 leg editor: dragging a waypoint now genuinely re-routes through the
  router (was silently no-op — #app covered the map with pointer-events:auto,
  so no map drag ever landed; #app is now pointer-events:none, children opt in)
- data.js: second demo city (Boston 14–16 Sep, inside the router's NE-US
  extract) via ?city=boston; nudges + multimodal legs are now dataset-driven
- L0: Day/Trip scope toggle — per-day summary cards (pacing bar, stops,
  end time, price, base) with click-to-jump; map fits the whole trip
- version history: commit() snapshots days+stays on every mutation; topbar
  vN pill with undo/redo + dropdown timeline showing a diff label per version;
  Ctrl+Z / Ctrl+Shift+Z / Ctrl+Y; restore() re-enriches legs (snapshots may
  predate route enrichment)
- offline: staged 'prepare for offline' card in the trip rail (itinerary →
  POI details → vector tiles) that flips the topbar badge to '📦 offline ready'
- chat/scripts/nudges: Florence-specific strings generalized (stay name/dates,
  vibes, pacing summary) so both demo cities read naturally
This commit is contained in:
gmp
2026-09-09 00:47:50 -04:00
parent 146c7e168c
commit 30f3dd9cbf
5 changed files with 735 additions and 80 deletions
+19 -3
View File
@@ -24,6 +24,11 @@
<div class="dz-text"><b>Drop a travel booking to start</b><br>ticket, flight or hotel confirmation</div>
<button id="dz-sample" class="btn ghost small">or start from an example booking</button>
</div>
<div class="land-demo">
<span>or explore a demo trip</span>
<button class="chip" data-city="florence">Florence</button>
<button class="chip" data-city="boston">Boston <i>· live road routing</i></button>
</div>
</div>
</section>
@@ -42,10 +47,21 @@
<!-- ======================= APP ======================= -->
<header id="topbar" class="hidden">
<div class="tb-left">
<span class="crumb" id="crumb">Florence · 12–15 Sep</span>
<span class="crumb" id="crumb">…</span>
<div class="scope-toggle" title="Day = working view · Trip = macro overview of all days">
<button id="scope-day" class="sct on" data-sc="day">Day</button>
<button id="scope-trip" class="sct" data-sc="trip">Trip</button>
</div>
<div class="daytabs" id="daytabs"></div>
</div>
<div class="tb-right">
<div class="verpill" id="verpill">
<button id="ver-undo" class="vp-btn off" title="Undo (Ctrl+Z)">↩</button>
<span id="verlabel" class="vp-label" title="Version history — recent edits, click to compare/revert">v0</span>
<button id="ver-redo" class="vp-btn off" title="Redo (Ctrl+Shift+Z)">↪</button>
</div>
<div id="verlist" class="verlist hidden"></div>
<span class="badge" id="offline-badge" title="On-trip offline bundle">📶 online</span>
<span class="badge" id="nudge-badge" title="Plan nudges">✓ looking good</span>
</div>
</header>
@@ -56,7 +72,7 @@
<div class="rail-block" id="transit-block"></div>
<div class="rail-block" id="sugg-block"></div>
<div id="rail-body"></div>
<div class="rail-foot">
<div class="rail-foot" id="rail-foot">
<div class="budget">
<div class="budget-label"><span id="budget-text">…</span></div>
<div class="budget-bar"><div id="budget-fill"></div></div>
@@ -83,7 +99,7 @@
</div>
<div id="l3-editor" class="hidden">
<div class="l3-title" id="l3-title">Route</div>
<div class="l3-hint">Drag the ● waypoint (or the endpoints) — the duration updates live.</div>
<div class="l3-hint">Drag the ● waypoint (or the endpoints) — the duration updates live; the local router re-routes on the road network when the area is covered.</div>
<div class="l3-time">leg time: <span id="l3-time" class="tc t-computed">…</span></div>
<button class="btn ghost small" id="l3-close">Done</button>
</div>