Files
resolutionflow/backend/app/models/beta_feedback.py
chihlasm 73c529d6f3 feat: beta feedback widget — frictionless in-session feedback
Full-stack beta feedback system:

Backend:
- BetaFeedback model with reaction, category, text, page context
- POST /feedback/beta (any auth user), GET /feedback/beta (admin, filtered)
- Alembic migration 065 with indexes on user_id, reaction, created_at

Frontend:
- Persistent "Feedback" tab on right edge of all authenticated pages
- Slide-out panel: quick reaction (👍😐👎), category pills, optional text
- Auto-captures page URL and FlowPilot session ID
- Hidden on mobile (<640px), closes on Escape/outside click
- Shows "Thanks!" confirmation then auto-closes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 13:12:06 +00:00

21 lines
1.1 KiB
Python

import uuid
from datetime import datetime, timezone
from typing import Optional
from sqlalchemy import String, Text, DateTime, ForeignKey, func
from sqlalchemy.orm import Mapped, mapped_column
from sqlalchemy.dialects.postgresql import UUID
from app.core.database import Base
class BetaFeedback(Base):
__tablename__ = "beta_feedback"
id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
user_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("users.id", ondelete="CASCADE"), nullable=False)
reaction: Mapped[str] = mapped_column(String(10), nullable=False) # 'positive', 'neutral', 'negative'
category: Mapped[Optional[str]] = mapped_column(String(30), nullable=True) # 'bug', 'feature', 'confusing', 'praise'
text: Mapped[Optional[str]] = mapped_column(Text, nullable=True)
page_url: Mapped[Optional[str]] = mapped_column(String(500), nullable=True)
session_id: Mapped[Optional[str]] = mapped_column(String(100), nullable=True) # FlowPilot session ID if applicable
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())