Fix Garmin connect race, surface tool error content, add dev start scripts

- GarminConnection now flushes Profile's pending debounced autosave before
  connecting, avoiding a race where Connect fires with stale credentials.
- client.go reads res.Content before checking IsError so tool error
  messages actually include mcp-garmin's response text.
- seedsample: update kind lookups to match current taxonomy names
  ("Easy Run" -> "Easy", "Interval" -> "Intervals").
- Add backend/start.sh and frontend/start.sh dev launch scripts, and
  check in CLAUDE.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Christophe Vila
2026-07-21 18:33:49 +02:00
parent 518bccf5ab
commit 2fab788208
8 changed files with 155 additions and 63 deletions

View File

@@ -14,7 +14,7 @@ function syncProgressLabel(status: SyncStatus): string {
return "syncing...";
}
export function GarminConnection() {
export function GarminConnection({ onBeforeConnect }: { onBeforeConnect?: () => Promise<void> }) {
const [auth, setAuth] = useState<AuthResponse | null>(null);
const [code, setCode] = useState("");
const [busy, setBusy] = useState(false);
@@ -50,6 +50,7 @@ export function GarminConnection() {
setBusy(true);
setError(null);
try {
await onBeforeConnect?.();
setAuth(await api.login());
setDisconnected(false);
} catch (e) {