Admin AI assistant screen (mock 1o) #82

Member

Maestro task: a0847bb7-54d0-4244-ab15-f82500d0fa7f (Feature 11 - Settings Home and Admin AI Assistant).

Done-condition

/settings/ai renders mock 1o: back, kicker Settings - Admin, title AI assistant; Provider and Model pill dropdowns (2-col; model list from GET /settings/ai/models with a Type a model id option); API key row with the masked mono value from last4 and a Replace chip opening a Sheet with a password input that PUTs the key then verifies; Verified - date in teal-800 or the verify error; temperature slider 0-1 step 0.1 Familiar <-> Adventurous with the value right-aligned; mono system prompt textarea; Reset (confirm, calls reset-prompt) and Save changes; unsaved-changes guard. Vitest tests cover load, edit+save payload, replace-key flow, verify error display and reset. Typecheck, test and build pass.

Evidence

  • New /settings/ai screen wired to the AI settings API (GET/PATCH/PUT api-key/POST verify/models/reset-prompt); a new Select pill primitive; a Remove key action to switch provider while a key is stored (endpoint lock); a Base URL field for provider types without a fixed address; unsaved-changes guard.
  • The client only ever sees last4.
  • npm run lint:colors, typecheck, test and build pass; gofmt -l . empty.

Note: the masked value mirrors the API's last4; a fixed sk- prefix would be invented so it is not hard-coded.

Maestro task: a0847bb7-54d0-4244-ab15-f82500d0fa7f (Feature 11 - Settings Home and Admin AI Assistant). ## Done-condition /settings/ai renders mock 1o: back, kicker Settings - Admin, title AI assistant; Provider and Model pill dropdowns (2-col; model list from GET /settings/ai/models with a Type a model id option); API key row with the masked mono value from last4 and a Replace chip opening a Sheet with a password input that PUTs the key then verifies; Verified - date in teal-800 or the verify error; temperature slider 0-1 step 0.1 Familiar <-> Adventurous with the value right-aligned; mono system prompt textarea; Reset (confirm, calls reset-prompt) and Save changes; unsaved-changes guard. Vitest tests cover load, edit+save payload, replace-key flow, verify error display and reset. Typecheck, test and build pass. ## Evidence - New /settings/ai screen wired to the AI settings API (GET/PATCH/PUT api-key/POST verify/models/reset-prompt); a new Select pill primitive; a Remove key action to switch provider while a key is stored (endpoint lock); a Base URL field for provider types without a fixed address; unsaved-changes guard. - The client only ever sees last4. - npm run lint:colors, typecheck, test and build pass; gofmt -l . empty. Note: the masked value mirrors the API's last4; a fixed sk- prefix would be invented so it is not hard-coded.
dev_agent added 1 commit 2026-10-06 10:04:14 -04:00
Admin AI assistant screen (mock 1o)
CI / ci (push) Successful in 1m56s
CI / ci (pull_request) Successful in 1m56s
b0e31df099
/settings/ai edits the household's AI settings: Provider and Model pill
dropdowns (model list from GET /settings/ai/models plus "Type a model
id"), the API key as its masked last four with a Replace sheet that PUTs
the key then verifies it ("Verified · Oct 1" or the verify error), the
Creativity (temperature) slider, the mono system prompt, Reset (confirms,
then reset-prompt) and Save changes (PATCHes only the edited fields).
A 400 from the endpoint lock says to remove the key before switching
provider; the sheet's Remove key does that.

Unsaved changes are guarded on leaving: the app now runs under a data
router (createBrowserRouter) so the page can use useBlocker, plus
beforeunload for reloads and closing the tab.

Adds the Select pill-dropdown primitive. The test helper declaredStyle
skips pseudo-element rules, which jsdom cannot match.

Maestro task: a0847bb7-54d0-4244-ab15-f82500d0fa7f

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
overseer added 1 commit 2026-10-06 10:04:14 -04:00
Admin AI assistant screen (mock 1o)
CI / ci (push) Successful in 1m56s
CI / ci (pull_request) Successful in 1m56s
b0e31df099
/settings/ai edits the household's AI settings: Provider and Model pill
dropdowns (model list from GET /settings/ai/models plus "Type a model
id"), the API key as its masked last four with a Replace sheet that PUTs
the key then verifies it ("Verified · Oct 1" or the verify error), the
Creativity (temperature) slider, the mono system prompt, Reset (confirms,
then reset-prompt) and Save changes (PATCHes only the edited fields).
A 400 from the endpoint lock says to remove the key before switching
provider; the sheet's Remove key does that.

Unsaved changes are guarded on leaving: the app now runs under a data
router (createBrowserRouter) so the page can use useBlocker, plus
beforeunload for reloads and closing the tab.

Adds the Select pill-dropdown primitive. The test helper declaredStyle
skips pseudo-element rules, which jsdom cannot match.

Maestro task: a0847bb7-54d0-4244-ab15-f82500d0fa7f

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent requested changes 2026-10-06 10:07:58 -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:16:06 -04:00
Keep the stored-key removal path open and verify after sheet dismissal
CI / ci (push) Successful in 1m57s
CI / ci (pull_request) Successful in 1m58s
0403c9418f
- The API key row stays visible whenever a key is stored, Ollama included,
  and Replace (with Remove key) stays enabled after a provider or base URL
  change, so "remove the key first" can be followed without undoing it.
- One lock hint and one save-error guidance cover provider and base URL.
- Closing the key sheet no longer resets the store mutation, so the PUT's
  verify still runs; a store error after dismissal shows under the key.
- Reset and Save changes sit at the bottom of the screen (mock 1o).
- Tests: base URL lock guidance, recover by removing the key with Ollama
  chosen, and dismissing the sheet while the PUT is pending.

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 e9a35a7f57 into feature/b28d9979-0f7a-4e81-bdff-2f16f3db2053-settings-admin-ai 2026-10-06 10:22:08 -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#82