Recipe search settings section #83

Member

Maestro task: 0698ae2c-f65e-408e-a9c6-198edc2c5696 (Feature 11 - Settings Home and Admin AI Assistant).

Done-condition

The AI assistant screen gains a Recipe search card: provider segmented control (SearXNG | Brave); the SearXNG URL field or a Brave API key field (masked last4 + Replace, never echoed); a Test button calling the recipe-search test endpoint that shows "Found N recipes for 'chicken tikka masala'" or the error. Saving PATCHes /api/v1/settings/recipe-search. Vitest tests with stubbed APIs cover switching providers, saving, key masking and both test outcomes. Typecheck, test and build pass.

Evidence

  • New Recipe search card wired to GET/PATCH /api/v1/settings/recipe-search and POST /settings/recipe-search/test; reuses the Segmented control, TextInput, Sheet and Button primitives; the Brave key is masked (last4) and never echoed.
  • lint:colors, typecheck, test and build pass; gofmt -l . empty; headless Chrome at 390px with faked APIs exercised Test/Brave/Add key/Save with the full key never appearing.

Notes: the SearXNG field shows the URL saved in the DB (the server exposes no separate default URL; a real default would need a backend change). No Remove key for Brave because the server refuses Brave without a key. Not tested against the real server (needs Authentik login).

Maestro task: 0698ae2c-f65e-408e-a9c6-198edc2c5696 (Feature 11 - Settings Home and Admin AI Assistant). ## Done-condition The AI assistant screen gains a Recipe search card: provider segmented control (SearXNG | Brave); the SearXNG URL field or a Brave API key field (masked last4 + Replace, never echoed); a Test button calling the recipe-search test endpoint that shows "Found N recipes for 'chicken tikka masala'" or the error. Saving PATCHes /api/v1/settings/recipe-search. Vitest tests with stubbed APIs cover switching providers, saving, key masking and both test outcomes. Typecheck, test and build pass. ## Evidence - New Recipe search card wired to GET/PATCH /api/v1/settings/recipe-search and POST /settings/recipe-search/test; reuses the Segmented control, TextInput, Sheet and Button primitives; the Brave key is masked (last4) and never echoed. - lint:colors, typecheck, test and build pass; gofmt -l . empty; headless Chrome at 390px with faked APIs exercised Test/Brave/Add key/Save with the full key never appearing. Notes: the SearXNG field shows the URL saved in the DB (the server exposes no separate default URL; a real default would need a backend change). No Remove key for Brave because the server refuses Brave without a key. Not tested against the real server (needs Authentik login).
dev_agent added 1 commit 2026-10-06 10:30:18 -04:00
Recipe search card on the AI assistant screen
CI / ci (push) Successful in 2m1s
CI / ci (pull_request) Successful in 1m55s
cb42ffa280
Add a Recipe search card to /settings/ai: a SearXNG | Brave segmented
control, the SearXNG URL pre-filled from the saved settings, or the Brave
API key shown masked (last four characters) with Replace. The provider,
URL and new key are a draft saved together with PATCH
/api/v1/settings/recipe-search; Test calls the recipe-search test
endpoint and shows "Found N recipes for 'chicken tikka masala'" or the
error.

The leave-without-saving guard moves to page level so it covers both the
AI assistant form and the card; the shell test now renders in a data
router as main.tsx does.

Maestro task: 0698ae2c-f65e-408e-a9c6-198edc2c5696

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
overseer added 1 commit 2026-10-06 10:30:18 -04:00
Recipe search card on the AI assistant screen
CI / ci (push) Successful in 2m1s
CI / ci (pull_request) Successful in 1m55s
cb42ffa280
Add a Recipe search card to /settings/ai: a SearXNG | Brave segmented
control, the SearXNG URL pre-filled from the saved settings, or the Brave
API key shown masked (last four characters) with Replace. The provider,
URL and new key are a draft saved together with PATCH
/api/v1/settings/recipe-search; Test calls the recipe-search test
endpoint and shows "Found N recipes for 'chicken tikka masala'" or the
error.

The leave-without-saving guard moves to page level so it covers both the
AI assistant form and the card; the shell test now renders in a data
router as main.tsx does.

Maestro task: 0698ae2c-f65e-408e-a9c6-198edc2c5696

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent requested changes 2026-10-06 10:32:04 -04:00
Dismissed
review_agent left a comment
Member

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.
overseer added 1 commit 2026-10-06 10:43:19 -04:00
Pre-fill the SearXNG URL from the deployment default
CI / ci (push) Successful in 1m56s
CI / ci (pull_request) Successful in 2m3s
938b408deb
The service now reads the optional MEALQUEST_SEARXNG_URL, validates it at
startup like any SearXNG URL, and returns it in the recipe search settings
as the read-only default_base_url. base_url stays the saved URL only, and
PATCH is unchanged: nothing is stored until the household saves.

The recipe search card pre-fills the SearXNG URL from default_base_url
while no URL is saved, and an edit now clears the last Test result so a
stale count or error never sits beside "Save your changes to test them."

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent requested changes 2026-10-06 10:46:27 -04:00
Dismissed
review_agent left a comment
Member

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.
overseer added 1 commit 2026-10-06 10:53:34 -04:00
Count only real edits as unsaved recipe search changes
CI / ci (push) Successful in 1m57s
CI / ci (pull_request) Successful in 1m56s
271b52a7f4
Before recipe search is set up the card suggests SearXNG and the
deployment's URL, which differ from the unset saved values. That
suggestion marked the card dirty, so the leave guard warned about
unsaved changes the household never made. The leave guard now fires
only when the draft differs from the loaded baseline, which includes
the suggestion. Save stays enabled so the suggestion can still be
stored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent left a comment
Member

Independent Codex gpt-6-sol review: APPROVED for this exact commit.

Independent Codex gpt-6-sol review: APPROVED for this exact commit.
approver_agent merged commit d3839fd4a1 into feature/b28d9979-0f7a-4e81-bdff-2f16f3db2053-settings-admin-ai 2026-10-06 10:59:31 -04:00
Sign in to join this conversation.
No Reviewers
No labels
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/MealQuest#83