diff --git a/docs/plans/2026-02-18-feedback-form-design.md b/docs/plans/2026-02-18-feedback-form-design.md new file mode 100644 index 00000000..d59b6ea5 --- /dev/null +++ b/docs/plans/2026-02-18-feedback-form-design.md @@ -0,0 +1,117 @@ +# Feedback Form — Design Document + +> **Date:** 2026-02-18 + +## Overview + +A feedback form page where logged-in users can submit bug reports, feature requests, and general feedback. Submissions are emailed to a configurable address via the existing Resend infrastructure. No database storage. + +## Feedback Types + +1. Bug Report +2. Feature Request +3. Usability Issue +4. Documentation +5. General Feedback + +## Email Format + +**Subject:** +``` +[ResolutionFlow Feedback] Bug Report — 2026-02-18 — ACC-7X3K +``` + +Where `ACC-7X3K` is the user's account display code. + +**Body:** +``` +Feedback Type: Bug Report +Submitted By: engineer@example.com +Account: Contoso IT Services (ACC-7X3K) +Date: February 18, 2026 + +--- + +User's written feedback text goes here... +``` + +Reply-to is set to the submitter's email for direct replies. + +## Frontend + +### Page + +`FeedbackPage.tsx` — form page inside the app shell. + +### Access Points + +- Sidebar nav item (icon + "Feedback" label) — visible to all roles +- Link card on `AccountSettingsPage` + +### Route + +`/feedback` — top-level app shell route (not nested under `/account`). + +### Form Fields + +| Field | Details | +|-------|---------| +| Email | Auto-filled from logged-in user, editable | +| Feedback Type | Dropdown select (5 types) | +| Message | Textarea, required, min 10 chars | +| Submit | `bg-gradient-brand`, disabled while submitting | + +### UX Flow + +1. Form loads with email pre-filled +2. User selects type, writes message, submits +3. Button shows loading state during submission +4. On success: success message, form resets +5. On error: inline error, form stays populated for retry + +### Styling + +Standard page layout — `container mx-auto`, `bg-card border border-border rounded-xl` form card, `max-w-2xl` width. + +### API Client + +`feedbackApi.submitFeedback()` in a new `api/feedback.ts` module. + +## Backend + +### Endpoint + +`POST /feedback` in `endpoints/feedback.py` + +### Schema + +`FeedbackSubmission` in `schemas/feedback.py`: +- `email: str` — validated as email +- `feedback_type: str` — enum-validated against the 5 types +- `message: str` — min 10 chars + +### Auth + +Requires `get_current_active_user`. Account display code pulled from user's account relationship server-side. + +### Config + +`FEEDBACK_EMAIL: Optional[str] = None` in `config.py`. Endpoint returns 503 if not configured. + +### Email Service + +New `EmailService.send_feedback_email()` static method: +- Uses existing Resend client +- Sets `reply_to` to submitter's email +- Dark-themed HTML matching existing email templates + +### Rate Limiting + +One submission per minute per user. + +## Not Included (YAGNI) + +- No DB persistence +- No admin view +- No file attachments +- No public (unauthenticated) access