Commit Graph
2 Commits
Author SHA1 Message Date
Renn F f2df7fc30b fix(prompter): align frontend API client with the backend session contract
The Prompter frontend and backend were built against mismatched contracts:
- createSession POSTed no body (the endpoint requires one) and read a
  `session_id` field the response doesn't have (it is `id`), so every session
  create returned 422.
- sendMessage hit `/sessions/{id}/chat` with `{message}` and expected a
  `{reply, draft}` object, but the session endpoint is `/sessions/{id}/messages`
  with `{content}` and returns the full message list.
- API errors rendered as "[object Object]" because getErrorMessage String()'d a
  FastAPI validation array.

Point createSession/sendMessage at the real endpoints, adapt the message-list
response (latest assistant message is the reply; fetch the structured draft when
the reply signals readiness), and make getErrorMessage format string /
validation-array / structured-object details into a readable line.
2026-06-08 16:17:41 +02:00
5a99140a55 [9ef46be7] feat(prompter): implement Prompter page, nav entry, chat UI, and task creation wiring (#78) (#79)
- Add Task Assistant nav entry (Sparkles icon) to sidebar between Kanban and Projects
- Create lib/api/prompter.ts with createSession, sendMessage, getDraft API functions
- Create hooks/use-prompter.ts with 6-state machine (empty→chatting→draft_preview→review_modal→launching→success)
- Create ChatMessages with auto-scroll, user/assistant/error rendering, inline DraftProposalCard
- Create ChatComposer with Enter-to-send and Shift+Enter for newline
- Create DraftProposalCard with title, description, acceptance criteria, metadata badges, Keep Chatting/Review & Confirm actions
- Create ConfirmDialog (Radix Dialog, no form element) with MarkdownEditor, AcceptanceCriteriaEditor, metadata selects, warning banner, disabled Confirm & Launch until valid
- Create SuccessCard with task title, team, View Task link, Start Another button
- Create /prompter route page composing all components via usePrompter hook
- TypeScript and ESLint pass with zero errors

Co-authored-by: Frontend Developer 2 <fe-dev-2@agents.roboco.dev>
2026-06-07 22:38:36 +02:00