-
Quick Decision Flow - Users can create decisions, but...
- Data gets saved to Firestore ✅
- BUT: Not displayed anywhere after creation ❌
- No way to view saved decisions ❌
-
Database Layer - All CRUD operations exist
createQuickDecision()✅getQuickDecision()✅listQuickDecisions()✅getDashboardStats()✅ (function exists but not used)
-
AI Services - Working
- Extract decision options ✅
- Generate recommendations ✅
-
Dashboard Page (
DashboardPage.tsx)- All stats are fake numbers
- Recent decisions are mock data
- Charts show fake data
- No Firebase queries
-
Reflections Page (
ReflectionsPage.tsx)- Generates mock decisions with
generateMockDecisions() - Generates mock reflections with
generateMockReflections() - No real database integration
- Generates mock decisions with
-
Profile Page (need to check)
- Likely hardcoded user data
-
Decision History Page
- Doesn't exist yet
- Needed to view past decisions
-
Decision Detail Page
- Doesn't exist
- Can't view full decision after creation
File: src/Core/Dashboard/DashboardPage.tsx
Effort: 1 day
Replace hardcoded data with real queries:
// Instead of fake data:
const insightStats = [hardcoded...];
// Do this:
const [stats, setStats] = useState<DashboardStats | null>(null);
useEffect(() => {
async function loadStats() {
const data = await getDashboardStats(user.uid);
setStats(data);
}
loadStats();
}, [user]);Implementation Steps:
- Add
useEffecthooks to load data - Query
getDashboardStats(userId) - Query
listQuickDecisions(userId, { limit: 5 })for recent decisions - Calculate real stats (decisions this week/month)
- Add loading states
- Add error handling
File: src/Core/Decisions/DecisionHistoryPage.tsx (NEW)
Effort: 1 day
Create dedicated page to view all decisions:
- List all quick decisions for user
- Filter by category
- Search by title
- Sort by date
- Pagination (20 per page)
- Click to view details
Implementation:
export default function DecisionHistoryPage() {
const { user } = useAuth();
const [decisions, setDecisions] = useState<QuickDecision[]>([]);
const [loading, setLoading] = useState(true);
useEffect(() => {
async function loadDecisions() {
if (!user) return;
const data = await listQuickDecisions(user.uid);
setDecisions(data);
setLoading(false);
}
loadDecisions();
}, [user]);
// ... rest of component
}File: src/Core/Decisions/DecisionDetailPage.tsx (NEW)
Effort: 0.5 days
View full decision with all details:
- Decision title, category, status
- All options with pros/cons
- AI recommendation
- Selected option
- Reflection (if exists)
- Edit button
- Delete button
Route: /decisions/:id
File: src/Core/Reflections/ReflectionsPage.tsx
Effort: 0.5 days
Replace mock data with real queries:
- Remove
generateMockDecisions()andgenerateMockReflections() - Query real decisions with reflections
- Join decisions with reflections from Firestore
- Calculate real stats
File: src/Core/Profile/ProfilePage.tsx
Effort: 0.5 days
Show real user data:
- User display name
- Subscription tier
- Account creation date
- Decision count
- Allow editing
File: src/Core/Reflections/Components/CreateReflectionForm.tsx (NEW)
Effort: 1 day
Modal/page to add reflection to a decision:
- Decision reference
- Outcome rating (1-5 stars)
- Notes (text area)
- Would choose again? (yes/no)
- Lessons learned (text)
- Submit to Firestore
File: src/db/Dashboard/dashboardDb.ts
Effort: 0.5 days
Implement getDashboardStats() properly:
export async function getDashboardStats(userId: string): Promise<DashboardStats> {
// Query all decisions
const allDecisions = await listQuickDecisions(userId);
// Calculate this week
const oneWeekAgo = new Date();
oneWeekAgo.setDate(oneWeekAgo.getDate() - 7);
const thisWeek = allDecisions.filter(d => d.createdAt >= oneWeekAgo);
// Calculate this month
const oneMonthAgo = new Date();
oneMonthAgo.setMonth(oneMonthAgo.getMonth() - 1);
const thisMonth = allDecisions.filter(d => d.createdAt >= oneMonthAgo);
// Get reflections
const reflections = await getAllReflections(userId);
const avgRating = reflections.length > 0
? reflections.reduce((sum, r) => sum + r.outcomeRating, 0) / reflections.length
: 0;
// Top category
const categoryCounts: Record<string, number> = {};
allDecisions.forEach(d => {
categoryCounts[d.category] = (categoryCounts[d.category] || 0) + 1;
});
const topCategory = Object.entries(categoryCounts)
.sort(([, a], [, b]) => b - a)[0]?.[0] || 'None';
return {
totalDecisions: allDecisions.length,
quickDecisions: allDecisions.length,
deepDecisions: 0, // TODO: query deep decisions
decisionsThisWeek: thisWeek.length,
decisionsThisMonth: thisMonth.length,
averageOutcomeRating: avgRating,
topCategory,
completionRate: (allDecisions.filter(d => d.status === 'completed').length / allDecisions.length) * 100,
};
}File: src/lib/ai/insightsService.ts (NEW)
Effort: 2 days
Analyze user decisions and generate insights:
- Most common decision category
- Average time to decide
- Best outcomes by category
- Decision-making patterns
- Recommendations for improvement
Use Gemini Pro to analyze all decisions and generate personalized insights.
Effort: 0.5 days
Add Firestore real-time listeners:
useEffect(() => {
if (!user) return;
const unsubscribe = onSnapshot(
query(
collection(db, 'quickDecisions'),
where('userId', '==', user.uid),
orderBy('createdAt', 'desc')
),
(snapshot) => {
const decisions = snapshot.docs.map(doc => ({
id: doc.id,
...doc.data()
}));
setDecisions(decisions);
}
);
return () => unsubscribe();
}, [user]);Effort: 0.5 days
Add proper loading states instead of showing empty content:
- Dashboard skeleton
- Decision list skeleton
- Profile skeleton
Effort: 0.5 days
Handle errors gracefully:
- Network errors
- Empty states
- Permission errors
- Not found states
Effort: 0.5 days
Immediate feedback on actions:
- Delete decision (remove from UI immediately)
- Create reflection (show immediately)
- Update decision (instant update)
Effort: 1 day
Add real charts using recharts library:
- Decisions over time (line chart)
- Category distribution (pie chart)
- Outcome ratings (bar chart)
- ✅ Dashboard real data integration (1 day)
- ✅ Decision History page (1 day)
- ✅ Decision Detail page (0.5 days)
- ✅ Reflections page real data (0.5 days)
- ✅ Stats calculator implementation (0.5 days)
- ✅ Create Reflection form (1 day)
- ✅ Profile page real data (0.5 days)
- ✅ Loading states & skeletons (0.5 days)
- ✅ Error handling (0.5 days)
- ✅ Real-time listeners (0.5 days)
- ✅ Optimistic UI (0.5 days)
- ✅ Pattern recognition AI (2 days)
- ✅ Data visualizations (1 day)
After implementation:
- Dashboard shows real user stats
- Can view all past decisions
- Can click decision to see full details
- Can add reflections to decisions
- Reflections page shows real data
- Profile shows real user info
- Stats accurately calculated from database
- Loading states while fetching data
- Error states for failures
- Real-time updates when data changes
src/Core/Decisions/DecisionHistoryPage.tsxsrc/Core/Decisions/DecisionDetailPage.tsxsrc/Core/Reflections/Components/CreateReflectionForm.tsxsrc/lib/ai/insightsService.tssrc/components/LoadingSkeleton.tsxsrc/components/EmptyState.tsx
src/Core/Dashboard/DashboardPage.tsx- Replace all fake datasrc/Core/Reflections/ReflectionsPage.tsx- Remove mock data generatorssrc/Core/Profile/ProfilePage.tsx- Show real user datasrc/db/Dashboard/dashboardDb.ts- Implement real stats calculationsrc/db/Reflection/reflectionDb.ts- AddgetAllReflections(userId)src/App.tsx- Add new routes for Decision History/Detail
// Dashboard
getDashboardStats(userId) - Calculate all stats
listQuickDecisions(userId, { limit: 5 }) - Recent decisions
getAllReflections(userId) - For average rating
// History
listQuickDecisions(userId, { category?, status?, limit, startAfter })
// Detail
getQuickDecision(id)
getReflectionsForDecision(decisionId)
// Reflections
listQuickDecisions(userId) - All decisions
getAllReflections(userId) - All reflections- Start with Dashboard integration (highest visibility)
- Create Decision History page (core missing feature)
- Connect Reflections to real data
- Build out remaining features
- Add polish (loading, errors, optimistic UI)
Estimated Total Time: 2-3 weeks of focused development