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>
This commit is contained in:
43
backend/alembic/versions/065_add_beta_feedback_table.py
Normal file
43
backend/alembic/versions/065_add_beta_feedback_table.py
Normal file
@@ -0,0 +1,43 @@
|
||||
"""add beta_feedback table
|
||||
|
||||
Revision ID: 065
|
||||
Revises: 064
|
||||
Create Date: 2026-03-23 00:00:00.000000
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects.postgresql import UUID
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "065"
|
||||
down_revision: Union[str, None] = "064"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.create_table(
|
||||
"beta_feedback",
|
||||
sa.Column("id", UUID(as_uuid=True), primary_key=True),
|
||||
sa.Column("user_id", UUID(as_uuid=True), sa.ForeignKey("users.id", ondelete="CASCADE"), nullable=False),
|
||||
sa.Column("reaction", sa.String(10), nullable=False),
|
||||
sa.Column("category", sa.String(30), nullable=True),
|
||||
sa.Column("text", sa.Text, nullable=True),
|
||||
sa.Column("page_url", sa.String(500), nullable=True),
|
||||
sa.Column("session_id", sa.String(100), nullable=True),
|
||||
sa.Column("created_at", sa.DateTime(timezone=True), server_default=sa.func.now()),
|
||||
)
|
||||
op.create_index("ix_beta_feedback_user_id", "beta_feedback", ["user_id"])
|
||||
op.create_index("ix_beta_feedback_reaction", "beta_feedback", ["reaction"])
|
||||
op.create_index("ix_beta_feedback_created_at", "beta_feedback", ["created_at"])
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_index("ix_beta_feedback_created_at", table_name="beta_feedback")
|
||||
op.drop_index("ix_beta_feedback_reaction", table_name="beta_feedback")
|
||||
op.drop_index("ix_beta_feedback_user_id", table_name="beta_feedback")
|
||||
op.drop_table("beta_feedback")
|
||||
Reference in New Issue
Block a user