Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/app/dashboard/ideas/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ export default function IdeaDetailPage() {
if (error) {
console.error('Error fetching idea:', error);
} else if (data) {
// Explicitly casting data to Idea as Supabase types might not be fully generated/in-sync
setIdea(data as unknown as Idea);
setIdea(data as Idea);
}
setLoading(false);
};
Expand All @@ -95,7 +94,7 @@ export default function IdeaDetailPage() {
const savedSettings = localStorage.getItem('vault_ai_settings');
const aiConfig = savedSettings ? JSON.parse(savedSettings) : {};

const analysis = await performResearch(idea.title, idea.description, aiConfig);
const analysis = await performResearch(idea.title, idea.description || '', aiConfig);

await supabase
.from('ideas')
Expand Down Expand Up @@ -134,7 +133,7 @@ export default function IdeaDetailPage() {
{/* Detail Header */}
<div className="flex flex-col md:flex-row md:items-end justify-between gap-6">
<div className="flex-1">
<Badge status={idea.status} />
<Badge status={idea.status || 'Analyzing'} />
<h1 className="text-4xl font-extrabold text-white mt-4 mb-2">{idea.title}</h1>
<p className="text-slate-400 max-w-2xl leading-relaxed">{idea.description}</p>
</div>
Expand Down
16 changes: 3 additions & 13 deletions src/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,7 @@ import { AboutModal } from '@/components/modals/AboutModal';
import { DiscoveryModal } from '@/components/modals/DiscoveryModal';
import { supabase } from '@/lib/supabase';
import { performResearch } from '@/app/actions/research';

interface Idea {
id: string;
title: string;
description: string;
input_type: string;
status: string;
capture_mode?: string;
analysis_result: any;
created_at: string;
}
import { Idea } from '@/types';

interface AIConfig {
apiKey?: string;
Expand Down Expand Up @@ -287,9 +277,9 @@ Key Hypotheses: ${synthesisOutput.fullPrompt?.hypotheses?.join(', ') || 'None'}
idea={{
id: idea.id,
title: idea.title,
description: idea.description,
description: idea.description || '',
inputType: idea.input_type || 'Text',
status: idea.status,
status: idea.status || 'Analyzing',
tags: idea.analysis_result?.tags || ["#Processing"]
}}
/>
Expand Down
9 changes: 5 additions & 4 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface AnalysisResult {
}>;
actionPlan?: string[];
error?: string;
tags?: string[];
}

export type IdeaStatus = 'Analyzing' | 'Ready' | 'Discovery' | 'Error';
Expand All @@ -27,10 +28,10 @@ export interface Idea {
id: string;
user_id: string;
title: string;
description: string;
input_type: IdeaInputType;
status: IdeaStatus;
capture_mode: IdeaCaptureMode;
description: string | null;
input_type: IdeaInputType | null;
status: IdeaStatus | null;
capture_mode: IdeaCaptureMode | null;
discovery_session_id: string | null;
analysis_result: AnalysisResult | null;
created_at: string;
Expand Down