Repository navigation
Organised tours with pick-up points, and no more lost MCP edits - #11
Merged
Merged
Conversation
An activity card's place is now where the tour picks you up or where you meet the guide, so travel times go there. A new list holds the places the tour visits: they show on the map as smaller pins joined by a dashed line, on the card and in the printout, without changing the day's timing. MCP gets tour_stops on add_item / update_item, and get_trip lists them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sync uploaded the whole trip and the newer updatedAt won. When the board recomputed a route on a copy older than Claude's latest MCP edit, its upload silently dropped that edit (cards, day start times, durations). The browser now says which version it edited; the server refuses the upload with 409 if the trip changed since and returns the stored copy. The browser keeps the last version both sides agreed on and does a three-way merge: each card, leg and day setting takes whichever side changed it, the browser wins only when both changed the same field. The MCP server also re-reads the trip before writing and starts over if it changed meanwhile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Activity cards with tour stops now read "Pick-up: <address>" and list the places visited (🗺️ A → B → C). The 🧭 button already navigates to the card's location, which is the pick-up point. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two changes that came out of planning a real trip (Mexico, 22 days) with Claude through MCP.
1. Organised tours: pick-up point + places visited
3.1,3.2, …), joined to the pick-up point by a dashed line. They don't affect the day's timing.🗺️ A → B → C; the printout shows Visits: … and labels the address Pick-up.tour_stopsonadd_item/update_item(name +place_queryor lat/lng,[]clears);get_tripprintstour visits: ….2. The browser no longer overwrites changes made through MCP
Bug: sync uploaded the whole trip and the newer
updatedAtwon. When the board recomputed a route on a copy older than Claude's latest MCP edit, its upload silently dropped that edit. In practice cards, day start times and durations kept disappearing a few seconds after Claude added them.Fix:
PUT /api/trips/:id?base=<updatedAt>: the server refuses with 409 (returning the stored trip) if the trip changed since the version the browser edited.basesin the store) and does a three-way merge (lib/merge.ts): each card, leg and day setting takes whichever side changed it; deletions apply unless the other side edited the card; moves and reorders from both sides combine; every card ends up in exactly one place. The browser wins only when both sides changed the same field.Known limit: the version check and the write aren't one atomic operation in the store, so a very small window remains (about the latency of one Google Drive call).
Test plan
bun run build:mobilebun run typecheck,eslint . --max-warnings 0,bun run test:coverage(192 tests, coverage gate passes),bun run buildlib/merge.test.ts(including the exact lost-update scenario), the conflict path inlib/sync.test.ts,tour_stopsinmcp/server.test.tsbasereturns 409 and writes nothing🤖 Generated with Claude Code