Show every settings home status line (mock 1p review fixes)
CI / ci (push) Successful in 1m55s
CI / ci (pull_request) Successful in 1m56s

The Regular dinners, Google Calendar and Notifications & Google Chat rows
now show status lines and read them from the server:

- Regular dinners: "N on rotation" from GET /api/v1/dinners?status=regular
  (Feature 12). Until that endpoint exists the server answers 404 and the
  row says "Rotation count unavailable"; no count is invented.
- Google Calendar: "Connected · <calendar name>" from
  GET /api/v1/settings/calendar (Feature 16). Until then a 404 shows the
  truthful "Not connected".
- Notifications & Google Chat: "Push on · <Google Chat space>" from
  GET /api/v1/settings/notifications. Until then a 404 shows
  "Push off · Google Chat not connected".

Only a 404 not_found counts as a missing endpoint; any other failure or a
malformed response shows in the error banner.

The AI assistant row names the model as the handoff does ("Anthropic ·
Claude Sonnet"), shows an unknown model by its id, and says "No model
chosen" for the seeded empty model instead of a trailing separator.

Maestro task: 97b50e29-b8a7-4e99-918d-99fa1b239313

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-06 09:35:51 -04:00
co-authored by Claude Opus 5.5
parent ef1bfcbf01
commit 04f12f52b9
5 changed files with 279 additions and 40 deletions
+7 -2
View File
@@ -2,10 +2,15 @@ import { QueryClientProvider } from '@tanstack/react-query'
import { useState, type ReactNode } from 'react'
import { ApiProvider, createApiClient, createQueryClient, createVerifiedSession } from '../api/index.ts'
import { createNetworkStatus } from '../pwa/networkStatus.ts'
import { fakeLocation, jsonResponse } from './fetchStub.ts'
import { errorResponse, fakeLocation, jsonResponse } from './fetchStub.ts'
// SETTINGS_API answers the settings home's requests, for stubFetchByPath.
// SETTINGS_API answers the settings home's requests, for stubFetchByPath, as
// today's server does: the dinners, Google Calendar and notifications status
// endpoints do not exist yet.
export const SETTINGS_API = {
'/api/v1/dinners?status=regular': () => errorResponse(404, 'not_found'),
'/api/v1/settings/calendar': () => errorResponse(404, 'not_found'),
'/api/v1/settings/notifications': () => errorResponse(404, 'not_found'),
'/api/v1/settings/household': () => jsonResponse(200, { timezone: 'America/New_York', dinner_time: '17:30' }),
'/api/v1/settings/ai': () => jsonResponse(200, { provider: 'anthropic', model: 'claude-sonnet-4-5' }),
}