feat(admin): add NSFW flag to packs, remove intensity

Re-add is_explicit toggle on pack and dare pack forms labeled as
"NSFW". Show NSFW badge on pack cards and user enabled packs.

Remove all intensity/comfort level references from admin UI including
form fields, analytics charts, review dialog columns, AI generation
prompts/scoring, cherry-pick balancing, and settings toggles. The
database columns remain unchanged.
This commit is contained in:
jjbrunton committed 2026-01-27 22:50:46 +00:00
1 parent 14b0199625
commit e380c0a31c
32 files changed
+681 -808

No files matched your search

@@ -10,10 +10,9 @@ interface AIPolishButtonProps {
onPolished: (newText: string) => void;
className?: string;
disabled?: boolean;
explicit?: boolean;
}
export function AIPolishButton({ text, type, onPolished, className, disabled, explicit = false }: AIPolishButtonProps) {
export function AIPolishButton({ text, type, onPolished, className, disabled }: AIPolishButtonProps) {
const [loading, setLoading] = useState(false);
const handlePolish = async (e: React.MouseEvent) => {
@@ -25,7 +24,7 @@ export function AIPolishButton({ text, type, onPolished, className, disabled, ex
setLoading(true);
try {
const polished = await polishContent(text, type, explicit);
const polished = await polishContent(text, type, false);
onPolished(polished);
toast.success('Text polished!');
} catch (error) {
@@ -114,8 +114,6 @@ export function AiGeneratorDialog({
context={context}
config={generation.config}
onCountChange={generation.setCount}
onExplicitChange={generation.setExplicit}
onCrudeLangChange={generation.setCrudeLang}
onInspirationChange={generation.setInspiration}
/>
@@ -1,7 +1,6 @@
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Textarea } from '@/components/ui/textarea';
import { Switch } from '@/components/ui/switch';
import type { GeneratorType, GeneratorContext, GenerationConfig } from './hooks/useAiGeneration';
// =============================================================================
@@ -13,8 +12,6 @@ interface GenerationFormProps {
context?: GeneratorContext;
config: GenerationConfig;
onCountChange: (count: number) => void;
onExplicitChange: (isExplicit: boolean) => void;
onCrudeLangChange: (crudeLang: boolean) => void;
onInspirationChange: (inspiration: string) => void;
}
@@ -27,8 +24,6 @@ export function GenerationForm({
context,
config,
onCountChange,
onExplicitChange,
onCrudeLangChange,
onInspirationChange,
}: GenerationFormProps) {
return (
@@ -49,29 +44,6 @@ export function GenerationForm({
</div>
)}
{/* Explicit Toggle */}
<div className="flex items-center space-x-2">
<Switch
id="explicit-mode"
checked={config.isExplicit}
onCheckedChange={onExplicitChange}
/>
<Label htmlFor="explicit-mode">Explicit Content</Label>
</div>
{/* Crude Language Override Toggle */}
<div className="flex items-center space-x-2">
<Switch
id="crude-lang"
checked={config.crudeLang}
onCheckedChange={onCrudeLangChange}
/>
<Label htmlFor="crude-lang">Crude Language Override</Label>
<span className="text-xs text-muted-foreground">
(use "fuck", "suck cock" etc. instead of tasteful phrasing)
</span>
</div>
{/* Inspiration/Suggestions Textarea */}
<div className="space-y-2">
<Label htmlFor="inspiration">Inspiration / Suggestions (optional)</Label>
@@ -1,4 +1,4 @@
import { useState, useEffect, useCallback } from 'react';
import { useState, useCallback } from 'react';
import {
generatePack,
generateQuestionsWithCouncil,
@@ -32,13 +32,10 @@ export interface GeneratorContext {
existingCategories?: string[];
existingPacks?: string[];
existingQuestions?: string[];
isExplicit?: boolean;
}
export interface GenerationConfig {
count: number;
isExplicit: boolean;
crudeLang: boolean;
inspiration: string;
}
@@ -76,8 +73,6 @@ export function useAiGeneration(
// Config state
const [config, setConfig] = useState<GenerationConfig>({
count: 10,
isExplicit: Boolean(context?.isExplicit),
crudeLang: false,
inspiration: '',
});
@@ -117,27 +112,11 @@ export function useAiGeneration(
// Council config
const councilConfig = getCouncilConfig();
// Update explicit flag when context changes
useEffect(() => {
setConfig(prev => ({
...prev,
isExplicit: Boolean(context?.isExplicit),
}));
}, [context?.isExplicit, type]);
// Config setters
const setCount = useCallback((count: number) => {
setConfig(prev => ({ ...prev, count }));
}, []);
const setExplicit = useCallback((isExplicit: boolean) => {
setConfig(prev => ({ ...prev, isExplicit }));
}, []);
const setCrudeLang = useCallback((crudeLang: boolean) => {
setConfig(prev => ({ ...prev, crudeLang }));
}, []);
const setInspiration = useCallback((inspiration: string) => {
setConfig(prev => ({ ...prev, inspiration }));
}, []);
@@ -182,7 +161,7 @@ export function useAiGeneration(
const reset = useCallback(() => {
setResults({ pack: null, questions: [], categoryIdeas: [], packIdeas: [] });
setSelectedIndices(new Set());
setConfig(prev => ({ ...prev, crudeLang: false, inspiration: '' }));
setConfig(prev => ({ ...prev, inspiration: '' }));
setReviewState({
reviews: [],
summary: null,
@@ -216,7 +195,8 @@ export function useAiGeneration(
setFilter('all');
setSourceModel(null);
const isExplicit = config.isExplicit;
const isExplicit = false;
const crudeLang = false;
try {
if (type === 'pack') {
@@ -232,7 +212,7 @@ export function useAiGeneration(
const result = await generatePack(
context?.categoryName,
isExplicit,
config.crudeLang,
crudeLang,
config.inspiration || undefined,
avoidNames
);
@@ -249,11 +229,10 @@ export function useAiGeneration(
const result = await generateQuestionsWithCouncil(
context.packName,
config.count,
undefined,
isExplicit ? 5 : 2,
2,
context.packDescription || undefined,
context.existingQuestions,
config.crudeLang,
crudeLang,
config.inspiration || undefined,
setProgress
);
@@ -309,7 +288,7 @@ export function useAiGeneration(
const result = await suggestCategories(
context?.existingCategories || [],
isExplicit,
config.crudeLang,
crudeLang,
config.inspiration || undefined,
avoidNames
);
@@ -335,7 +314,7 @@ export function useAiGeneration(
context.categoryName,
context?.existingPacks || [],
isExplicit,
config.crudeLang,
crudeLang,
config.inspiration || undefined,
avoidNames
);
@@ -366,8 +345,6 @@ export function useAiGeneration(
// Config
config,
setCount,
setExplicit,
setCrudeLang,
setInspiration,
// Results
@@ -260,10 +260,10 @@ export function PackFormDialog({
</div>
)}
{/* Explicit Toggle */}
{/* NSFW Toggle */}
<div className="flex items-center justify-between">
<div className="space-y-0.5">
<Label>Explicit Content</Label>
<Label>NSFW</Label>
<p className="text-sm text-muted-foreground">
Contains adult or mature content
</p>
@@ -11,7 +11,7 @@ import { Button } from '@/components/ui/button';
import { Badge } from '@/components/ui/badge';
import { Checkbox } from '@/components/ui/checkbox';
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
import { Loader2, Sparkles, ArrowRight, Check, Wand2, ShieldCheck, Gauge, Trash2, Package } from 'lucide-react';
import { Loader2, Sparkles, ArrowRight, Check, Wand2, ShieldCheck, Trash2, Package } from 'lucide-react';
import {
analyzeQuestionText,
analyzeQuestionTargets,
@@ -51,7 +51,6 @@ interface ReviewQuestionsDialogProps {
open: boolean;
onOpenChange: (open: boolean) => void;
questions: Question[];
isExplicit?: boolean;
onUpdated: () => void;
}
@@ -64,14 +63,13 @@ interface CombinedSuggestion {
deleteSuggestion?: DeletionAnalysis;
}
export function ReviewQuestionsDialog({ open, onOpenChange, questions, isExplicit = false, onUpdated }: ReviewQuestionsDialogProps) {
export function ReviewQuestionsDialog({ open, onOpenChange, questions, onUpdated }: ReviewQuestionsDialogProps) {
const [analyzing, setAnalyzing] = useState(false);
const [suggestions, setSuggestions] = useState<CombinedSuggestion[]>([]);
const [existingProps, setExistingProps] = useState<string[]>([]);
const [selectedTextIds, setSelectedTextIds] = useState<Set<string>>(new Set());
const [selectedTargetIds, setSelectedTargetIds] = useState<Set<string>>(new Set());
const [selectedPropsIds, setSelectedPropsIds] = useState<Set<string>>(new Set());
const [selectedIntensityIds, setSelectedIntensityIds] = useState<Set<string>>(new Set());
const [selectedDeleteIds, setSelectedDeleteIds] = useState<Set<string>>(new Set());
const [step, setStep] = useState<'initial' | 'review'>('initial');
const [applying, setApplying] = useState(false);
@@ -134,10 +132,10 @@ export function ReviewQuestionsDialog({ open, onOpenChange, questions, isExplici
const [textResults, targetResults, deleteResults, propsResults] = await Promise.all([
analyzeQuestionText(
questions.map(q => ({ ...q, intensity: q.intensity })),
isExplicit
false
),
analyzeQuestionTargets(questions),
analyzeQuestionDeletions(questions, isExplicit),
analyzeQuestionDeletions(questions, false),
analyzeQuestionProps(
questions.map(q => ({
id: q.id,
@@ -192,10 +190,6 @@ export function ReviewQuestionsDialog({ open, onOpenChange, questions, isExplici
setSelectedTargetIds(new Set(meaningfulTargetResults.map(r => r.id)));
setSelectedPropsIds(new Set(meaningfulPropsResults.map(r => r.id)));
setSelectedDeleteIds(new Set(deleteResults.map(r => r.id)));
// Select intensity suggestions by default
setSelectedIntensityIds(new Set(
textResults.filter(r => r.suggested_intensity != null).map(r => r.id)
));
setStep('review');
} catch (error) {
console.error(error);
@@ -211,17 +205,15 @@ export function ReviewQuestionsDialog({ open, onOpenChange, questions, isExplici
const updates: { id: string; data: Record<string, unknown> }[] = [];
const deleteIds = Array.from(selectedDeleteIds);
// Build update objects combining text, target, and intensity changes
// Build update objects combining text, target, and props changes
suggestions.forEach(suggestion => {
if (selectedDeleteIds.has(suggestion.questionId)) return;
const textSelected = selectedTextIds.has(suggestion.questionId) && suggestion.textSuggestion;
const targetSelected = selectedTargetIds.has(suggestion.questionId) && suggestion.targetSuggestion;
const propsSelected = selectedPropsIds.has(suggestion.questionId) && suggestion.propsSuggestion;
const intensitySelected = selectedIntensityIds.has(suggestion.questionId) &&
suggestion.textSuggestion?.suggested_intensity != null;
if (textSelected || targetSelected || propsSelected || intensitySelected) {
if (textSelected || targetSelected || propsSelected) {
const updateData: Record<string, unknown> = {};
if (textSelected && suggestion.textSuggestion) {
@@ -247,10 +239,6 @@ export function ReviewQuestionsDialog({ open, onOpenChange, questions, isExplici
: null;
}
if (intensitySelected && suggestion.textSuggestion?.suggested_intensity != null) {
updateData.intensity = suggestion.textSuggestion.suggested_intensity;
}
if (Object.keys(updateData).length > 0) {
updates.push({ id: suggestion.questionId, data: updateData });
}
@@ -301,7 +289,6 @@ export function ReviewQuestionsDialog({ open, onOpenChange, questions, isExplici
setSelectedTextIds(new Set());
setSelectedTargetIds(new Set());
setSelectedPropsIds(new Set());
setSelectedIntensityIds(new Set());
setSelectedDeleteIds(new Set());
}, 300);
};
@@ -327,13 +314,6 @@ export function ReviewQuestionsDialog({ open, onOpenChange, questions, isExplici
setSelectedPropsIds(next);
};
const toggleIntensitySelection = (id: string) => {
const next = new Set(selectedIntensityIds);
if (next.has(id)) next.delete(id);
else next.add(id);
setSelectedIntensityIds(next);
};
const toggleDeleteSelection = (id: string) => {
const next = new Set(selectedDeleteIds);
if (next.has(id)) next.delete(id);
@@ -387,14 +367,12 @@ export function ReviewQuestionsDialog({ open, onOpenChange, questions, isExplici
const textSuggestionCount = suggestions.filter(s => s.textSuggestion).length;
const targetSuggestionCount = suggestions.filter(s => s.targetSuggestion).length;
const propsSuggestionCount = suggestions.filter(s => s.propsSuggestion).length;
const intensitySuggestionCount = suggestions.filter(s => s.textSuggestion?.suggested_intensity != null).length;
const deleteSuggestionCount = suggestions.filter(s => s.deleteSuggestion).length;
const effectiveTextCount = Array.from(selectedTextIds).filter(id => !selectedDeleteIds.has(id)).length;
const effectiveTargetCount = Array.from(selectedTargetIds).filter(id => !selectedDeleteIds.has(id)).length;
const effectivePropsCount = Array.from(selectedPropsIds).filter(id => !selectedDeleteIds.has(id)).length;
const effectiveIntensityCount = Array.from(selectedIntensityIds).filter(id => !selectedDeleteIds.has(id)).length;
const totalSelectedCount = effectiveTextCount + effectiveTargetCount + effectivePropsCount + effectiveIntensityCount + selectedDeleteIds.size;
const hasSuggestions = textSuggestionCount > 0 || targetSuggestionCount > 0 || propsSuggestionCount > 0 || intensitySuggestionCount > 0 || deleteSuggestionCount > 0;
const totalSelectedCount = effectiveTextCount + effectiveTargetCount + effectivePropsCount + selectedDeleteIds.size;
const hasSuggestions = textSuggestionCount > 0 || targetSuggestionCount > 0 || propsSuggestionCount > 0 || deleteSuggestionCount > 0;
// Select all/none helpers
const selectAllText = () => setSelectedTextIds(new Set(suggestions.filter(s => s.textSuggestion).map(s => s.questionId)));
@@ -403,24 +381,18 @@ export function ReviewQuestionsDialog({ open, onOpenChange, questions, isExplici
const selectNoneTargets = () => setSelectedTargetIds(new Set());
const selectAllProps = () => setSelectedPropsIds(new Set(suggestions.filter(s => s.propsSuggestion).map(s => s.questionId)));
const selectNoneProps = () => setSelectedPropsIds(new Set());
const selectAllIntensity = () => setSelectedIntensityIds(new Set(
suggestions.filter(s => s.textSuggestion?.suggested_intensity != null).map(s => s.questionId)
));
const selectNoneIntensity = () => setSelectedIntensityIds(new Set());
const selectAllDeletes = () => setSelectedDeleteIds(new Set(suggestions.filter(s => s.deleteSuggestion).map(s => s.questionId)));
const selectNoneDeletes = () => setSelectedDeleteIds(new Set());
const selectAll = () => {
selectAllText();
selectAllTargets();
selectAllProps();
selectAllIntensity();
selectAllDeletes();
};
const selectNone = () => {
selectNoneText();
selectNoneTargets();
selectNoneProps();
selectNoneIntensity();
selectNoneDeletes();
};
@@ -462,10 +434,6 @@ export function ReviewQuestionsDialog({ open, onOpenChange, questions, isExplici
<Package className="h-5 w-5 text-cyan-400" />
<span className="text-sm font-medium text-cyan-300">Required Props</span>
</div>
<div className="flex items-center gap-2 bg-amber-500/20 px-4 py-2 rounded-lg">
<Gauge className="h-5 w-5 text-amber-400" />
<span className="text-sm font-medium text-amber-300">Intensity Level</span>
</div>
<div className="flex items-center gap-2 bg-rose-500/20 px-4 py-2 rounded-lg">
<Trash2 className="h-5 w-5 text-rose-400" />
<span className="text-sm font-medium text-rose-300">Deletion Suggestions</span>
@@ -506,10 +474,6 @@ export function ReviewQuestionsDialog({ open, onOpenChange, questions, isExplici
<Package className="h-4 w-4 text-cyan-500" />
{propsSuggestionCount} props fixes
</span>
<span className="flex items-center gap-1">
<Gauge className="h-4 w-4 text-amber-500" />
{intensitySuggestionCount} intensity fixes
</span>
<span className="flex items-center gap-1">
<Trash2 className="h-4 w-4 text-rose-500" />
{deleteSuggestionCount} delete suggestions
@@ -572,22 +536,6 @@ export function ReviewQuestionsDialog({ open, onOpenChange, questions, isExplici
</Button>
</div>
</TableHead>
<TableHead className="w-[10%]">
<div className="flex items-center gap-2">
<Gauge className="h-4 w-4 text-amber-500" />
Intensity
{intensitySuggestionCount > 0 && (
<Button
variant="ghost"
size="sm"
className="h-6 px-2 text-xs"
onClick={() => selectedIntensityIds.size === intensitySuggestionCount ? selectNoneIntensity() : selectAllIntensity()}
>
{selectedIntensityIds.size === intensitySuggestionCount ? 'None' : 'All'}
</Button>
)}
</div>
</TableHead>
<TableHead className="w-[10%]">
<div className="flex items-center gap-2">
<Trash2 className="h-4 w-4 text-rose-500" />
@@ -757,50 +705,6 @@ export function ReviewQuestionsDialog({ open, onOpenChange, questions, isExplici
)}
</TableCell>
{/* Intensity Column */}
<TableCell className="align-top py-3">
<div className="flex items-center gap-2 mb-1">
<Badge variant="outline" className="text-xs">
Current: {suggestion.question.intensity}
</Badge>
</div>
{suggestion.textSuggestion?.suggested_intensity != null ? (
<div
className={`p-2 rounded-lg border cursor-pointer transition-colors ${selectedIntensityIds.has(suggestion.questionId)
? 'bg-amber-500/20 border-amber-500/50'
: 'bg-muted/30 border-transparent hover:bg-muted/50'
}`}
onClick={() => toggleIntensitySelection(suggestion.questionId)}
>
<div className="flex items-start gap-2">
<Checkbox
checked={selectedIntensityIds.has(suggestion.questionId)}
onCheckedChange={() => toggleIntensitySelection(suggestion.questionId)}
className="mt-0.5"
/>
<div className="flex-1 min-w-0">
<div className="flex items-center gap-2">
<ArrowRight className="h-3 w-3 text-muted-foreground" />
<Badge className="text-xs bg-amber-500/30 text-amber-300 hover:bg-amber-500/30">
{suggestion.textSuggestion.suggested_intensity}
</Badge>
</div>
{suggestion.textSuggestion.intensity_reason && (
<div className="text-xs text-muted-foreground mt-1">
{suggestion.textSuggestion.intensity_reason}
</div>
)}
</div>
</div>
</div>
) : (
<div className="text-xs text-muted-foreground">
<Check className="h-4 w-4 text-green-500 inline mr-1" />
Correct
</div>
)}
</TableCell>
{/* Delete Column */}
<TableCell className="align-top py-3">
{suggestion.deleteSuggestion ? (
@@ -146,26 +146,26 @@ export function Breadcrumbs() {
if (breadcrumbs.length === 0 && !loading) return null;
return (
<nav className="flex items-center space-x-1 text-sm">
<nav className="flex items-center gap-1 text-sm overflow-x-auto whitespace-nowrap max-w-full pr-2">
<Link
to="/"
className="flex items-center text-muted-foreground hover:text-primary transition-colors p-1 rounded-md hover:bg-white/5"
className="flex items-center text-muted-foreground hover:text-primary transition-colors p-1 rounded-md hover:bg-white/5 flex-shrink-0"
>
<Home className="h-4 w-4" />
</Link>
{breadcrumbs.map((item, index) => (
<div key={index} className="flex items-center">
<div key={index} className="flex items-center flex-shrink-0">
<ChevronRight className="h-4 w-4 mx-1 text-muted-foreground/50" />
{item.href ? (
<Link
to={item.href}
className="text-muted-foreground hover:text-primary transition-colors px-2 py-1 rounded-md hover:bg-white/5"
className="text-muted-foreground hover:text-primary transition-colors px-2 py-1 rounded-md hover:bg-white/5 max-w-[160px] truncate"
>
{item.label}
</Link>
) : (
<span className="text-foreground font-medium px-2 py-1">
<span className="text-foreground font-medium px-2 py-1 max-w-[180px] truncate">
{item.label}
</span>
)}
+1 -1
View File
@@ -11,7 +11,7 @@ const TabsList = React.forwardRef<
<TabsPrimitive.List
ref={ref}
className={cn(
"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
"flex w-full flex-wrap items-center justify-start gap-1 rounded-md bg-muted p-1 text-muted-foreground sm:inline-flex sm:w-auto sm:flex-nowrap sm:justify-center",
className
)}
{...props}
+3 -17
View File
@@ -10,7 +10,7 @@ import type { TextAnalysis } from '../types';
* Analyze question text and suggest improvements
*/
export async function analyzeQuestionText(
questions: { id: string; text: string; partner_text?: string | null; intensity?: number }[],
questions: { id: string; text: string; partner_text?: string | null }[],
isExplicit: boolean = false
): Promise<TextAnalysis[]> {
const openai = getOpenAI();
@@ -19,7 +19,6 @@ export async function analyzeQuestionText(
id: q.id,
text: q.text,
partner_text: q.partner_text,
intensity: q.intensity,
}));
const toneInstruction = isExplicit
@@ -83,17 +82,6 @@ Cards should be "Proposals" for specific actions, NOT interview questions.
8. Skip questions that are ALREADY well-phrased
</rules>
<intensity_guide>
Check if current intensity matches the activity:
1 (Gentle): Emotional bonding, non-sexual (cooking, cuddling, foot massage)
2 (Warm): Romantic, affectionate touch (slow dance, sensual massage, kissing)
3 (Playful): Light sexual exploration (oral, mutual masturbation, light roleplay)
4 (Steamy): Explicit sex, moderate adventure (intercourse, light bondage, anal play)
5 (Intense): Advanced/BDSM/extreme (impact play, power dynamics, taboo kinks)
If intensity seems wrong, include suggested_intensity and intensity_reason.
</intensity_guide>
<questions_to_analyze>
${JSON.stringify(simplifiedQuestions)}
</questions_to_analyze>
@@ -105,14 +93,12 @@ ${JSON.stringify(simplifiedQuestions)}
"id": string, // Question ID
"suggested_text": string, // Improved text (short, direct)
"suggested_partner_text": string|null, // Improved partner_text or null if symmetric
"reason": string, // Brief explanation of text improvement
"suggested_intensity": number|null, // 1-5 if intensity seems wrong, null if correct
"intensity_reason": string|null // Why intensity should change (if applicable)
"reason": string // Brief explanation of text improvement
}
]
}
Only include questions that need text improvement OR intensity adjustment.
Only include questions that need text improvement.
</output_format>`;
const systemMessage = isExplicit
+5 -75
View File
@@ -1,6 +1,6 @@
// =============================================================================
// AI Configuration Constants
// Council config, tone levels, intensity levels, and prompt guides
// Council config, tone levels, and prompt guides
// =============================================================================
import { getCachedAiConfig, preloadAiConfig, type AiConfig } from '@/hooks/useAiConfig';
@@ -33,7 +33,6 @@ export function getCouncilConfig(): CouncilConfig {
reviewerModel: remoteConfig.council_reviewer_model || 'google/gemini-pro-1.5',
reviewerTemperature: remoteConfig.council_reviewer_temperature ?? 0.3,
selectionMode: remoteConfig.council_selection_mode || 'whole_set',
cherryPickEnsureIntensityDistribution: remoteConfig.cherry_pick_ensure_intensity_distribution ?? true,
};
}
@@ -44,7 +43,6 @@ export function getCouncilConfig(): CouncilConfig {
reviewerModel: import.meta.env.VITE_COUNCIL_REVIEWER_MODEL || 'google/gemini-pro-1.5',
reviewerTemperature: 0.3,
selectionMode: 'whole_set',
cherryPickEnsureIntensityDistribution: true,
};
}
@@ -69,67 +67,6 @@ export const TONE_LEVELS = [
{ level: 5, label: 'Intense', description: 'Advanced/BDSM/Extreme exploration' },
] as const;
// =============================================================================
// INTENSITY LEVELS
// For UI display - consistent with AI grading
// =============================================================================
export const INTENSITY_LEVELS = [
{ level: 1, label: 'Gentle', description: 'Pure emotional connection & non-sexual bonding', color: 'bg-green-500' },
{ level: 2, label: 'Warm', description: 'Romantic atmosphere & affectionate touch', color: 'bg-lime-500' },
{ level: 3, label: 'Playful', description: 'Light sexual exploration & sensual discovery', color: 'bg-yellow-500' },
{ level: 4, label: 'Steamy', description: 'Explicit sexual activities & moderate adventure', color: 'bg-orange-500' },
{ level: 5, label: 'Intense', description: 'Advanced/BDSM/Extreme exploration', color: 'bg-red-500' },
] as const;
// =============================================================================
// INTENSITY GRADING GUIDE
// Full version for detailed AI prompts
// =============================================================================
export const INTENSITY_GUIDE = `
INTENSITY GRADING GUIDE - Use this to assign intensity levels consistently:
Level 1 - GENTLE (Pure emotional connection & non-sexual bonding):
- Focus: Emotional safety, friendship-based activities, quality time
- Examples: Cook together, take a walk holding hands, give non-sexual foot massages, watch a movie cuddling
- Emotional bonding without sexual undertones
Level 2 - WARM (Romantic atmosphere & affectionate touch):
- Focus: Creating romantic moments, sensual but non-sexual touch, building anticipation
- Examples: Slow dance in the living room, candlelit bath together (non-sexual), extended kissing sessions, sensual massage with oils
- Romantic intimacy building up to arousal
Level 3 - PLAYFUL (Light sexual exploration & sensual discovery):
- Focus: Sexual touch without penetration, playful experimentation, building arousal
- Examples: Mutual masturbation, oral sex, light roleplay (doctor/patient), using basic toys together
- Fun and exploratory sexual contact
Level 4 - STEAMY (Explicit sexual activities & moderate adventure):
- Focus: Full sexual intercourse with adventurous elements, moderate BDSM/kink
- Examples: Sex in different locations/positions, light bondage, anal play with toys, recording consensual intimate moments
- Passionate and adventurous sexual connection
Level 5 - INTENSE (Advanced/BDSM/Extreme exploration):
- Focus: Edge play, power dynamics, intense physical experiences
- Examples: Heavy impact play, advanced bondage, consensual non-consent scenes, multi-partner activities
- Very intense, taboo kinks, and extreme exploration
`;
// =============================================================================
// INTENSITY GUIDE (SHORT)
// Condensed version for prompts to save tokens
// =============================================================================
export const INTENSITY_GUIDE_SHORT = `
INTENSITY LEVELS:
1 (Gentle): Pure emotional connection, non-sexual bonding (cooking, cuddling, foot massages)
2 (Warm): Romantic atmosphere, affectionate touch (slow dance, sensual massage, kissing)
3 (Playful): Light sexual exploration, sensual discovery (oral, mutual masturbation, light roleplay)
4 (Steamy): Explicit sexual activities, moderate adventure (sex positions, light bondage, anal play)
5 (Intense): Advanced/BDSM/Extreme exploration (impact play, power dynamics, taboo kinks)
`;
// =============================================================================
// REVIEW GUIDELINES
// Used by council reviewer for quality assessment
@@ -155,32 +92,25 @@ REVIEW CRITERIA - Score each 1-10:
- Partner text (if present) clearly describes receiver's experience
- No confusing or ambiguous phrasing
4. INTENSITY ACCURACY:
Level 1 (Gentle): Pure emotional connection, non-sexual bonding
Level 2 (Warm): Romantic atmosphere, affectionate touch
Level 3 (Playful): Light sexual exploration, sensual discovery (oral, toys)
Level 4 (Steamy): Explicit sexual activities, moderate adventure (intercourse, light bondage)
Level 5 (Intense): Advanced/BDSM/Extreme exploration (impact play, power dynamics)
5. ANATOMICAL CONSISTENCY:
4. ANATOMICAL CONSISTENCY:
- No mixed male/female anatomy in alternatives
- BAD: "Finger or give your partner a handjob"
- GOOD: Pick one activity
6. PARTNER TEXT QUALITY (if applicable):
5. PARTNER TEXT QUALITY (if applicable):
- Engaging and enticing, not clinical
- BAD: "Receive oral from your partner"
- GOOD: "Let your partner pleasure you with their mouth"
- When initiator causes a response, frame as allowing: "Let your partner make you moan"
7. COUPLE TARGETING (flag if incorrect):
6. COUPLE TARGETING (flag if incorrect):
- Default: ALL couples (null) unless explicit anatomical requirement
- Restrict to ['male+male', 'female+male'] ONLY if activity requires penis
- Restrict to ['female+male', 'female+female'] ONLY if activity requires vagina
- Sex toys are GENDER-NEUTRAL (vibrators, dildos, plugs work for anyone)
- Flag if targeting seems too restrictive or missing needed restrictions
8. INITIATOR TARGETING (for asymmetric questions only):
7. INITIATOR TARGETING (for asymmetric questions only):
- Default: null (anyone can initiate) unless explicit anatomical requirement
- Set initiator based on WHO DOES the action in "text" field
- "Swallow your partner's cum" -> initiator: female (in M+F, receiver of cum)
+14 -79
View File
@@ -14,7 +14,6 @@ import type {
PooledQuestion,
CherryPickEvaluation,
CherryPickResult,
CouncilConfig,
} from '../types';
/**
@@ -34,7 +33,6 @@ export async function evaluateQuestionPool(
index: i,
text: q.text,
partner_text: q.partner_text || null,
intensity: q.intensity,
generatorIndex: q.sourceGeneratorIndex,
}));
@@ -69,11 +67,10 @@ ${REVIEW_GUIDELINES}
<scoring_weights>
Your scores will be weighted as follows for final selection:
- Guideline Compliance: 25%
- Creativity: 20%
- Clarity: 20%
- Guideline Compliance: 30%
- Creativity: 25%
- Clarity: 25%
- Uniqueness: 20%
- Intensity Accuracy: 15%
Calibrate your scores knowing these weights. A low compliance score has the most impact.
</scoring_weights>
@@ -86,8 +83,7 @@ Two questions are duplicates if they:
For duplicates, mark the WORSE version as duplicate and keep the version with:
1. Better phrasing/creativity
2. More appropriate intensity grading
3. Better partner_text (if applicable)
2. Better partner_text (if applicable)
</duplicate_detection>
<verdict_rules>
@@ -110,7 +106,6 @@ ${JSON.stringify(questionsForEval, null, 2)}
"guidelineCompliance": 1-10,
"creativity": 1-10,
"clarity": 1-10,
"intensityAccuracy": 1-10,
"uniqueness": 1-10
},
"isDuplicate": boolean,
@@ -151,16 +146,12 @@ Evaluate ALL ${pooledQuestions.length} questions.
}
/**
* Select top N questions from evaluations, optionally balancing intensity levels
* Select top N questions from evaluations
*/
export function selectTopQuestions(
pooledQuestions: PooledQuestion[],
evaluations: CherryPickEvaluation[],
requestedCount: number,
options: {
ensureIntensityDistribution: boolean;
requestedIntensity?: number;
}
requestedCount: number
): CherryPickResult {
// Step 1: Filter out duplicates (keep only the original, not the duplicate)
const duplicateIndices = new Set<number>();
@@ -178,74 +169,25 @@ export function selectTopQuestions(
question: pooledQuestions[e.questionIndex],
// Weighted overall score
weightedScore: (
(e.scores.guidelineCompliance * 0.25) +
(e.scores.creativity * 0.20) +
(e.scores.clarity * 0.20) +
(e.scores.intensityAccuracy * 0.15) +
(e.scores.guidelineCompliance * 0.30) +
(e.scores.creativity * 0.25) +
(e.scores.clarity * 0.25) +
(e.scores.uniqueness * 0.20)
) * 10,
}))
.sort((a, b) => b.weightedScore - a.weightedScore);
let selected: typeof scoredQuestions = [];
// Step 3: Select questions
if (options.requestedIntensity) {
// If specific intensity requested, just take top N of that intensity
const matchingIntensity = scoredQuestions.filter(
sq => sq.question.intensity === options.requestedIntensity
);
selected = matchingIntensity.slice(0, requestedCount);
} else if (options.ensureIntensityDistribution) {
// Balance across intensity levels
const perIntensity = Math.ceil(requestedCount / 5);
const byIntensity: Record<number, typeof scoredQuestions> = { 1: [], 2: [], 3: [], 4: [], 5: [] };
for (const sq of scoredQuestions) {
const intensity = sq.question.intensity;
if (intensity >= 1 && intensity <= 5) {
byIntensity[intensity].push(sq);
}
}
// Take top N from each intensity level
for (let intensity = 1; intensity <= 5; intensity++) {
const toTake = byIntensity[intensity].slice(0, perIntensity);
selected.push(...toTake);
}
// If we still need more, fill from remaining top-scored questions
if (selected.length < requestedCount) {
const selectedIndices = new Set(selected.map(s => s.evaluation.questionIndex));
const remaining = scoredQuestions.filter(
sq => !selectedIndices.has(sq.evaluation.questionIndex)
);
selected.push(...remaining.slice(0, requestedCount - selected.length));
}
// Sort final selection by score
selected.sort((a, b) => b.weightedScore - a.weightedScore);
selected = selected.slice(0, requestedCount);
} else {
// Simple top N by score
selected = scoredQuestions.slice(0, requestedCount);
}
// Step 3: Select top N by score
const selected = scoredQuestions.slice(0, requestedCount);
// Step 4: Build result
const selectedQuestions = selected.map(s => s.question);
// Calculate intensity distribution
const intensityDistribution: Record<number, number> = {};
for (const q of selectedQuestions) {
intensityDistribution[q.intensity] = (intensityDistribution[q.intensity] || 0) + 1;
}
return {
selectedQuestions,
evaluations,
poolSize: pooledQuestions.length,
duplicatesRemoved: duplicateIndices.size,
intensityDistribution,
};
}
@@ -255,8 +197,7 @@ export function selectTopQuestions(
export async function performCherryPickSelection(
candidates: GenerationCandidate[],
packContext: { name: string; description?: string | null; isExplicit: boolean; tone: ToneLevel },
requestedCount: number,
config: CouncilConfig
requestedCount: number
): Promise<{
questions: GeneratedQuestion[];
reviews: QuestionReview[];
@@ -280,10 +221,7 @@ export async function performCherryPickSelection(
const evaluations = await evaluateQuestionPool(pooledQuestions, packContext, requestedCount);
// Step 3: Select top questions
const cherryPickResult = selectTopQuestions(pooledQuestions, evaluations, requestedCount, {
ensureIntensityDistribution: config.cherryPickEnsureIntensityDistribution,
requestedIntensity: undefined,
});
const cherryPickResult = selectTopQuestions(pooledQuestions, evaluations, requestedCount);
// Step 4: Convert to standard review format for UI compatibility
const reviews: QuestionReview[] = cherryPickResult.selectedQuestions.map((q, i) => {
@@ -302,7 +240,6 @@ export async function performCherryPickSelection(
guidelineCompliance: 7,
creativity: 7,
clarity: 7,
intensityAccuracy: 7,
anatomicalConsistency: 10,
partnerTextQuality: 10,
coupleTargeting: 10,
@@ -324,7 +261,6 @@ export async function performCherryPickSelection(
guidelineCompliance: evaluation.scores.guidelineCompliance,
creativity: evaluation.scores.creativity,
clarity: evaluation.scores.clarity,
intensityAccuracy: evaluation.scores.intensityAccuracy,
// Cherry-pick doesn't evaluate these, default to passing
anatomicalConsistency: 10,
partnerTextQuality: 10,
@@ -346,8 +282,7 @@ export async function performCherryPickSelection(
totalScore += review.scores.guidelineCompliance || 0;
totalScore += review.scores.creativity || 0;
totalScore += review.scores.clarity || 0;
totalScore += review.scores.intensityAccuracy || 0;
scoreCount += 4;
scoreCount += 3;
}
}
const overallQuality = scoreCount > 0 ? Math.round((totalScore / scoreCount) * 10) / 10 : 0;
+1 -5
View File
@@ -24,7 +24,6 @@ import type {
export async function generateQuestionsWithCouncil(
packName: string,
count: number = 10,
intensity?: number,
tone: ToneLevel = 3,
packDescription?: string,
existingQuestions?: string[],
@@ -90,7 +89,6 @@ export async function generateQuestionsWithCouncil(
const questions = await generateQuestions(
packName,
count,
intensity,
tone,
packDescription,
existingQuestions,
@@ -138,7 +136,6 @@ export async function generateQuestionsWithCouncil(
gen.model,
packName,
count,
intensity,
tone,
packDescription,
existingQuestions,
@@ -191,8 +188,7 @@ export async function generateQuestionsWithCouncil(
const cherryPickResult = await performCherryPickSelection(
successfulCandidates,
packContext,
count,
config
count
);
const reviewTime = Date.now() - startReview;
+2 -19
View File
@@ -1,10 +1,10 @@
// =============================================================================
// Question Generation Functions
// Generate questions for packs with various tone/intensity settings
// Generate questions for packs with various tone settings
// =============================================================================
import { getOpenAI, getModel, getTemperature } from '../client';
import { INTENSITY_GUIDE_SHORT, TONE_INSTRUCTIONS, SYSTEM_MESSAGES, CORE_LANGUAGE_RULES } from '../config';
import { TONE_INSTRUCTIONS, SYSTEM_MESSAGES, CORE_LANGUAGE_RULES } from '../config';
import type { GeneratedQuestion, ToneLevel } from '../types';
/**
@@ -13,7 +13,6 @@ import type { GeneratedQuestion, ToneLevel } from '../types';
function buildQuestionPrompt(
packName: string,
count: number,
intensity: number | undefined,
tone: ToneLevel,
packDescription?: string,
existingQuestions?: string[],
@@ -38,12 +37,6 @@ function buildQuestionPrompt(
? `\n\n<user_guidance>\n${sanitizedInspiration}\n</user_guidance>\n\nIncorporate the user guidance above into your generation where appropriate. Use it to inform the theme and style of questions.`
: '';
const intensityInstruction = tone === 1
? 'All questions should be intensity level 1 (non-sexual bonding).'
: intensity
? `All questions should be at intensity level ${intensity}.`
: 'Vary the intensity levels appropriate for the tone.';
const toneInstruction = TONE_INSTRUCTIONS[tone];
// Examples based on tone level
@@ -90,12 +83,7 @@ Generate ${count} unique questions for a couples' intimacy question pack called
</task>
${descriptionContext}${inspirationInstruction}${existingQuestionsContext}
<intensity_guide>
${INTENSITY_GUIDE_SHORT}
</intensity_guide>
<instructions>
${intensityInstruction}
${toneInstruction}${explicitWarning}${crudeLangInstruction}
</instructions>
@@ -147,7 +135,6 @@ Return a JSON object with this exact structure:
{
"text": string, // REQUIRED: 5-12 words, doer's perspective using "your partner"
"partner_text": string|null, // REQUIRED for asymmetric, null for symmetric
"intensity": 1-5, // REQUIRED: must match the intensity level guidelines
"requires_props": string[]|null, // Optional: items needed (e.g., ["blindfold", "massage oil"])
"inverse_pair_id": string|null, // REQUIRED for asymmetric pairs, null for symmetric
"location_type": "home"|"public"|"outdoors"|"travel"|"anywhere", // Optional
@@ -164,7 +151,6 @@ Return a JSON object with this exact structure:
export async function generateQuestions(
packName: string,
count: number = 10,
intensity?: number,
tone: ToneLevel = 3,
packDescription?: string,
existingQuestions?: string[],
@@ -176,7 +162,6 @@ export async function generateQuestions(
const prompt = buildQuestionPrompt(
packName,
count,
intensity,
tone,
packDescription,
existingQuestions,
@@ -212,7 +197,6 @@ export async function generateQuestionsWithModel(
model: string,
packName: string,
count: number,
intensity: number | undefined,
tone: ToneLevel,
packDescription: string | undefined,
existingQuestions: string[] | undefined,
@@ -225,7 +209,6 @@ export async function generateQuestionsWithModel(
const prompt = buildQuestionPrompt(
packName,
count,
intensity,
tone,
packDescription,
existingQuestions,
-3
View File
@@ -41,9 +41,6 @@ export {
getCouncilConfig,
initializeAiConfig,
TONE_LEVELS,
INTENSITY_LEVELS,
INTENSITY_GUIDE,
INTENSITY_GUIDE_SHORT,
REVIEW_GUIDELINES,
TONE_INSTRUCTIONS,
SYSTEM_MESSAGES,
+23 -32
View File
@@ -36,7 +36,6 @@ export async function reviewGeneratedQuestions(
index: i,
text: q.text,
partner_text: q.partner_text || null,
intensity: q.intensity,
location_type: q.location_type,
effort_level: q.effort_level,
// Include targeting for review (may not always be present)
@@ -64,7 +63,7 @@ ${REVIEW_GUIDELINES}
<verdict_rules>
- PASS: All scores >= 7, no major issues
- FLAG: Any score 5-7, or minor issues worth noting (admin should review but can use)
- REJECT: Any score < 5, or major violations (mixed anatomy, wrong intensity, severe guideline violation)
- REJECT: Any score < 5, or major violations (mixed anatomy, severe guideline violation)
</verdict_rules>
<questions_to_review>
@@ -83,13 +82,11 @@ ${JSON.stringify(questionsForReview, null, 2)}
"guidelineCompliance": 1-10, // Criterion 1
"creativity": 1-10, // Criterion 2
"clarity": 1-10, // Criterion 3
"intensityAccuracy": 1-10, // Criterion 4
"anatomicalConsistency": 1-10, // Criterion 5
"partnerTextQuality": 1-10, // Criterion 6 (10 if no partner_text needed)
"coupleTargeting": 1-10, // Criterion 7
"initiatorTargeting": 1-10 // Criterion 8 (10 if symmetric)
"anatomicalConsistency": 1-10, // Criterion 4
"partnerTextQuality": 1-10, // Criterion 5 (10 if no partner_text needed)
"coupleTargeting": 1-10, // Criterion 6
"initiatorTargeting": 1-10 // Criterion 7 (10 if symmetric)
},
"intensitySuggestion": number|null, // Suggested intensity (1-5) if current seems wrong, null if correct
"targetingSuggestions": { // Only include if targeting needs changes
"suggestedCoupleTargets": string[]|null, // ["male+male", "female+male", "female+female"] or subset
"suggestedInitiator": string[]|null, // ["male", "female"] or null for any
@@ -99,7 +96,7 @@ ${JSON.stringify(questionsForReview, null, 2)}
]
}
Review ALL questions against ALL 8 criteria. Be thorough but fair - only flag/reject for genuine issues.
Review ALL questions against ALL 7 criteria. Be thorough but fair - only flag/reject for genuine issues.
</output_format>`;
const response = await openai.chat.completions.create({
@@ -132,18 +129,17 @@ Review ALL questions against ALL 8 criteria. Be thorough but fair - only flag/re
const flagged = reviews.filter(r => r.verdict === 'flag').length;
const rejected = reviews.filter(r => r.verdict === 'reject').length;
// Calculate overall quality as weighted average of all 8 scores
// Weights: guidelineCompliance 20%, creativity 15%, clarity 15%, intensityAccuracy 15%,
// anatomicalConsistency 15%, partnerTextQuality 10%, coupleTargeting 5%, initiatorTargeting 5%
// Calculate overall quality as weighted average of all 7 scores
// Weights: guidelineCompliance 25%, creativity 18%, clarity 18%,
// anatomicalConsistency 17%, partnerTextQuality 12%, coupleTargeting 5%, initiatorTargeting 5%
let totalWeightedScore = 0;
let totalWeight = 0;
const weights = {
guidelineCompliance: 0.20,
creativity: 0.15,
clarity: 0.15,
intensityAccuracy: 0.15,
anatomicalConsistency: 0.15,
partnerTextQuality: 0.10,
guidelineCompliance: 0.25,
creativity: 0.18,
clarity: 0.18,
anatomicalConsistency: 0.17,
partnerTextQuality: 0.12,
coupleTargeting: 0.05,
initiatorTargeting: 0.05,
};
@@ -200,7 +196,6 @@ export async function selectBestGeneration(
index: qi,
text: q.text,
partner_text: q.partner_text || null,
intensity: q.intensity,
allowed_couple_genders: (q as { allowed_couple_genders?: string[] | null }).allowed_couple_genders || null,
target_user_genders: (q as { target_user_genders?: string[] | null }).target_user_genders || null,
})),
@@ -235,9 +230,8 @@ Ranked by importance (approximate weights):
1. Overall quality and creativity of questions (30%)
2. Variety and uniqueness within the set (20%)
3. Adherence to pack theme and tone (20%)
4. Proper intensity grading (15%)
5. Correct use of "your partner" language (10%)
6. Quality of partner_text for asymmetric questions (5%)
4. Correct use of "your partner" language (15%)
5. Quality of partner_text for asymmetric questions (10%)
</selection_criteria>
<output_format>
@@ -254,13 +248,11 @@ Ranked by importance (approximate weights):
"guidelineCompliance": 1-10,
"creativity": 1-10,
"clarity": 1-10,
"intensityAccuracy": 1-10,
"anatomicalConsistency": 1-10,
"partnerTextQuality": 1-10,
"coupleTargeting": 1-10,
"initiatorTargeting": 1-10
},
"intensitySuggestion": number|null,
"targetingSuggestions": {
"suggestedCoupleTargets": string[]|null,
"suggestedInitiator": string[]|null,
@@ -270,7 +262,7 @@ Ranked by importance (approximate weights):
]
}
Select the best set and review ALL questions in that set against ALL 8 criteria.
Select the best set and review ALL questions in that set against ALL 7 criteria.
</output_format>`;
const response = await openai.chat.completions.create({
@@ -300,7 +292,7 @@ Select the best set and review ALL questions in that set against ALL 8 criteria.
const reviews: QuestionReview[] = parsed.reviews || [];
const reasoning = parsed.reasoning || 'No reasoning provided';
// Calculate summary with weighted average of all 8 scores
// Calculate summary with weighted average of all 7 scores
const passed = reviews.filter(r => r.verdict === 'pass').length;
const flagged = reviews.filter(r => r.verdict === 'flag').length;
const rejected = reviews.filter(r => r.verdict === 'reject').length;
@@ -308,12 +300,11 @@ Select the best set and review ALL questions in that set against ALL 8 criteria.
let totalWeightedScore = 0;
let totalWeight = 0;
const weights = {
guidelineCompliance: 0.20,
creativity: 0.15,
clarity: 0.15,
intensityAccuracy: 0.15,
anatomicalConsistency: 0.15,
partnerTextQuality: 0.10,
guidelineCompliance: 0.25,
creativity: 0.18,
clarity: 0.18,
anatomicalConsistency: 0.17,
partnerTextQuality: 0.12,
coupleTargeting: 0.05,
initiatorTargeting: 0.05,
};
-8
View File
@@ -23,7 +23,6 @@ export interface CouncilConfig {
reviewerModel: string;
reviewerTemperature?: number;
selectionMode: CouncilSelectionMode;
cherryPickEnsureIntensityDistribution: boolean;
}
// =============================================================================
@@ -71,7 +70,6 @@ export interface QuestionReviewScores {
guidelineCompliance: number;
creativity: number;
clarity: number;
intensityAccuracy: number;
anatomicalConsistency: number;
partnerTextQuality: number;
coupleTargeting: number;
@@ -85,7 +83,6 @@ export interface QuestionReview {
suggestions?: string;
scores: QuestionReviewScores;
// Additional detailed feedback
intensitySuggestion?: number | null; // Suggested intensity if current seems wrong
targetingSuggestions?: {
suggestedCoupleTargets?: string[] | null;
suggestedInitiator?: string[] | null;
@@ -173,7 +170,6 @@ export interface CherryPickEvaluation {
guidelineCompliance: number;
creativity: number;
clarity: number;
intensityAccuracy: number;
uniqueness: number;
};
isDuplicate: boolean;
@@ -187,7 +183,6 @@ export interface CherryPickResult {
evaluations: CherryPickEvaluation[];
poolSize: number;
duplicatesRemoved: number;
intensityDistribution: Record<number, number>;
}
// =============================================================================
@@ -206,9 +201,6 @@ export interface TextAnalysis {
suggested_text: string;
suggested_partner_text: string | null;
reason: string;
// Intensity suggestion (only if AI thinks current is wrong)
suggested_intensity?: number | null;
intensity_reason?: string | null;
}
export interface DeletionAnalysis {
-20
View File
@@ -79,7 +79,6 @@ export function AiSettingsPage() {
council_reviewer_model: config.council_reviewer_model || '',
council_reviewer_temperature: config.council_reviewer_temperature,
council_selection_mode: config.council_selection_mode || 'whole_set',
cherry_pick_ensure_intensity_distribution: config.cherry_pick_ensure_intensity_distribution ?? true,
classifier_enabled: config.classifier_enabled ?? true,
classifier_model: config.classifier_model || 'openai/gpt-4o',
classifier_temperature: config.classifier_temperature,
@@ -183,7 +182,6 @@ export function AiSettingsPage() {
council_reviewer_model: config.council_reviewer_model || '',
council_reviewer_temperature: config.council_reviewer_temperature,
council_selection_mode: config.council_selection_mode || 'whole_set',
cherry_pick_ensure_intensity_distribution: config.cherry_pick_ensure_intensity_distribution ?? true,
classifier_enabled: config.classifier_enabled ?? true,
classifier_model: config.classifier_model || 'openai/gpt-4o',
classifier_temperature: config.classifier_temperature,
@@ -851,24 +849,6 @@ export function AiSettingsPage() {
</div>
</div>
{/* Cherry-pick intensity option */}
{formData.council_selection_mode === 'cherry_pick' && (
<div className="flex items-center justify-between">
<div className="space-y-0.5">
<Label className="text-sm">Ensure Intensity Variety</Label>
<p className="text-xs text-muted-foreground">
Balance across intensity levels 1-5
</p>
</div>
<Switch
checked={formData.cherry_pick_ensure_intensity_distribution ?? true}
onCheckedChange={(checked: boolean) =>
handleChange('cherry_pick_ensure_intensity_distribution', checked)
}
/>
</div>
)}
<p className="text-xs text-muted-foreground">
Uses {generators.length + 1} API calls ({generators.length} generator{generators.length > 1 ? 's' : ''} + reviewer)
</p>
-16
View File
@@ -4,7 +4,6 @@ import { useAuth, PERMISSION_KEYS } from '@/contexts/AuthContext';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Switch } from '@/components/ui/switch';
import { Skeleton } from '@/components/ui/skeleton';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';
@@ -30,7 +29,6 @@ export function AppSettingsPage() {
setFormData({
answer_gap_threshold: config.answer_gap_threshold ?? 10,
daily_response_limit: config.daily_response_limit ?? 0,
couple_intensity_gate_enabled: config.couple_intensity_gate_enabled ?? false,
});
setHasChanges(false);
}
@@ -63,7 +61,6 @@ export function AppSettingsPage() {
setFormData({
answer_gap_threshold: config.answer_gap_threshold ?? 10,
daily_response_limit: config.daily_response_limit ?? 0,
couple_intensity_gate_enabled: config.couple_intensity_gate_enabled ?? false,
});
setHasChanges(false);
}
@@ -160,19 +157,6 @@ export function AppSettingsPage() {
</CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<div className="flex items-center justify-between">
<div className="space-y-0.5">
<Label>Couple Comfort Zone Gate</Label>
<p className="text-sm text-muted-foreground">
When enabled, both recommended questions and answer-gap blocking use the lower of the two partners' comfort zones.
</p>
</div>
<Switch
checked={Boolean(formData.couple_intensity_gate_enabled)}
onCheckedChange={(checked) => handleChange('couple_intensity_gate_enabled', checked)}
/>
</div>
<div className="space-y-2">
<Label htmlFor="threshold">Answer Gap Threshold</Label>
<Input
+44 -28
View File
@@ -97,10 +97,10 @@ export function AuditLogsPage() {
<TableHeader>
<TableRow>
<TableHead className="w-40">Time</TableHead>
<TableHead className="w-32">Admin</TableHead>
<TableHead className="w-24">Action</TableHead>
<TableHead>Table</TableHead>
<TableHead>Changes</TableHead>
<TableHead className="hidden md:table-cell w-32">Admin</TableHead>
<TableHead className="hidden md:table-cell w-24">Action</TableHead>
<TableHead className="hidden lg:table-cell">Table</TableHead>
<TableHead className="hidden lg:table-cell">Changes</TableHead>
</TableRow>
</TableHeader>
<TableBody>
@@ -111,47 +111,63 @@ export function AuditLogsPage() {
</TableCell>
</TableRow>
) : (
logs.map((log) => (
<TableRow key={log.id}>
<TableCell className="text-sm text-muted-foreground">
{format(new Date(log.created_at), 'MMM d, h:mm a')}
</TableCell>
<TableCell>
<div className="text-sm font-medium">{log.admin_username || 'Unknown'}</div>
<div className="text-xs text-muted-foreground capitalize">{log.admin_role?.replace('_', ' ')}</div>
</TableCell>
<TableCell>
logs.map((log) => {
const actionBadge = (
<Badge className={`${actionColors[log.action] || 'bg-gray-500'} text-white`}>
{log.action}
</Badge>
</TableCell>
<TableCell className="font-mono text-sm">
{log.table_name}
</TableCell>
<TableCell className="max-w-md">
{log.action === 'DELETE' && log.old_values && (
);
const changesContent = log.action === 'DELETE' && log.old_values ? (
<code className="text-xs bg-red-500/20 text-red-300 px-2 py-1 rounded">
Deleted: {JSON.stringify(log.old_values).substring(0, 100)}...
</code>
)}
{log.action === 'INSERT' && log.new_values && (
) : log.action === 'INSERT' && log.new_values ? (
<code className="text-xs bg-green-500/20 text-green-300 px-2 py-1 rounded">
Created: {JSON.stringify(log.new_values).substring(0, 100)}...
</code>
)}
{log.action === 'UPDATE' && log.changed_fields && (
) : log.action === 'UPDATE' && log.changed_fields ? (
<code className="text-xs bg-blue-500/20 text-blue-300 px-2 py-1 rounded">
Changed: {log.changed_fields.join(', ')}
</code>
)}
{log.action === 'UPDATE' && !log.changed_fields && (
) : log.action === 'UPDATE' ? (
<code className="text-xs bg-blue-500/20 text-blue-300 px-2 py-1 rounded">
Updated record
</code>
)}
) : null;
return (
<TableRow key={log.id}>
<TableCell className="text-sm text-muted-foreground">
{format(new Date(log.created_at), 'MMM d, h:mm a')}
<div className="mt-2 space-y-1 text-xs text-muted-foreground md:hidden">
<div className="flex items-center gap-2">
<span className="font-medium text-foreground">{log.admin_username || 'Unknown'}</span>
<span className="capitalize">{log.admin_role?.replace('_', ' ')}</span>
</div>
<div className="flex flex-wrap items-center gap-2">
{actionBadge}
<span className="font-mono">{log.table_name}</span>
</div>
{changesContent && <div>{changesContent}</div>}
</div>
</TableCell>
<TableCell className="hidden md:table-cell">
<div className="text-sm font-medium">{log.admin_username || 'Unknown'}</div>
<div className="text-xs text-muted-foreground capitalize">{log.admin_role?.replace('_', ' ')}</div>
</TableCell>
<TableCell className="hidden md:table-cell">
{actionBadge}
</TableCell>
<TableCell className="hidden lg:table-cell font-mono text-sm">
{log.table_name}
</TableCell>
<TableCell className="hidden lg:table-cell max-w-md">
{changesContent}
</TableCell>
</TableRow>
))
);
})
)}
</TableBody>
</Table>
+24 -16
View File
@@ -240,7 +240,7 @@ export function FeedbackPage() {
return (
<div className="space-y-6">
<div className="flex items-center justify-between">
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
<div>
<div className="flex items-center gap-3">
<h1 className="text-3xl font-bold tracking-tight">User Feedback</h1>
@@ -253,8 +253,8 @@ export function FeedbackPage() {
</div>
{/* Filters */}
<div className="flex items-center gap-4">
<div className="relative flex-1 max-w-sm">
<div className="flex flex-col gap-3 md:flex-row md:items-center">
<div className="relative w-full md:flex-1 md:max-w-sm">
<Search className="absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" />
<Input
placeholder="Search feedback..."
@@ -264,7 +264,7 @@ export function FeedbackPage() {
/>
</div>
<Select value={typeFilter} onValueChange={setTypeFilter}>
<SelectTrigger className="w-[150px]">
<SelectTrigger className="w-full md:w-[150px]">
<SelectValue placeholder="Type" />
</SelectTrigger>
<SelectContent>
@@ -276,7 +276,7 @@ export function FeedbackPage() {
</SelectContent>
</Select>
<Select value={statusFilter} onValueChange={setStatusFilter}>
<SelectTrigger className="w-[150px]">
<SelectTrigger className="w-full md:w-[150px]">
<SelectValue placeholder="Status" />
</SelectTrigger>
<SelectContent>
@@ -295,12 +295,12 @@ export function FeedbackPage() {
<Table>
<TableHeader>
<TableRow>
<TableHead>Type</TableHead>
<TableHead className="hidden md:table-cell">Type</TableHead>
<TableHead>Title</TableHead>
<TableHead>User</TableHead>
<TableHead>Status</TableHead>
<TableHead>Created</TableHead>
<TableHead className="w-[100px]">Actions</TableHead>
<TableHead className="hidden lg:table-cell">User</TableHead>
<TableHead className="hidden md:table-cell">Status</TableHead>
<TableHead className="hidden lg:table-cell">Created</TableHead>
<TableHead className="hidden md:table-cell w-[100px]">Actions</TableHead>
</TableRow>
</TableHeader>
<TableBody>
@@ -321,27 +321,35 @@ export function FeedbackPage() {
) : (
paginatedFeedback.map((item) => (
<TableRow key={item.id} className="cursor-pointer hover:bg-muted/50" onClick={() => handleOpenDetail(item)}>
<TableCell>{getTypeBadge(item.type)}</TableCell>
<TableCell className="hidden md:table-cell">{getTypeBadge(item.type)}</TableCell>
<TableCell>
<div className="max-w-[300px]">
<div className="md:max-w-[300px]">
<div className="font-medium truncate">{item.title}</div>
<div className="text-sm text-muted-foreground truncate">
{item.description.slice(0, 80)}
{item.description.length > 80 && '...'}
</div>
</div>
<div className="mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground md:hidden">
{getTypeBadge(item.type)}
{getStatusBadge(item.status)}
<span className="truncate max-w-[220px]">
{item.profile?.name || item.profile?.email || 'Unknown user'}
</span>
<span>{format(new Date(item.created_at), 'MMM d, yyyy')}</span>
</div>
</TableCell>
<TableCell>
<TableCell className="hidden lg:table-cell">
<div className="text-sm">
<div className="font-medium">{item.profile?.name || 'Unknown'}</div>
<div className="text-muted-foreground">{item.profile?.email}</div>
</div>
</TableCell>
<TableCell>{getStatusBadge(item.status)}</TableCell>
<TableCell className="text-muted-foreground text-sm">
<TableCell className="hidden md:table-cell">{getStatusBadge(item.status)}</TableCell>
<TableCell className="hidden lg:table-cell text-muted-foreground text-sm">
{format(new Date(item.created_at), 'MMM d, yyyy')}
</TableCell>
<TableCell>
<TableCell className="hidden md:table-cell">
<Button variant="ghost" size="sm" onClick={(e) => { e.stopPropagation(); handleOpenDetail(item); }}>
View
</Button>
+29 -8
View File
@@ -435,7 +435,7 @@ export function FlaggedMessagesPage() {
<TableRow>
<TableHead>Time</TableHead>
<TableHead>Reason</TableHead>
<TableHead>Type</TableHead>
<TableHead className="hidden md:table-cell">Type</TableHead>
<TableHead className="text-right">Actions</TableHead>
</TableRow>
</TableHeader>
@@ -460,15 +460,23 @@ export function FlaggedMessagesPage() {
<Badge variant="destructive" className="bg-red-500/10 text-red-500 hover:bg-red-500/20 border-0">
{message.flag_reason || 'Unknown'}
</Badge>
<div className="mt-2 flex items-center gap-2 text-xs text-muted-foreground md:hidden">
{message.media_path ? (
<Badge variant="outline">{message.media_type || 'Media'}</Badge>
) : (
<Badge variant="secondary">Text</Badge>
)}
</div>
</TableCell>
<TableCell>
<TableCell className="hidden md:table-cell">
{message.media_path ? (
<Badge variant="outline">{message.media_type || 'Media'}</Badge>
) : (
<Badge variant="secondary">Text</Badge>
)}
</TableCell>
<TableCell className="text-right space-x-2">
<TableCell className="text-right">
<div className="flex flex-col gap-2 sm:flex-row sm:justify-end">
<Button
variant="ghost"
size="sm"
@@ -502,6 +510,7 @@ export function FlaggedMessagesPage() {
<CheckCircle className="h-4 w-4 mr-2" />
Mark Safe
</Button>
</div>
</TableCell>
</TableRow>
{inlineDescriptions[message.id] && (
@@ -550,9 +559,9 @@ export function FlaggedMessagesPage() {
<TableHeader>
<TableRow>
<TableHead>Time</TableHead>
<TableHead>Reporter</TableHead>
<TableHead className="hidden md:table-cell">Reporter</TableHead>
<TableHead>Reason</TableHead>
<TableHead>Type</TableHead>
<TableHead className="hidden md:table-cell">Type</TableHead>
<TableHead className="text-right">Actions</TableHead>
</TableRow>
</TableHeader>
@@ -572,22 +581,33 @@ export function FlaggedMessagesPage() {
<TableCell className="font-mono text-sm">
{format(new Date(report.created_at), 'MMM d, HH:mm')}
</TableCell>
<TableCell className="text-sm">
<TableCell className="hidden md:table-cell text-sm">
{report.reporter_profile?.name || report.reporter_profile?.email || 'Unknown'}
</TableCell>
<TableCell>
<Badge variant="outline" className="bg-orange-500/10 text-orange-600 border-orange-200">
{REASON_LABELS[report.reason] || report.reason}
</Badge>
<div className="mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground md:hidden">
<span className="truncate max-w-[220px]">
{report.reporter_profile?.name || report.reporter_profile?.email || 'Unknown'}
</span>
{report.message?.media_path ? (
<Badge variant="outline">{report.message.media_type || 'Media'}</Badge>
) : (
<Badge variant="secondary">Text</Badge>
)}
</div>
</TableCell>
<TableCell>
<TableCell className="hidden md:table-cell">
{report.message?.media_path ? (
<Badge variant="outline">{report.message.media_type || 'Media'}</Badge>
) : (
<Badge variant="secondary">Text</Badge>
)}
</TableCell>
<TableCell className="text-right space-x-2">
<TableCell className="text-right">
<div className="flex flex-col gap-2 sm:flex-row sm:justify-end">
<Button
variant="ghost"
size="sm"
@@ -616,6 +636,7 @@ export function FlaggedMessagesPage() {
<CheckCircle className="h-4 w-4 mr-2" />
Mark Reviewed
</Button>
</div>
</TableCell>
</TableRow>
))
+65 -23
View File
@@ -303,15 +303,15 @@ export function RedemptionCodesPage() {
return (
<div className="space-y-6">
<div className="flex items-center justify-between">
<div className="flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between">
<div>
<h1 className="text-3xl font-bold tracking-tight">Redemption Codes</h1>
<p className="text-muted-foreground">
Generate and manage codes that grant premium access
</p>
</div>
<div className="flex items-center gap-4">
<div className="relative w-64">
<div className="flex flex-col gap-3 sm:flex-row sm:items-center">
<div className="relative w-full sm:w-64">
<Search className="absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" />
<Input
placeholder="Search codes..."
@@ -322,7 +322,7 @@ export function RedemptionCodesPage() {
</div>
<Dialog open={isAddDialogOpen} onOpenChange={setIsAddDialogOpen}>
<DialogTrigger asChild>
<Button onClick={handleOpenAddDialog}>
<Button onClick={handleOpenAddDialog} className="w-full sm:w-auto">
<Plus className="h-4 w-4 mr-2" />
Generate Code
</Button>
@@ -337,7 +337,7 @@ export function RedemptionCodesPage() {
<div className="grid gap-4 py-4">
<div className="grid gap-2">
<Label>Code</Label>
<div className="flex gap-2">
<div className="flex flex-col gap-2 sm:flex-row">
<Input
value={formData.code}
onChange={(e) => setFormData(prev => ({ ...prev, code: e.target.value.toUpperCase() }))}
@@ -399,12 +399,12 @@ export function RedemptionCodesPage() {
<TableHeader>
<TableRow>
<TableHead>Code</TableHead>
<TableHead>Description</TableHead>
<TableHead>Usage</TableHead>
<TableHead>Expires</TableHead>
<TableHead>Status</TableHead>
<TableHead>Created</TableHead>
<TableHead className="w-[150px]">Actions</TableHead>
<TableHead className="hidden lg:table-cell">Description</TableHead>
<TableHead className="hidden md:table-cell">Usage</TableHead>
<TableHead className="hidden lg:table-cell">Expires</TableHead>
<TableHead className="hidden md:table-cell">Status</TableHead>
<TableHead className="hidden xl:table-cell">Created</TableHead>
<TableHead className="hidden md:table-cell w-[150px]">Actions</TableHead>
</TableRow>
</TableHeader>
<TableBody>
@@ -421,7 +421,13 @@ export function RedemptionCodesPage() {
</TableCell>
</TableRow>
) : (
filteredCodes.map((code) => (
filteredCodes.map((code) => {
const statusBadge = getStatusBadge(code);
const expiresLabel = code.expires_at
? format(new Date(code.expires_at), 'MMM d, yyyy HH:mm')
: 'Never';
return (
<TableRow key={code.id}>
<TableCell>
<div className="flex items-center gap-2">
@@ -438,26 +444,61 @@ export function RedemptionCodesPage() {
<Copy className="h-3 w-3" />
</Button>
</div>
<div className="mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground md:hidden">
{statusBadge}
<span>
{code.current_uses} / {code.max_uses} uses
</span>
<span>Expires {expiresLabel}</span>
{code.description && <span className="truncate max-w-[220px]">{code.description}</span>}
</div>
<div className="mt-3 flex flex-wrap items-center gap-2 md:hidden">
<Button
variant="outline"
size="sm"
onClick={() => handleViewRedemptions(code)}
>
<Users className="h-3 w-3 mr-1" />
Redemptions
</Button>
<div className="flex items-center gap-2 rounded-md border px-2 py-1">
<Switch
checked={code.is_active}
onCheckedChange={() => handleToggleActive(code)}
title={code.is_active ? "Deactivate" : "Activate"}
/>
<span className="text-xs text-muted-foreground">
{code.is_active ? 'Active' : 'Inactive'}
</span>
</div>
<Button
variant="outline"
size="sm"
className="text-destructive hover:text-destructive hover:bg-destructive/10"
onClick={() => handleDeleteCode(code)}
>
<Trash2 className="h-3 w-3 mr-1" />
Delete
</Button>
</div>
</TableCell>
<TableCell className="text-muted-foreground">
<TableCell className="hidden lg:table-cell text-muted-foreground">
{code.description || '—'}
</TableCell>
<TableCell>
<TableCell className="hidden md:table-cell">
<span className="font-medium">{code.current_uses}</span>
<span className="text-muted-foreground"> / {code.max_uses}</span>
</TableCell>
<TableCell className="text-muted-foreground text-sm">
{code.expires_at
? format(new Date(code.expires_at), 'MMM d, yyyy HH:mm')
: 'Never'}
<TableCell className="hidden lg:table-cell text-muted-foreground text-sm">
{expiresLabel}
</TableCell>
<TableCell>
{getStatusBadge(code)}
<TableCell className="hidden md:table-cell">
{statusBadge}
</TableCell>
<TableCell className="text-muted-foreground text-sm">
<TableCell className="hidden xl:table-cell text-muted-foreground text-sm">
{format(new Date(code.created_at), 'MMM d, yyyy')}
</TableCell>
<TableCell>
<TableCell className="hidden md:table-cell">
<div className="flex items-center gap-1">
<Button
variant="ghost"
@@ -484,7 +525,8 @@ export function RedemptionCodesPage() {
</div>
</TableCell>
</TableRow>
))
);
})
)}
</TableBody>
</Table>
@@ -440,7 +440,7 @@ export function UserActivityPage() {
return (
<div className="space-y-6">
{/* Header */}
<div className="flex items-center justify-between">
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
<div>
<div className="flex items-center gap-3">
<h1 className="text-3xl font-bold tracking-tight flex items-center gap-2">
@@ -457,7 +457,7 @@ export function UserActivityPage() {
{/* Tabs */}
<Tabs value={activeTab} onValueChange={(v) => setActiveTab(v as ActivityTab)}>
<TabsList className="grid w-full grid-cols-4 max-w-[600px]">
<TabsList className="grid w-full grid-cols-2 sm:grid-cols-4 max-w-[600px]">
<TabsTrigger value="responses" className="gap-2">
<ThumbsUp className="h-4 w-4" />
Responses
+63 -17
View File
@@ -302,7 +302,7 @@ export function AdminsPage() {
return (
<div className="space-y-6">
<div className="flex items-center justify-between">
<div className="flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between">
<div>
<div className="flex items-center gap-3">
<h1 className="text-3xl font-bold tracking-tight">Admin Management</h1>
@@ -312,8 +312,8 @@ export function AdminsPage() {
Manage system administrators and their roles
</p>
</div>
<div className="flex items-center gap-4">
<div className="relative w-64">
<div className="flex flex-col gap-3 sm:flex-row sm:items-center">
<div className="relative w-full sm:w-64">
<Search className="absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" />
<Input
placeholder="Search admins..."
@@ -509,10 +509,10 @@ export function AdminsPage() {
<TableHeader>
<TableRow>
<TableHead>Admin User</TableHead>
<TableHead>Email</TableHead>
<TableHead>Role / Permissions</TableHead>
<TableHead>Added On</TableHead>
<TableHead className="w-[120px]">Actions</TableHead>
<TableHead className="hidden md:table-cell">Email</TableHead>
<TableHead className="hidden lg:table-cell">Role / Permissions</TableHead>
<TableHead className="hidden xl:table-cell">Added On</TableHead>
<TableHead className="hidden md:table-cell w-[120px]">Actions</TableHead>
</TableRow>
</TableHeader>
<TableBody>
@@ -529,28 +529,73 @@ export function AdminsPage() {
</TableCell>
</TableRow>
) : (
paginatedAdmins.map((admin) => (
paginatedAdmins.map((admin) => {
const isSelf = admin.user_id === currentUser?.id;
const mobileRoleBadge = admin.role === 'super_admin' ? (
<Badge variant="default">
<Shield className="h-3 w-3 mr-1" />
Super Admin
</Badge>
) : (
<Badge variant="secondary">
{admin.permissions.length > 0
? `${admin.permissions.length} permission${admin.permissions.length !== 1 ? 's' : ''}`
: 'No permissions'}
</Badge>
);
return (
<TableRow key={admin.user_id}>
<TableCell>
<div className="flex items-center gap-3">
<div className="flex items-center gap-3 min-w-0">
<Avatar className="h-9 w-9">
<AvatarImage src={admin.profile?.avatar_url || undefined} />
<AvatarFallback>
{admin.profile?.name?.charAt(0).toUpperCase() || 'A'}
</AvatarFallback>
</Avatar>
<span className="font-medium">
<span className="font-medium truncate">
{admin.profile?.name || 'Unknown User'}
</span>
{admin.user_id === currentUser?.id && (
{isSelf && (
<Badge variant="outline" className="ml-2">You</Badge>
)}
</div>
<div className="mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground md:hidden">
<span className="truncate max-w-[220px]">
{admin.profile?.email || '—'}
</span>
{mobileRoleBadge}
<span className="text-muted-foreground">
Added {admin.created_at ? format(new Date(admin.created_at), 'MMM d, yyyy') : '—'}
</span>
</div>
{!isSelf && (
<div className="mt-3 flex flex-wrap gap-2 md:hidden">
<Button
variant="outline"
size="sm"
onClick={() => handleEditPermissions(admin)}
>
<Settings className="h-3 w-3 mr-1" />
Edit
</Button>
<Button
variant="outline"
size="sm"
className="text-destructive hover:text-destructive hover:bg-destructive/10"
onClick={() => handleRemoveAdmin(admin)}
>
<Trash2 className="h-3 w-3 mr-1" />
Remove
</Button>
</div>
)}
</TableCell>
<TableCell className="text-muted-foreground">
<TableCell className="hidden md:table-cell text-muted-foreground">
{admin.profile?.email || '—'}
</TableCell>
<TableCell>
<TableCell className="hidden lg:table-cell">
{admin.role === 'super_admin' ? (
<Badge variant="default">
<Shield className="h-3 w-3 mr-1" />
@@ -575,12 +620,12 @@ export function AdminsPage() {
</div>
)}
</TableCell>
<TableCell className="text-muted-foreground text-sm">
<TableCell className="hidden xl:table-cell text-muted-foreground text-sm">
{admin.created_at ? format(new Date(admin.created_at), 'MMM d, yyyy') : '—'}
</TableCell>
<TableCell>
<TableCell className="hidden md:table-cell">
<div className="flex items-center gap-1">
{admin.user_id !== currentUser?.id && (
{!isSelf && (
<>
<Button
variant="ghost"
@@ -604,7 +649,8 @@ export function AdminsPage() {
</div>
</TableCell>
</TableRow>
))
);
})
)}
</TableBody>
</Table>
+9 -37
View File
@@ -29,7 +29,7 @@ import {
SelectTrigger,
SelectValue,
} from '@/components/ui/select';
import { Plus, Zap, Pencil, Trash2, Loader2, Crown, Eye, EyeOff, Flame, Heart, ChevronUp, ChevronDown } from 'lucide-react';
import { Plus, Zap, Pencil, Trash2, Loader2, Crown, Eye, EyeOff, ChevronUp, ChevronDown } from 'lucide-react';
import { toast } from 'sonner';
// =============================================================================
@@ -52,9 +52,6 @@ interface DarePack {
is_explicit: boolean;
sort_order: number;
category_id: string | null;
min_intensity: number | null;
max_intensity: number | null;
avg_intensity: number | null;
created_at: string | null;
dare_count?: number;
}
@@ -296,15 +293,6 @@ export function DarePacksPage() {
}
};
const getIntensityColor = (avg: number | null) => {
if (avg === null) return 'bg-muted';
if (avg <= 1.5) return 'bg-green-500';
if (avg <= 2.5) return 'bg-lime-500';
if (avg <= 3.5) return 'bg-yellow-500';
if (avg <= 4.5) return 'bg-orange-500';
return 'bg-red-500';
};
// =============================================================================
// Render
// =============================================================================
@@ -446,9 +434,9 @@ export function DarePacksPage() {
<div className="flex items-center justify-between">
<div className="space-y-0.5">
<Label>Explicit</Label>
<Label>NSFW</Label>
<p className="text-xs text-muted-foreground">
Contains adult/explicit content
Contains adult or mature content
</p>
</div>
<Switch
@@ -456,6 +444,7 @@ export function DarePacksPage() {
onCheckedChange={(checked) => form.setField('is_explicit', checked)}
/>
</div>
</div>
<DialogFooter>
@@ -522,6 +511,11 @@ export function DarePacksPage() {
</div>
</div>
<div className="flex items-center gap-1">
{pack.is_explicit && (
<Badge variant="destructive">
NSFW
</Badge>
)}
{pack.is_premium && (
<Badge variant="default" className="bg-amber-500">
<Crown className="h-3 w-3 mr-1" />
@@ -539,17 +533,6 @@ export function DarePacksPage() {
Draft
</Badge>
)}
{pack.is_explicit ? (
<Badge variant="outline" className="border-red-500 text-red-400">
<Flame className="h-3 w-3 mr-1" />
Explicit
</Badge>
) : (
<Badge variant="outline" className="border-pink-400 text-pink-300">
<Heart className="h-3 w-3 mr-1" />
Safe
</Badge>
)}
</div>
</div>
<div className="flex items-start justify-between">
@@ -574,17 +557,6 @@ export function DarePacksPage() {
<CardDescription className="line-clamp-2">
{pack.description || 'No description'}
</CardDescription>
{/* Intensity indicator */}
{pack.avg_intensity !== null && (
<div className="flex items-center gap-2 mt-2">
<Badge className={`${getIntensityColor(pack.avg_intensity)} text-white`}>
Avg: {pack.avg_intensity?.toFixed(1)}
</Badge>
<span className="text-xs text-muted-foreground">
Range: {pack.min_intensity ?? '?'} - {pack.max_intensity ?? '?'}
</span>
</div>
)}
</CardHeader>
<CardContent>
<div className="flex items-center justify-between">
+2 -9
View File
@@ -47,7 +47,6 @@ interface DarePack {
name: string;
description: string | null;
icon: string | null;
is_explicit: boolean;
}
interface Dare {
@@ -70,8 +69,6 @@ const DURATION_OPTIONS = [
{ value: '168', label: '1 week' },
];
const getDefaultIntensity = (isExplicit?: boolean) => (isExplicit ? 4 : 2);
// Format duration for display
const formatDuration = (hours: number | null): string => {
if (hours === null) return '—';
@@ -101,11 +98,9 @@ export function DaresPage() {
// Form state
const [formData, setFormData] = useState<{
text: string;
intensity: number;
suggested_duration_hours: string;
}>({
text: '',
intensity: getDefaultIntensity(),
suggested_duration_hours: '',
});
@@ -117,7 +112,7 @@ export function DaresPage() {
// Fetch pack info
const { data: packData } = await supabase
.from('dare_packs')
.select('id, name, description, icon, is_explicit')
.select('id, name, description, icon')
.eq('id', packId)
.single();
@@ -167,7 +162,7 @@ export function DaresPage() {
const openCreateDialog = () => {
setEditingDare(null);
setFormData({ text: '', intensity: getDefaultIntensity(pack?.is_explicit), suggested_duration_hours: '' });
setFormData({ text: '', suggested_duration_hours: '' });
setDialogOpen(true);
};
@@ -175,7 +170,6 @@ export function DaresPage() {
setEditingDare(dare);
setFormData({
text: dare.text,
intensity: dare.intensity,
suggested_duration_hours: dare.suggested_duration_hours?.toString() || '',
});
setDialogOpen(true);
@@ -191,7 +185,6 @@ export function DaresPage() {
try {
const dareData = {
text: formData.text,
intensity: formData.intensity,
suggested_duration_hours: formData.suggested_duration_hours
? parseInt(formData.suggested_duration_hours, 10)
: null,
+6 -12
View File
@@ -8,7 +8,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/com
import { Badge } from '@/components/ui/badge';
import { Skeleton } from '@/components/ui/skeleton';
import { PaginationControls } from '@/components/ui/pagination';
import { Plus, MessageCircle, Pencil, Trash2, Sparkles, Crown, Eye, EyeOff, Flame, Heart, Tags, ChevronUp, ChevronDown, Clock, BellOff } from 'lucide-react';
import { Plus, MessageCircle, Pencil, Trash2, Sparkles, Crown, Eye, EyeOff, Tags, ChevronUp, ChevronDown, Clock, BellOff } from 'lucide-react';
import { toast } from 'sonner';
import { AiGeneratorDialog } from '@/components/ai/AiGeneratorDialog';
import { ExtractTopicsDialog } from '@/components/content/ExtractTopicsDialog';
@@ -513,6 +513,11 @@ export function PacksPage() {
</div>
</div>
<div className="flex items-center gap-1">
{pack.is_explicit && (
<Badge variant="destructive">
NSFW
</Badge>
)}
{pack.is_premium && (
<Badge variant="default" className="bg-amber-500">
<Crown className="h-3 w-3 mr-1" />
@@ -542,17 +547,6 @@ export function PacksPage() {
Draft
</Badge>
)}
{pack.is_explicit ? (
<Badge variant="outline" className="border-red-500 text-red-400">
<Flame className="h-3 w-3 mr-1" />
Explicit
</Badge>
) : (
<Badge variant="outline" className="border-pink-400 text-pink-300">
<Heart className="h-3 w-3 mr-1" />
Safe
</Badge>
)}
</div>
</div>
<div className="flex items-start justify-between">
@@ -62,9 +62,6 @@ interface ChartDatum {
type SegmentKey = 'all' | 'premium' | 'free';
const intensityPalette = ['#22c55e', '#84cc16', '#facc15', '#f97316', '#ef4444'];
const intensityLabels = ['Gentle', 'Warm', 'Playful', 'Steamy', 'Intense'];
const QUESTION_TYPE_CONFIG: Record<QuestionType, { label: string; color: string }> = {
swipe: { label: 'Swipe', color: '#38bdf8' },
text_answer: { label: 'Text', color: '#f59e0b' },
@@ -101,11 +98,6 @@ export function QuestionAnalyticsPage() {
});
const [premiumBreakdown, setPremiumBreakdown] = useState<ChartDatum[]>([]);
const [questionTypeBreakdown, setQuestionTypeBreakdown] = useState<ChartDatum[]>([]);
const [intensityBreakdown, setIntensityBreakdown] = useState<Record<SegmentKey, ChartDatum[]>>({
all: [],
premium: [],
free: [],
});
const [topicBreakdown, setTopicBreakdown] = useState<Record<SegmentKey, BreakdownItem[]>>({
all: [],
premium: [],
@@ -121,7 +113,6 @@ export function QuestionAnalyticsPage() {
premium: [],
free: [],
});
const [intensitySegment, setIntensitySegment] = useState<SegmentKey>('all');
const [tagSegment, setTagSegment] = useState<SegmentKey>('all');
const [categorySegment, setCategorySegment] = useState<SegmentKey>('all');
const [packSegment, setPackSegment] = useState<SegmentKey>('all');
@@ -215,12 +206,6 @@ export function QuestionAnalyticsPage() {
packTopicsMap.set(relation.pack_id, topicsForPack);
});
const emptyIntensityCounts = { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0 };
const intensityCounts: Record<SegmentKey, Record<number, number>> = {
all: { ...emptyIntensityCounts },
premium: { ...emptyIntensityCounts },
free: { ...emptyIntensityCounts },
};
const untaggedCounts: Record<SegmentKey, number> = { all: 0, premium: 0, free: 0 };
const questionTypeCounts: Record<QuestionType, number> = {
swipe: 0,
@@ -262,10 +247,6 @@ export function QuestionAnalyticsPage() {
freeCount += 1;
}
const intensity = question.intensity ?? 1;
intensityCounts.all[intensity] = (intensityCounts.all[intensity] || 0) + 1;
intensityCounts[segmentKey][intensity] = (intensityCounts[segmentKey][intensity] || 0) + 1;
const updatePackCounts = (key: SegmentKey) => {
const map = packCountsBySegment[key];
const packEntry = map.get(question.pack_id) || {
@@ -332,12 +313,6 @@ export function QuestionAnalyticsPage() {
color: config.color,
}));
const buildIntensityData = (key: SegmentKey) => intensityLabels.map((label, index) => ({
name: label,
value: intensityCounts[key][index + 1] || 0,
color: intensityPalette[index],
}));
const buildTopicData = (key: SegmentKey) => {
const data = Array.from(topicCountsBySegment[key].values());
if (untaggedCounts[key] > 0 || data.length === 0) {
@@ -348,12 +323,6 @@ export function QuestionAnalyticsPage() {
return data;
};
const intensityData = {
all: buildIntensityData('all'),
premium: buildIntensityData('premium'),
free: buildIntensityData('free'),
};
const topicData = {
all: buildTopicData('all'),
premium: buildTopicData('premium'),
@@ -385,7 +354,6 @@ export function QuestionAnalyticsPage() {
});
setPremiumBreakdown(premiumData);
setQuestionTypeBreakdown(questionTypeData);
setIntensityBreakdown(intensityData);
setTopicBreakdown(topicData);
setCategoryBreakdown(categoryData);
setPackBreakdown(packData);
@@ -427,7 +395,6 @@ export function QuestionAnalyticsPage() {
free: stats.totalQuestions ? ((stats.freeQuestions / stats.totalQuestions) * 100).toFixed(0) : '0',
};
const intensityData = intensityBreakdown[intensitySegment];
const tagData = topicBreakdown[tagSegment];
const categoryData = categoryBreakdown[categorySegment];
const packData = packBreakdown[packSegment];
@@ -447,7 +414,7 @@ export function QuestionAnalyticsPage() {
Question Analytics
</h1>
<p className="text-muted-foreground">
Deep dive into premium coverage, tags, categories, and intensity distribution
Deep dive into premium coverage, tags, categories, and question types
</p>
</div>
<div className="flex flex-col gap-2">
@@ -601,78 +568,6 @@ export function QuestionAnalyticsPage() {
)}
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
<div>
<CardTitle>Intensity Distribution</CardTitle>
<CardDescription>
How questions are spread across intensity levels
</CardDescription>
</div>
<div className="flex flex-col items-start gap-1 sm:items-end">
<div className="flex items-center gap-2">
{segmentOptions.map((option) => (
<Button
key={option.key}
variant={intensitySegment === option.key ? 'default' : 'outline'}
size="sm"
onClick={() => setIntensitySegment(option.key)}
className="rounded-full"
>
{option.label}
</Button>
))}
</div>
<p className="text-xs text-muted-foreground">
{segmentLabelByKey[intensitySegment]}: {totalBySegment[intensitySegment].toLocaleString()} questions ({segmentShareByKey[intensitySegment]}%)
</p>
</div>
</CardHeader>
<CardContent>
{loading ? (
<Skeleton className="h-[300px] w-full" />
) : totalBySegment[intensitySegment] === 0 ? (
<div className="flex items-center justify-center h-[300px] text-muted-foreground">
No questions in this segment yet
</div>
) : (
<div className="h-[300px]">
<ResponsiveContainer width="100%" height="100%">
<BarChart data={intensityData}>
<XAxis
dataKey="name"
stroke="hsl(var(--muted-foreground))"
fontSize={11}
tickLine={false}
axisLine={false}
/>
<YAxis
stroke="hsl(var(--muted-foreground))"
fontSize={11}
tickLine={false}
axisLine={false}
tickFormatter={(value) => `${value}`}
/>
<Tooltip
cursor={{ fill: 'rgba(255,255,255,0.03)' }}
contentStyle={{
borderRadius: '8px',
border: '1px solid #e2e8f0',
boxShadow: '0 4px 6px -1px rgb(0 0 0 / 0.1)',
}}
/>
<Bar dataKey="value" radius={[6, 6, 0, 0]}>
{intensityData.map((entry, index) => (
<Cell key={`cell-${index}`} fill={entry.color} />
))}
</Bar>
</BarChart>
</ResponsiveContainer>
</div>
)}
</CardContent>
</Card>
</div>
<Card>
+2 -19
View File
@@ -49,7 +49,6 @@ interface QuestionPack {
name: string;
description: string | null;
icon: string | null;
is_explicit: boolean;
}
type QuestionType = 'swipe' | 'text_answer' | 'audio' | 'photo' | 'who_likely';
@@ -74,7 +73,6 @@ interface Question {
}
const DEFAULT_AUDIO_DURATION = 60;
const getDefaultIntensity = (isExplicit?: boolean) => (isExplicit ? 4 : 2);
const QUESTION_TYPE_OPTIONS: Array<{ value: QuestionType; label: string }> = [
{ value: 'swipe', label: 'Swipe' },
@@ -124,7 +122,6 @@ export function QuestionsPage() {
const [formData, setFormData] = useState<{
text: string;
partner_text: string;
intensity: number;
allowed_couple_genders: string[];
target_user_genders: string[];
required_props: string;
@@ -134,7 +131,6 @@ export function QuestionsPage() {
}>({
text: '',
partner_text: '',
intensity: getDefaultIntensity(),
allowed_couple_genders: [],
target_user_genders: [],
required_props: '',
@@ -156,7 +152,7 @@ export function QuestionsPage() {
const packPromise = supabase
.from('question_packs')
.select('id, name, description, icon, is_explicit')
.select('id, name, description, icon')
.eq('id', packId)
.single();
let questionsQuery = supabase
@@ -272,7 +268,6 @@ export function QuestionsPage() {
setFormData({
text: '',
partner_text: '',
intensity: getDefaultIntensity(pack?.is_explicit),
allowed_couple_genders: [],
target_user_genders: [],
required_props: '',
@@ -289,7 +284,6 @@ export function QuestionsPage() {
setFormData({
text: question.text,
partner_text: question.partner_text || '',
intensity: question.intensity,
allowed_couple_genders: question.allowed_couple_genders || [],
target_user_genders: question.target_user_genders || [],
required_props: question.required_props?.join(', ') ?? '',
@@ -326,7 +320,6 @@ export function QuestionsPage() {
const { error } = await auditedSupabase.update('questions', editingQuestion.id, {
text: formData.text,
partner_text: formData.partner_text || null,
intensity: formData.intensity,
allowed_couple_genders: formData.allowed_couple_genders.length > 0 ? formData.allowed_couple_genders : null,
target_user_genders: formData.target_user_genders.length > 0 ? formData.target_user_genders : null,
required_props: requiredPropsValue,
@@ -342,7 +335,6 @@ export function QuestionsPage() {
pack_id: packId,
text: formData.text,
partner_text: formData.partner_text || null,
intensity: formData.intensity,
allowed_couple_genders: formData.allowed_couple_genders.length > 0 ? formData.allowed_couple_genders : null,
target_user_genders: formData.target_user_genders.length > 0 ? formData.target_user_genders : null,
required_props: requiredPropsValue,
@@ -384,7 +376,6 @@ export function QuestionsPage() {
const handleAiGenerated = (generatedQuestions: Array<{ text: string; partner_text?: string; intensity: number; inverse_pair_id?: string | null }>) => {
const generatedQuestionType: QuestionType = 'swipe';
const defaultIntensity = getDefaultIntensity(pack?.is_explicit);
// Bulk insert AI-generated questions with inverse_of linking
const insertQuestions = async () => {
@@ -411,7 +402,6 @@ export function QuestionsPage() {
pack_id: packId,
text: q.text,
partner_text: q.partner_text || null,
intensity: defaultIntensity,
inverse_of: null,
question_type: generatedQuestionType,
config: null,
@@ -431,7 +421,6 @@ export function QuestionsPage() {
pack_id: packId,
text: primary.text,
partner_text: primary.partner_text || null,
intensity: defaultIntensity,
inverse_of: null,
question_type: generatedQuestionType,
config: null,
@@ -449,7 +438,6 @@ export function QuestionsPage() {
pack_id: packId,
text: inverse.text,
partner_text: inverse.partner_text || null,
intensity: defaultIntensity,
inverse_of: primaryId,
question_type: generatedQuestionType,
config: null,
@@ -467,7 +455,6 @@ export function QuestionsPage() {
pack_id: packId,
text: extra.text,
partner_text: extra.partner_text || null,
intensity: defaultIntensity,
inverse_of: null,
question_type: generatedQuestionType,
config: null,
@@ -483,7 +470,6 @@ export function QuestionsPage() {
pack_id: packId,
text: pair[0].text,
partner_text: pair[0].partner_text || null,
intensity: defaultIntensity,
inverse_of: null,
question_type: generatedQuestionType,
config: null,
@@ -649,7 +635,6 @@ export function QuestionsPage() {
<AIPolishButton
text={formData.text}
type="question"
explicit={pack?.is_explicit ?? false}
onPolished={(val) => setFormData(d => ({ ...d, text: val }))}
/>
</div>
@@ -713,7 +698,6 @@ export function QuestionsPage() {
<AIPolishButton
text={formData.partner_text}
type="partner_text"
explicit={pack?.is_explicit ?? false}
onPolished={(val) => setFormData(d => ({ ...d, partner_text: val }))}
/>
</div>
@@ -926,7 +910,7 @@ export function QuestionsPage() {
open={aiDialogOpen}
onOpenChange={setAiDialogOpen}
type="questions"
context={{ packName: pack?.name, packDescription: pack?.description, isExplicit: pack?.is_explicit, existingQuestions: questions.map(q => q.text) }}
context={{ packName: pack?.name, packDescription: pack?.description, existingQuestions: questions.map(q => q.text) }}
onGenerated={handleAiGenerated}
/>
@@ -934,7 +918,6 @@ export function QuestionsPage() {
open={reviewOpen}
onOpenChange={setReviewOpen}
questions={reviewQuestions}
isExplicit={pack?.is_explicit ?? false}
onUpdated={fetchData}
/>
+9 -21
View File
@@ -37,7 +37,7 @@ import {
SelectTrigger,
SelectValue,
} from '@/components/ui/select';
import { Crown, Users, MessageCircle, ChevronRight, ThumbsUp, ThumbsDown, Minus, Gift, Image, Video as VideoIcon, Target, User, Eye, EyeOff, CheckCircle, Package, Heart, Sparkles, Flame, Trophy, Calendar } from 'lucide-react';
import { Crown, Users, MessageCircle, ChevronRight, ThumbsUp, ThumbsDown, Minus, Gift, Image, Video as VideoIcon, Target, User, Eye, EyeOff, CheckCircle, Package, Sparkles, Flame, Trophy, Calendar } from 'lucide-react';
import { format } from 'date-fns';
import { IconPreview } from '@/components/ui/icon-picker';
@@ -46,8 +46,6 @@ type Gender = 'male' | 'female' | 'non-binary' | 'prefer-not-to-say';
// ... (interfaces and constants are the same)
type IntensityLevel = 1 | 2 | 3 | 4 | 5;
interface Profile {
id: string;
name: string | null;
@@ -58,9 +56,8 @@ interface Profile {
created_at: string | null;
gender: Gender | null;
usage_reason: UsageReason | null;
show_explicit_content: boolean | null;
hide_nsfw: boolean | null;
onboarding_completed: boolean | null;
max_intensity: IntensityLevel | null;
}
const usageReasonLabels: Record<UsageReason, { label: string; icon: string }> = {
@@ -78,14 +75,6 @@ const genderLabels: Record<Gender, string> = {
'prefer-not-to-say': 'Prefer not to say',
};
const intensityLabels: Record<IntensityLevel, { label: string; emoji: string }> = {
1: { label: 'Gentle', emoji: '💭' },
2: { label: 'Warm', emoji: '💕' },
3: { label: 'Playful', emoji: '😏' },
4: { label: 'Steamy', emoji: '🔥' },
5: { label: 'Intense', emoji: '🌶️' },
};
interface Partner {
id: string;
name: string | null;
@@ -556,11 +545,10 @@ export function UserDetailPage() {
</div>
</div></CardContent></Card>
{/* Onboarding Details */}
<Card><CardHeader className="pb-3"><CardTitle className="text-lg flex items-center gap-2"><CheckCircle className="h-5 w-5 text-primary" />Onboarding Details</CardTitle><CardDescription>Information collected during user onboarding</CardDescription></CardHeader><CardContent><div className="grid gap-4 md:grid-cols-2 lg:grid-cols-5">
<Card><CardHeader className="pb-3"><CardTitle className="text-lg flex items-center gap-2"><CheckCircle className="h-5 w-5 text-primary" />Onboarding Details</CardTitle><CardDescription>Information collected during user onboarding</CardDescription></CardHeader><CardContent><div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
<div className="flex items-start gap-3"><div className="p-2 rounded-lg bg-blue-100 dark:bg-blue-900"><User className="h-4 w-4 text-blue-600 dark:text-blue-400" /></div><div><p className="text-sm font-medium text-muted-foreground">Gender</p><p className="font-medium">{profile.gender ? genderLabels[profile.gender] : 'Not set'}</p></div></div>
<div className="flex items-start gap-3"><div className="p-2 rounded-lg bg-purple-100 dark:bg-purple-900"><Target className="h-4 w-4 text-purple-600 dark:text-purple-400" /></div><div><p className="text-sm font-medium text-muted-foreground">Why using Sauci</p><p className="font-medium">{profile.usage_reason ? usageReasonLabels[profile.usage_reason]?.label : 'Not set'}</p></div></div>
<div className="flex items-start gap-3"><div className="p-2 rounded-lg bg-pink-100 dark:bg-pink-900"><Heart className="h-4 w-4 text-pink-600 dark:text-pink-400" /></div><div><p className="text-sm font-medium text-muted-foreground">Comfort Zone</p><p className="font-medium">{profile.max_intensity ? `${intensityLabels[profile.max_intensity].emoji} ${intensityLabels[profile.max_intensity].label} (${profile.max_intensity})` : 'Not set'}</p></div></div>
<div className="flex items-start gap-3"><div className={`p-2 rounded-lg ${profile.show_explicit_content ? 'bg-amber-100 dark:bg-amber-900' : 'bg-gray-100 dark:bg-gray-800'}`}>{profile.show_explicit_content ? <Eye className="h-4 w-4 text-amber-600 dark:text-amber-400" /> : <EyeOff className="h-4 w-4 text-gray-500 dark:text-gray-400" />}</div><div><p className="text-sm font-medium text-muted-foreground">Explicit Content</p><p className="font-medium">{profile.show_explicit_content === null ? 'Not set' : profile.show_explicit_content ? 'Enabled' : 'Disabled'}</p></div></div>
<div className="flex items-start gap-3"><div className={`p-2 rounded-lg ${profile.hide_nsfw ? 'bg-gray-100 dark:bg-gray-800' : 'bg-amber-100 dark:bg-amber-900'}`}>{profile.hide_nsfw ? <EyeOff className="h-4 w-4 text-gray-500 dark:text-gray-400" /> : <Eye className="h-4 w-4 text-amber-600 dark:text-amber-400" />}</div><div><p className="text-sm font-medium text-muted-foreground">Hide NSFW</p><p className="font-medium">{profile.hide_nsfw === null ? 'Not set' : profile.hide_nsfw ? 'Yes' : 'No'}</p></div></div>
<div className="flex items-start gap-3"><div className={`p-2 rounded-lg ${profile.onboarding_completed ? 'bg-green-100 dark:bg-green-900' : 'bg-red-100 dark:bg-red-900'}`}><CheckCircle className={`h-4 w-4 ${profile.onboarding_completed ? 'text-green-600 dark:text-green-400' : 'text-red-500 dark:text-red-400'}`} /></div><div><p className="text-sm font-medium text-muted-foreground">Onboarding</p><p className="font-medium">{profile.onboarding_completed ? 'Completed' : 'Not completed'}</p></div></div>
</div></CardContent></Card>
{/* Streak Info */}
@@ -674,17 +662,17 @@ export function UserDetailPage() {
<CardTitle className="text-base">{ep.pack.name}</CardTitle>
</div>
<div className="flex gap-1">
{ep.pack.is_explicit && (
<Badge variant="destructive" className="text-xs">
NSFW
</Badge>
)}
{ep.pack.is_premium && (
<Badge className="bg-amber-500 text-xs">
<Crown className="h-3 w-3 mr-1" />
Premium
</Badge>
)}
{ep.pack.is_explicit && (
<Badge variant="destructive" className="text-xs">
18+
</Badge>
)}
</div>
</div>
{ep.pack.description && (
+94 -59
View File
@@ -226,13 +226,13 @@ export function UsersPage() {
<TableHeader>
<TableRow>
<TableHead>User</TableHead>
<TableHead>Email</TableHead>
<TableHead>Status</TableHead>
<TableHead>Couple</TableHead>
<TableHead>Storage</TableHead>
<TableHead>Joined</TableHead>
<TableHead>Last Active</TableHead>
<TableHead className="w-12"></TableHead>
<TableHead className="hidden md:table-cell">Email</TableHead>
<TableHead className="hidden md:table-cell">Status</TableHead>
<TableHead className="hidden lg:table-cell">Couple</TableHead>
<TableHead className="hidden lg:table-cell">Storage</TableHead>
<TableHead className="hidden xl:table-cell">Joined</TableHead>
<TableHead className="hidden xl:table-cell">Last Active</TableHead>
<TableHead className="hidden md:table-cell w-12"></TableHead>
</TableRow>
</TableHeader>
<TableBody>
@@ -243,41 +243,8 @@ export function UsersPage() {
</TableCell>
</TableRow>
) : (
paginatedProfiles.map((profile) => (
<TableRow key={profile.id}>
<TableCell>
<Link to={`/users/${profile.id}`} className="flex items-center gap-3 hover:opacity-80 transition-opacity">
<Avatar className="h-9 w-9">
<AvatarImage src={profile.avatar_url || undefined} />
<AvatarFallback>
{profile.name?.charAt(0).toUpperCase() || 'U'}
</AvatarFallback>
</Avatar>
<span className="font-medium hover:text-primary transition-colors">
{profile.name || 'Unnamed User'}
</span>
</Link>
</TableCell>
<TableCell className="text-muted-foreground">
<div className="flex items-center gap-1.5">
{profile.email ? (
<>
{profile.email}
{!profile.email_confirmed_at && (
<span title="Email not verified">
<MailWarning className="h-3.5 w-3.5 text-amber-500" />
</span>
)}
</>
) : (
<Badge variant="secondary" className="bg-slate-100 text-slate-500 hover:bg-slate-200">
Guest
</Badge>
)}
</div>
</TableCell>
<TableCell>
{profile.is_premium ? (
paginatedProfiles.map((profile) => {
const statusBadge = profile.is_premium ? (
<Badge className="bg-amber-500">
<Crown className="h-3 w-3 mr-1" />
Premium
@@ -291,10 +258,9 @@ export function UsersPage() {
<Badge variant="secondary" className="bg-slate-100 text-slate-500 hover:bg-slate-200">
Free
</Badge>
)}
</TableCell>
<TableCell>
{profile.couple_id ? (
);
const coupleBadge = profile.couple_id ? (
profile.partner_count && profile.partner_count >= 2 ? (
<Badge variant="secondary" className="bg-green-100 text-green-700 hover:bg-green-200">
<Users className="h-3 w-3 mr-1" />
@@ -307,30 +273,98 @@ export function UsersPage() {
</Badge>
)
) : (
<span className="text-muted-foreground text-sm">—</span>
<span className="text-muted-foreground text-xs">Not paired</span>
);
const emailContent = profile.email ? (
<span className="flex items-center gap-1.5 truncate max-w-[220px]">
<span className="truncate">{profile.email}</span>
{!profile.email_confirmed_at && (
<MailWarning className="h-3.5 w-3.5 text-amber-500" aria-label="Email not verified" />
)}
</TableCell>
</span>
) : (
<Badge variant="secondary" className="bg-slate-100 text-slate-500 hover:bg-slate-200">
Guest
</Badge>
);
const storageLabel = profile.storage_bytes && profile.storage_bytes > 0
? formatBytes(profile.storage_bytes)
: '—';
const joinedLabel = profile.created_at
? format(new Date(profile.created_at), 'MMM d, yyyy')
: '—';
const lastActiveLabel = profile.last_sign_in_at
? format(new Date(profile.last_sign_in_at), 'MMM d, yyyy h:mm a')
: 'Never';
return (
<TableRow key={profile.id}>
<TableCell>
<div className="flex items-center gap-3">
<Link to={`/users/${profile.id}`} className="flex items-center gap-3 min-w-0 hover:opacity-80 transition-opacity">
<Avatar className="h-9 w-9">
<AvatarImage src={profile.avatar_url || undefined} />
<AvatarFallback>
{profile.name?.charAt(0).toUpperCase() || 'U'}
</AvatarFallback>
</Avatar>
<span className="font-medium truncate hover:text-primary transition-colors">
{profile.name || 'Unnamed User'}
</span>
</Link>
<div className="ml-auto md:hidden">
<Link to={`/users/${profile.id}`}>
<Button variant="ghost" size="icon">
<ChevronRight className="h-4 w-4" />
</Button>
</Link>
</div>
</div>
<div className="mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground md:hidden">
{emailContent}
{statusBadge}
{coupleBadge}
{storageLabel !== '—' && (
<span className="flex items-center gap-1">
<HardDrive className="h-3 w-3 text-muted-foreground" />
{storageLabel}
</span>
)}
<span className="text-muted-foreground">Active {lastActiveLabel}</span>
</div>
</TableCell>
<TableCell className="hidden md:table-cell text-muted-foreground">
<div className="flex items-center gap-1.5">
{emailContent}
</div>
</TableCell>
<TableCell className="hidden md:table-cell">
{statusBadge}
</TableCell>
<TableCell className="hidden lg:table-cell">
{profile.couple_id ? coupleBadge : <span className="text-muted-foreground text-sm">—</span>}
</TableCell>
<TableCell className="hidden lg:table-cell">
{profile.storage_bytes && profile.storage_bytes > 0 ? (
<div className="flex items-center gap-1 text-sm">
<HardDrive className="h-3 w-3 text-muted-foreground" />
{formatBytes(profile.storage_bytes)}
{storageLabel}
</div>
) : (
<span className="text-muted-foreground text-sm">—</span>
)}
</TableCell>
<TableCell className="text-muted-foreground text-sm">
{profile.created_at
? format(new Date(profile.created_at), 'MMM d, yyyy')
: '—'}
<TableCell className="hidden xl:table-cell text-muted-foreground text-sm">
{joinedLabel}
</TableCell>
<TableCell className="text-muted-foreground text-sm">
{profile.last_sign_in_at
? format(new Date(profile.last_sign_in_at), 'MMM d, yyyy h:mm a')
: 'Never'}
<TableCell className="hidden xl:table-cell text-muted-foreground text-sm">
{lastActiveLabel}
</TableCell>
<TableCell>
<TableCell className="hidden md:table-cell">
<Link to={`/users/${profile.id}`}>
<Button variant="ghost" size="icon">
<ChevronRight className="h-4 w-4" />
@@ -338,7 +372,8 @@ export function UsersPage() {
</Link>
</TableCell>
</TableRow>
))
);
})
)}
</TableBody>
</Table>
+256
View File
@@ -0,0 +1,256 @@
# New Question Types Draft - Non-Explicit Packs
New questions using **audio**, **photo**, and **who_likely** types for all non-explicit question packs. Questions match the tone, intensity range, and theme of each pack.
**Question types:**
- **audio** - User records a voice response (max 60s)
- **photo** - User uploads/captures a photo
- **who_likely** - "Who is more likely to..." (each partner picks who)
None of these types use partner_text.
---
## 1. Staying Close (Long Distance, intensity 1)
| # | Type | Text | Intensity |
|---|------|------|-----------|
| 1 | audio | Record a voice note saying good morning to your partner | 1 |
| 2 | audio | Record yourself humming or singing a song that reminds you of your partner | 1 |
| 3 | audio | Leave a voice note describing the best part of your day | 1 |
| 4 | audio | Record a bedtime voice note for your partner to fall asleep to | 1 |
| 5 | photo | Send a photo of your current view right now | 1 |
| 6 | photo | Share a photo of something that made you smile today | 1 |
| 7 | photo | Take a photo of your pillow and empty bed | 1 |
| 8 | photo | Send a photo of your morning coffee or tea | 1 |
| 9 | who_likely | Who is more likely to call the other first? | 1 |
| 10 | who_likely | Who is more likely to fall asleep on a video call? | 1 |
| 11 | who_likely | Who is more likely to send a random "I miss you" text? | 1 |
| 12 | who_likely | Who is more likely to plan a surprise visit? | 1 |
| 13 | who_likely | Who is more likely to cry at the airport? | 1 |
---
## 2. Finding Your Vibe (Social Life, intensity 1)
| # | Type | Text | Intensity |
|---|------|------|-----------|
| 1 | who_likely | Who is more likely to be the last one on the dance floor? | 1 |
| 2 | who_likely | Who is more likely to make friends with a stranger at a party? | 1 |
| 3 | who_likely | Who is more likely to suggest leaving early? | 1 |
| 4 | who_likely | Who is more likely to be the designated driver? | 1 |
| 5 | who_likely | Who is more likely to start a karaoke session? | 1 |
| 6 | who_likely | Who is more likely to cancel plans to stay in? | 1 |
| 7 | audio | Describe your perfect night out in a voice note | 1 |
| 8 | photo | Share a photo of your go-to going-out outfit | 1 |
---
## 3. Weekend Warriors (Adventure & Travel, intensity 1-2)
| # | Type | Text | Intensity |
|---|------|------|-----------|
| 1 | who_likely | Who is more likely to suggest an unplanned road trip? | 1 |
| 2 | who_likely | Who is more likely to get competitive at mini golf? | 1 |
| 3 | who_likely | Who is more likely to try a new restaurant without checking reviews? | 1 |
| 4 | who_likely | Who is more likely to spend the entire weekend on the couch? | 1 |
| 5 | who_likely | Who is more likely to drag the other to a flea market? | 1 |
| 6 | photo | Share a photo of a place nearby you've been wanting to visit together | 1 |
| 7 | photo | Take a photo of your ideal weekend morning setup | 1 |
| 8 | audio | Describe a weekend adventure you'd love to go on together | 1 |
| 9 | audio | Tell your partner about your favorite weekend memory together | 1 |
---
## 4. Outdoor Explorers (Adventure & Travel, intensity 1)
| # | Type | Text | Intensity |
|---|------|------|-----------|
| 1 | who_likely | Who is more likely to suggest a spontaneous hike? | 1 |
| 2 | who_likely | Who is more likely to get lost on a trail? | 1 |
| 3 | who_likely | Who is more likely to complain about the weather? | 1 |
| 4 | who_likely | Who is more likely to forget the sunscreen? | 1 |
| 5 | who_likely | Who would survive longer in the wilderness? | 1 |
| 6 | photo | Share a photo of your favorite outdoor spot | 1 |
| 7 | photo | Take a photo of the view from your window right now | 1 |
| 8 | audio | Describe your dream outdoor adventure in a voice note | 1 |
| 9 | audio | Tell your partner about a time in nature that felt magical | 1 |
---
## 5. Romantic Gestures (Romance & Sensuality, intensity 2-4)
| # | Type | Text | Intensity |
|---|------|------|-----------|
| 1 | audio | Whisper something sweet to your partner | 2 |
| 2 | audio | Record yourself saying what you love most about your partner | 2 |
| 3 | audio | Tell your partner about a moment with them you'll never forget | 2 |
| 4 | audio | In your most romantic voice, tell your partner what they mean to you | 3 |
| 5 | audio | Describe the first time you knew you were falling for your partner | 2 |
| 6 | photo | Set up a romantic scene at home and share a photo | 2 |
| 7 | photo | Write a short love note by hand and send a photo of it | 2 |
| 8 | photo | Share a photo from a moment together that makes your heart race | 2 |
| 9 | who_likely | Who is more likely to plan a surprise romantic gesture? | 2 |
| 10 | who_likely | Who is more likely to initiate a slow dance in the kitchen? | 2 |
| 11 | who_likely | Who is more likely to write a love letter? | 2 |
| 12 | who_likely | Who is more likely to pull the other in for a random kiss? | 2 |
---
## 6. Sensual Massage (Sensual Discovery, intensity 2-3)
| # | Type | Text | Intensity |
|---|------|------|-----------|
| 1 | who_likely | Who is more likely to ask for a massage after a long day? | 2 |
| 2 | who_likely | Who is more likely to fall asleep during a massage? | 2 |
| 3 | who_likely | Who gives the better back massage? | 2 |
| 4 | audio | Describe how you would give your partner the perfect massage | 3 |
| 5 | audio | Tell your partner which part of your body holds the most tension | 2 |
---
## 7. Missing You (Long Distance, intensity 1-3)
| # | Type | Text | Intensity |
|---|------|------|-----------|
| 1 | audio | Record a whispered "I miss you" voice note | 2 |
| 2 | audio | Describe what you'd do in the first five minutes of seeing your partner again | 2 |
| 3 | audio | Read your partner a short goodnight message in your sleepiest voice | 1 |
| 4 | audio | Tell your partner the thing you miss most about being together | 1 |
| 5 | photo | Take a selfie right now, no filter, no prep | 1 |
| 6 | photo | Share a photo of something you bought that reminded you of your partner | 1 |
| 7 | photo | Send a photo of what you're wearing right now | 2 |
| 8 | photo | Share a photo of your favorite thing your partner left at your place | 1 |
| 9 | who_likely | Who is more likely to send a 3am "thinking of you" text? | 1 |
| 10 | who_likely | Who is more likely to rewatch old photos and videos of you two? | 1 |
| 11 | who_likely | Who is more likely to wear the other person's hoodie? | 1 |
| 12 | who_likely | Who is more likely to get emotional hearing a song that reminds them of the other? | 1 |
---
## 8. Everyday Moments (Quality Time, intensity 1)
| # | Type | Text | Intensity |
|---|------|------|-----------|
| 1 | photo | Share a photo of your morning coffee or breakfast | 1 |
| 2 | photo | Take a photo of your workspace or desk setup | 1 |
| 3 | photo | Share a photo of something small that made your day better | 1 |
| 4 | audio | Describe your favorite daily ritual you share together | 1 |
| 5 | audio | Tell your partner what you were just thinking about | 1 |
| 6 | who_likely | Who is more likely to wake up first? | 1 |
| 7 | who_likely | Who is more likely to cook dinner on a weeknight? | 1 |
| 8 | who_likely | Who is more likely to fall asleep on the couch? | 1 |
| 9 | who_likely | Who is more likely to suggest ordering takeout? | 1 |
| 10 | who_likely | Who is more likely to do the dishes without being asked? | 1 |
---
## 9. Relationship Essentials (Quality Time, intensity 1)
| # | Type | Text | Intensity |
|---|------|------|-----------|
| 1 | audio | Tell your partner one thing you appreciate about them that you don't say enough | 1 |
| 2 | audio | Describe in your own words what makes your relationship work | 1 |
| 3 | audio | Tell your partner about a time they made you feel truly safe | 1 |
| 4 | who_likely | Who is more likely to apologize first after an argument? | 1 |
| 5 | who_likely | Who is more likely to bring up something that's bothering them? | 1 |
| 6 | who_likely | Who is more likely to remember an anniversary or special date? | 1 |
| 7 | who_likely | Who is more likely to compromise during a disagreement? | 1 |
| 8 | who_likely | Who is more likely to say "I love you" first each day? | 1 |
| 9 | photo | Share a photo of something that reminds you of your relationship | 1 |
---
## 10. Hosting (Social Life, intensity 1)
| # | Type | Text | Intensity |
|---|------|------|-----------|
| 1 | who_likely | Who is more likely to overdo it on the snacks and decorations? | 1 |
| 2 | who_likely | Who is more likely to still be cleaning five minutes before guests arrive? | 1 |
| 3 | who_likely | Who is the better DJ at a house party? | 1 |
| 4 | who_likely | Who is more likely to invite too many people? | 1 |
| 5 | photo | Share a photo of your dream hosting setup or table setting | 1 |
| 6 | audio | Describe your dream dinner party - who's invited and what's on the menu? | 1 |
| 7 | audio | What's your signature dish you'd make for guests? Describe it | 1 |
---
## 11. Body Mapping (Sensual Discovery, intensity 2-3)
| # | Type | Text | Intensity |
|---|------|------|-----------|
| 1 | who_likely | Who is more ticklish? | 2 |
| 2 | who_likely | Who has more sensitive ears? | 2 |
| 3 | who_likely | Who reacts more to having their neck kissed? | 2 |
| 4 | who_likely | Who is more likely to discover a new sensitive spot on the other? | 2 |
| 5 | audio | Describe where you most love being touched by your partner | 3 |
| 6 | audio | Tell your partner the kind of touch that instantly relaxes you | 2 |
---
## 12. Date Night Ideas (Quality Time, intensity 1-2)
| # | Type | Text | Intensity |
|---|------|------|-----------|
| 1 | photo | Share a photo of a restaurant or cafe you'd love to take your partner to | 1 |
| 2 | photo | Take a photo of your date night outfit | 1 |
| 3 | photo | Share a photo of a dish you'd love to cook together | 1 |
| 4 | audio | Pitch your dream date night from start to finish | 1 |
| 5 | audio | Describe the best date you've ever been on together | 1 |
| 6 | who_likely | Who is more likely to pick the restaurant? | 1 |
| 7 | who_likely | Who is more likely to try something completely new on a date? | 1 |
| 8 | who_likely | Who is more likely to plan a surprise date? | 1 |
| 9 | who_likely | Who is more likely to lose track of time on a date because you're having too much fun? | 1 |
---
## 13. First Impressions (Roleplay, intensity 2-3)
| # | Type | Text | Intensity |
|---|------|------|-----------|
| 1 | audio | Introduce yourself to your partner as if you're meeting for the first time | 2 |
| 2 | audio | Deliver your best pick-up line to your partner | 2 |
| 3 | audio | In character, leave a voicemail asking your partner on a first date | 2 |
| 4 | audio | Describe what you'd wear to impress your partner if you were meeting for the first time | 2 |
| 5 | who_likely | Who is more likely to approach the other if you were strangers? | 2 |
| 6 | who_likely | Who is more likely to break character and laugh? | 2 |
| 7 | who_likely | Who is more likely to use a cheesy pick-up line? | 2 |
| 8 | who_likely | Who would be more nervous on a real first date? | 2 |
| 9 | photo | Snap a photo of the outfit you'd wear to make a killer first impression | 2 |
---
## 14. Food & Culture (Adventure & Travel, intensity 1)
| # | Type | Text | Intensity |
|---|------|------|-----------|
| 1 | photo | Share a photo of a dish you've been craving lately | 1 |
| 2 | photo | Take a photo of something in your kitchen that tells a story | 1 |
| 3 | audio | Describe a meal from your childhood that means a lot to you | 1 |
| 4 | audio | Tell your partner about a cuisine you've always wanted to try together | 1 |
| 5 | who_likely | Who is the pickier eater? | 1 |
| 6 | who_likely | Who is more likely to try an unusual local delicacy while traveling? | 1 |
| 7 | who_likely | Who is more likely to send back a dish at a restaurant? | 1 |
| 8 | who_likely | Who is the better cook? | 1 |
---
## Summary
| Pack | Audio | Photo | Who Likely | Total New |
|------|-------|-------|------------|-----------|
| Staying Close | 4 | 4 | 5 | **13** |
| Finding Your Vibe | 1 | 1 | 6 | **8** |
| Weekend Warriors | 2 | 2 | 5 | **9** |
| Outdoor Explorers | 2 | 2 | 5 | **9** |
| Romantic Gestures | 5 | 3 | 4 | **12** |
| Sensual Massage | 2 | 0 | 3 | **5** |
| Missing You | 4 | 4 | 4 | **12** |
| Everyday Moments | 2 | 3 | 5 | **10** |
| Relationship Essentials | 3 | 1 | 5 | **9** |
| Hosting | 2 | 1 | 4 | **7** |
| Body Mapping | 2 | 0 | 4 | **6** |
| Date Night Ideas | 2 | 3 | 4 | **9** |
| First Impressions | 4 | 1 | 4 | **9** |
| Food & Culture | 2 | 2 | 4 | **8** |
| **Totals** | **37** | **27** | **62** | **126** |