Skip to content

add Google POI suggestion & place-structure implementation plan#187

Open
soranjiro wants to merge 2 commits into
mainfrom
codex/implement-place-suggestion-feature-with-google-poi
Open

add Google POI suggestion & place-structure implementation plan#187
soranjiro wants to merge 2 commits into
mainfrom
codex/implement-place-suggestion-feature-with-google-poi

Conversation

@soranjiro
Copy link
Copy Markdown
Owner

Motivation

  • Provide a concrete, cross-team implementation plan to add Google Places POI autocomplete suggestions to place inputs and to store structured place data for future ML/analytics.
  • Ensure backward compatibility with existing free-text steps.location while proposing DB/API/frontend changes to enable richer place metadata (Place ID, geo, address components, source, etc.).
  • Document UX, privacy/regulatory considerations, phased rollout, and risks so implementation can proceed without blocking product/security reviews.

Description

  • Add a comprehensive plan at docs/developer/google-poi-place-data-plan.md that covers motivation, UX, data model (places / step_places), API endpoints (/api/places/autocomplete, /api/places/details), frontend component (PlaceInput.svelte) and a phased roadmap.
  • Update docs/developer/index.md to link the new plan from the developer guide index.
  • The plan includes suggested SQL for new tables, TypeScript API/type sketches (PlaceStructuredData, StepPlaceLink), step create/update flows, field-mask recommendations for Google Place Details, and ML/analytics view examples.
  • Implementation notes include using a server-side proxy for Google calls, session token handling, attribution, rate limiting, and tests/migration checklist to keep existing behavior compatible.

Testing

  • Ran the project test suite with pnpm test (invokes turbo test:run).
  • Automated tests completed successfully: web tests passed (39 tests) and api tests passed (125 tests), with the test run finishing without failures.
  • No code changes to runtime logic were made in this PR, so tests confirm repository health after adding documentation and index link.

Codex Task

@soranjiro
Copy link
Copy Markdown
Owner Author

@codex
実際に実装まで行ってください。
テスト用にGoogleのmockサーバも別で用意して試せるようにしてみて
mockサーバーは独立で、Googleの設定をしたらmockサーバ無しでそのまま使えるようにして
standardのテーマに優先的に実装して

@chatgpt-codex-connector
Copy link
Copy Markdown

Summary

Testing

  • pnpm --filter web test:run src/lib/server/googlePlaces.test.ts
  • pnpm --filter web build
  • node tools/google-places-mock/server.js > /tmp/google-places-mock.log 2>&1 & pid=$!; sleep 1; curl -fsS 'http://localhost:8789/v1/places/mock-google-place-tokyo-station' | node -e 'let d="";process.stdin.on("data",c=>d+=c).on("end",()=>{const j=JSON.parse(d); if(j.displayName?.text!=="東京駅") process.exit(1); console.log(j.displayName.text)})'; status=$?; kill $pid 2>/dev/null || true; exit $status
  • pnpm --filter web exec svelte-check --tsconfig ./tsconfig.json(既存の unrelated な型エラー・警告で失敗。例: standard-autumn 配下の欠落 import、map-only / mapbox-journey の既存 props 型不一致など。今回追加分は pnpm --filter web build でコンパイル通過しています。)

View task →

@soranjiro
Copy link
Copy Markdown
Owner Author

@codex
実装したものをこのブランチにコミットしてpushまでして
テストが通ることも確認して

@chatgpt-codex-connector
Copy link
Copy Markdown

Summary

  • Google Places(New)向けのサーバーサイドプロキシを追加し、実 Google 利用時は GOOGLE_PLACES_API_KEY / GOOGLE_MAPS_API_KEY、mock 利用時は GOOGLE_PLACES_API_BASE_URL で切り替えられるようにしました。Autocomplete / Details の field mask と session token もサーバー側で扱います。
  • Places 用の共有型とフロントエンド API ラッパーを追加しました。
  • standard テーマの場所入力に PlaceInput を導入し、候補検索・詳細取得・手入力 fallback・Google attribution 表示に対応しました。
  • EventDetailDialog で選択済み Google Place を notes JSON の google_place に保存し、手入力時は古い google_place を消すようにしました。保存済み Maps URL がある場合は詳細表示で Google Maps リンクを表示します。
  • Place autocomplete UI 用の standard テーマ CSS を追加しました。
  • 独立起動できる Google Places mock server と利用手順を追加し、root script / wrangler example に設定例を追記しました。
  • Google Places 変換処理・設定優先順位・field mask / session token 付きリクエストのユニットテストを追加しました。
  • コミット済みです: 53bbd88 feat: implement Google Places suggestions
  • PR 作成処理も実行しました。
  • 参考にした一次情報: Google Places API (New) overview

Testing

  • pnpm --filter web test:run src/lib/server/googlePlaces.test.ts
  • pnpm --filter web build
  • node tools/google-places-mock/server.js > /tmp/google-places-mock.log 2>&1 & pid=$!; sleep 1; curl -fsS 'http://localhost:8789/v1/places/mock-google-place-tokyo-station' | node -e 'let d="";process.stdin.on("data",c=>d+=c).on("end",()=>{const j=JSON.parse(d); if(j.displayName?.text!=="東京駅") process.exit(1); console.log(j.displayName.text)})'; status=$?; kill $pid 2>/dev/null || true; exit $status
  • pnpm test
  • ⚠️ node - <<'EOF' const { chromium } = require('@playwright/test'); (async () => { const browser = await chromium.launch({ headless: true }); const page = await browser.newPage({ viewport: { width: 1280, height: 900 } }); await page.goto('http://localhost:4173/', { waitUntil: 'networkidle' }); await page.screenshot({ path: '/tmp/tabitabi-home.png', fullPage: true }); await browser.close(); })(); EOF(Playwright のブラウザ実行ファイルが未インストールのためスクリーンショット取得不可)
  • ⚠️ git push(この環境の work ブランチに push 先 remote / upstream が設定されていないため失敗: fatal: No configured push destination.

View task →

@soranjiro soranjiro changed the title docs: add Google POI suggestion & place-structure implementation plan add Google POI suggestion & place-structure implementation plan May 17, 2026
@soranjiro soranjiro marked this pull request as ready for review May 17, 2026 14:27
@soranjiro
Copy link
Copy Markdown
Owner Author

/deploy-preview

@github-actions
Copy link
Copy Markdown

🚀 Preview Environment Ready

Your preview environment has been deployed:

The Web app is configured to access the preview API automatically.
To update this preview, comment /deploy-preview again.

Note: Preview environments share the same database as production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant