feat: groupId — merge related map operations onto one shared map#19
Merged
Conversation
Adds an optional `groupId` so a host can accumulate several map operations onto ONE map instead of spawning a card per call. - types: `groupId?` on MapArgs / MapToolData / MapJsonData (echoed through execute + emitted result). Documented as distinct from Google Maps' own `mapId` (cloud style id). - definition: `groupId` tool parameter with LLM guidance — reuse the same id for calls that share one map (and for later updates), a new id for a separate map. - systemPrompt: "Grouping operations onto one map" section with a worked example. - View: optional `results` prop — when the host passes the ordered group, the View replays the whole sequence onto its single map (markers accumulate, directions overlay, center follows the latest) and reconstructs that state on remount. Falls back to the single `selectedResult` (legacy one-result-per-map) when omitted. - demo: groups results by `groupId` and renders one merged card per group; "Trip A ①→④" samples accumulate on one map, "Trip B" lands on a separate card. Backward compatible: with no `groupId` / no `results`, behaviour is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <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
Adds an optional
groupIdso a host can accumulate severalmapControloperations onto ONE map instead of rendering a separate map per call. A newgroupIdstarts a fresh map; reusing one (including for later updates) keeps building the same map.Changes
groupId?onMapArgs/MapToolData/MapJsonData— threaded throughexecuteand echoed on the emitted result. Documented as distinct from Google Maps' ownmapId(cloud style id).groupIdtool parameter with LLM-facing guidance (reuse the same id for one shared map + updates; new id for a separate map).resultsprop. When the host passes the ordered group, the View replays the whole sequence onto its single map (markers accumulate, directions overlay, center follows the latest) and reconstructs that state on remount. Falls back to the singleselectedResult(legacy one-result-per-map) when omitted.groupIdand renders one merged card per group. New "Trip A ①→④" samples accumulate on one map; "Trip B" lands on a separate card.Backward compatibility
With no
groupIdand noresultsprop, behaviour is unchanged — every existing caller keeps the one-result-per-map rendering.Test plan
yarn typecheck/yarn lint/yarn buildcleanyarn devdemo: "Trip A ①→④" accumulate onto one "Map: tokyo-food-trip" card; "Trip B" renders a separate card (verified by reporter)🤖 Generated with Claude Code