Skip to content

feat: groupId — merge related map operations onto one shared map#19

Merged
isamu merged 1 commit into
mainfrom
feat/map-id-grouping
May 25, 2026
Merged

feat: groupId — merge related map operations onto one shared map#19
isamu merged 1 commit into
mainfrom
feat/map-id-grouping

Conversation

@isamu
Copy link
Copy Markdown
Contributor

@isamu isamu commented May 25, 2026

Summary

Adds an optional groupId so a host can accumulate several mapControl operations onto ONE map instead of rendering a separate map per call. A new groupId starts a fresh map; reusing one (including for later updates) keeps building the same map.

Changes

  • types: groupId? on MapArgs / MapToolData / MapJsonData — threaded through execute and echoed on the emitted result. Documented as distinct from Google Maps' own mapId (cloud style id).
  • definition: groupId tool parameter with LLM-facing guidance (reuse the same id for one shared map + updates; new id for a separate map).
  • systemPrompt: a "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 executed results by groupId and 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 groupId and no results prop, behaviour is unchanged — every existing caller keeps the one-result-per-map rendering.

Test plan

  • yarn typecheck / yarn lint / yarn build clean
  • yarn dev demo: "Trip A ①→④" accumulate onto one "Map: tokyo-food-trip" card; "Trip B" renders a separate card (verified by reporter)

🤖 Generated with Claude Code

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>
@isamu isamu merged commit 2354b49 into main May 25, 2026
11 checks passed
@isamu isamu deleted the feat/map-id-grouping branch May 25, 2026 05:30
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.

1 participant