feat(feedback): add centralized feedback system with AI-generated titles

- Add shared-feedback-types package with TypeScript types
- Add shared-feedback-service package with factory function
- Add shared-feedback-ui package with Svelte 5 components
- Add feedback module to mana-core-auth backend
- Add AI service using Gemini 2.0 Flash for title/category generation
- Add database schema and migration for feedback tables
- Integrate feedback page into Chat web app
- Add CORS support for X-App-Id header
- Add COMMANDS.md documentation for all dev commands

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Till-JS 2025-11-29 22:46:37 +01:00
parent 05fe8ca5b6
commit 819e4c9a2f
41 changed files with 4290 additions and 338 deletions

View file

@ -0,0 +1,41 @@
/**
* API request/response types for feedback
*/
import type { Feedback, FeedbackCategory, FeedbackStatus } from './feedback';
export interface CreateFeedbackInput {
title?: string;
feedbackText: string;
category?: FeedbackCategory;
deviceInfo?: Record<string, unknown>;
}
export interface FeedbackQueryParams {
appId?: string;
status?: FeedbackStatus;
category?: FeedbackCategory;
sort?: 'votes' | 'recent';
limit?: number;
offset?: number;
}
export interface FeedbackResponse {
success: boolean;
feedback?: Feedback;
error?: string;
}
export interface FeedbackListResponse {
success: boolean;
items: Feedback[];
total: number;
error?: string;
}
export interface VoteResponse {
success: boolean;
newVoteCount: number;
userHasVoted: boolean;
error?: string;
}

View file

@ -0,0 +1,59 @@
/**
* Core feedback types
*/
export type FeedbackCategory = 'bug' | 'feature' | 'improvement' | 'question' | 'other';
export type FeedbackStatus =
| 'submitted'
| 'under_review'
| 'planned'
| 'in_progress'
| 'completed'
| 'declined';
export interface Feedback {
id: string;
userId: string;
appId: string;
title?: string;
feedbackText: string;
category: FeedbackCategory;
status: FeedbackStatus;
isPublic: boolean;
adminResponse?: string;
voteCount: number;
userHasVoted: boolean;
deviceInfo?: Record<string, unknown>;
createdAt: string;
updatedAt: string;
publishedAt?: string;
completedAt?: string;
}
export interface FeedbackVote {
id: string;
feedbackId: string;
userId: string;
createdAt: string;
}
export const FEEDBACK_CATEGORY_LABELS: Record<FeedbackCategory, string> = {
bug: 'Bug',
feature: 'Feature',
improvement: 'Verbesserung',
question: 'Frage',
other: 'Sonstiges',
};
export const FEEDBACK_STATUS_CONFIG: Record<
FeedbackStatus,
{ label: string; color: string; icon: string }
> = {
submitted: { label: 'Eingereicht', color: '#999', icon: 'clock' },
under_review: { label: 'Wird geprüft', color: '#3498DB', icon: 'eye' },
planned: { label: 'Geplant', color: '#9B59B6', icon: 'calendar' },
in_progress: { label: 'In Arbeit', color: '#F39C12', icon: 'loader' },
completed: { label: 'Umgesetzt', color: '#27AE60', icon: 'check-circle' },
declined: { label: 'Abgelehnt', color: '#E74C3C', icon: 'x-circle' },
};

View file

@ -0,0 +1,25 @@
/**
* Shared feedback types for Manacore monorepo
*
* This package contains TypeScript types for feedback submissions,
* voting, and API contracts.
*/
// Feedback types
export {
type FeedbackCategory,
type FeedbackStatus,
type Feedback,
type FeedbackVote,
FEEDBACK_CATEGORY_LABELS,
FEEDBACK_STATUS_CONFIG,
} from './feedback';
// API types
export {
type CreateFeedbackInput,
type FeedbackQueryParams,
type FeedbackResponse,
type FeedbackListResponse,
type VoteResponse,
} from './api';