Loading project...
# minna-portal
**Status:** 🟢 Active
**Phase:** Linear Integration Complete
**Last Activity:** 2026-02-06 (Phase 1 Linear integration complete - portal displays Linear tasks)
**URL:** https://minna.johngirard.com
**⚠️ BREAKING ISSUE:** Portal task displays broken after Linear-first migration (T95 in minna-1.0). All STATUS.md task sections removed, but portal UI still expects `minna_tasks` table to have data. See `BREAKING-CHANGES.md` for full assessment.
---
## Linear Metadata
**Project ID:** `be2a188f-cfed-46cd-8505-34963bc34cc0`
**Team ID:** `96b685fe-2252-47c5-97ee-273d8c484942`
**Last Synced:** `2026-02-06T13:20:38.267Z`
## Overview
Web application (Next.js + Supabase) that displays John's projects, tasks, and daily work. Features: project cards, task kanban, chat integration, research results, mobile rapid mode.
**What This Project Tracks:** Building the portal itself — UI components, database schema, sync scripts, deployment.
**What the Portal Displays:** John's workspace projects (but those are tracked in their own STATUS.md files, not here).
---
## Architecture
```
STATUS.md files ←→ Sync Scripts ←→ Supabase (public schema) ←→ Portal UI
(git) (npx tsx) (minna_* tables) (real-time)
MD → Supabase: scripts/sync-data.ts
Supabase → MD: scripts/generate-md.ts
New Tables:
- minna_chat_sessions: Chat history persistence
- minna_chat_messages: Updated with session_id
- minna_task_results: Task deliverables and research
- minna_arbitrary_tasks: Standalone tasks outside projects
- minna_frogs: Daily frog tracking (Wave 1)
- minna_frog_streaks: Streak tracking with triggers
- minna_user_settings: Focus mode and reminder preferences
- minna_project_crons: Cron job tracking per project
- minna_cron_logs: Cron run history
- minna_cron_health: View for cron health status
```
**Data Flow:**
- STATUS.md files are source of truth (human-editable, git-tracked)
- Sync script parses MD files → Supabase tables
- Portal UI reads from Supabase for real-time display
- Chat can update Supabase → regenerate MD (bidirectional)
**⚠️ BROKEN:** Task sync broken after Linear migration. STATUS.md files no longer have `## Tasks` sections (tasks moved to Linear), but portal still expects `minna_tasks` table to have data. Result: Empty task displays across portal.
**See `SUPABASE-AND-SYNC.md` for complete configuration, credentials, and sync details.**
---
## ✅ Linear Integration Status (Previously Broken)
**Fixed:** 2026-02-06 via Phase 1 Linear Integration
**Root Cause (was):** Linear-first migration (T95 in minna-1.0) removed `## Tasks` sections from all STATUS.md files. Portal UI was querying empty `minna_tasks` table.
**Solution:** Portal now queries Linear API directly for tasks. Tasks are fetched from Linear using project ID stored in STATUS.md metadata.
### Now Working ✅
- ✅ **Project task displays** - KanbanBoard shows Linear issues
- ✅ **Task kanban** - Tasks displayed by status (Backlog/Active/Waiting/Done)
- ✅ **Task detail modals** - Shows Linear metadata + "Open in Linear" button
- ✅ **Task export** - Markdown export includes Linear tasks
- ✅ **Dashboard task stats** - Shows active task count from Linear
- ✅ **Waiting task digest** - Aggregates waiting tasks from Linear
### Still Working ✅
- ✅ Project metadata displays (cards, status, phase, overview)
- ✅ Arbitrary tasks (`minna_arbitrary_tasks` table)
- ✅ Chat, delights, research, agent activity
- ✅ Frog widget, cron monitoring, command palette
### Tables to Deprecate (Phase 3)
- `minna_tasks` - Legacy table, no longer used
- Sync script task parsing - No longer needed
**See `docs/DATA-ARCHITECTURE-ANALYSIS.md` for architecture details.**
---
## 🔧 Remediation Plan
**⚠️ ARCHITECTURE UPDATE (2026-02-06):**
Initial "sync-first" architecture (`REVISED-LINEAR-ARCHITECTURE.md` - Portal never queries Linear, only Supabase) has been **SUPERSEDED** by newer "Linear-direct" recommendations from comprehensive data architecture analyses:
- `DATA-ARCHITECTURE-ANALYSIS.md` (minna-portal worker)
- `DATA-ARCHITECTURE-ANALYSIS.md` (minna-1.0 worker)
**New approach:** Use Linear as DB directly with Supabase caching layer. Merge at render time via webhooks + 5-min sync.
---
Three migration options analyzed (see `BREAKING-CHANGES.md`):
| Option | Approach | Effort | Recommended |
|--------|----------|--------|-------------|
| **A** | Full Linear Integration | 15-20h | ✅ Yes (Linear-direct + cache) |
| **B** | Hybrid (drop task views) | 4-6h | ⚠️ Pragmatic |
| **C** | Rebuild sync (Linear → Supabase) | 20-25h | ❌ Not recommended |
**Chosen Approach:** Option A (Full Linear Integration with cache)
**Rationale:**
- Aligns with Linear-first architecture
- Real-time task updates via Linear API
- Supabase cache for performance (<10ms vs ~150ms)
- Future-proof
- Leverages Linear's full feature set
## Key Files
### Documentation
- `SUPABASE-AND-SYNC.md` — **Supabase configuration, credentials, sync scripts, and cron setup**
- `docs/DEVELOPMENT-PATTERNS.md` — Meta patterns for development workflow (PM worker agent, spec-first dev)
- `docs/SPEC-OPTIMISTIC-UPDATES.md` — Optimistic updates & snappy UX specification (02-02)
- `docs/SPEC-PLANNING-UI.md` — Planning skills UI specification (02-04)
- `docs/COMPREHENSIVE-FUNCTIONALITY-AUDIT.md` — Full functionality audit (02-03)
- `docs/AUDIT-PROJECT-STATUS-LOGIC.md` — Comprehensive audit of all status states
- `docs/SPEC-PROJECT-CONFIG.md` — Project configuration schema
- `docs/SPEC-LIVE-AGENT-STATUS.md` — Agent activity indicator spec
- `docs/SPEC-DECISION-OPTIONS.md` — Decision options feature spec
- `docs/SPEC-MOBILE-RAPID-MODE.md` — Mobile rapid mode spec
- `docs/PROPOSAL-PROJECT-STATUS-TAXONOMY.md` — Proposed 3-tier taxonomy
### Core
- `progress.json` — Machine-readable progress
- `app/` — Next.js application
- `app/lib/parser.ts` — STATUS.md parser
- `app/lib/queries.ts` — Supabase queries
- `app/lib/supabase.ts` — Supabase client & API functions (expanded)
- `app/lib/prompt-formatter.ts` — Chat prompt formatting for agent context
- `app/scripts/sync-data.ts` — MD → Supabase sync
- `app/scripts/generate-md.ts` — Supabase → MD generator
- `app/scripts/seed-new-features.ts` — Seed data for new features
- `supabase/migrations/` — Database schema
### Chat Components
- `app/components/chat/ChatContext.tsx` — Chat state provider (with persistence)
- `app/components/chat/ChatDrawer.tsx` — Slide-in chat panel (with history)
- `app/components/chat/ChatIcon.tsx` — Chat buttons for cards
### Task Components
- `app/components/TaskDetailModal.tsx` — Project task edit modal
- `app/components/ArbitraryTaskCard.tsx` — Standalone task card
- `app/components/ArbitraryTaskDetailModal.tsx` — Standalone task detail modal
- `app/components/TaskQueue.tsx` — Task queue for dashboard
- `app/components/NewProjectWizard.tsx` — Project creation wizard
### Results Components
- `app/components/TaskResultCard.tsx` — Result preview card
- `app/components/TaskResultViewer.tsx` — Full result viewer with renderers
### Pages
- `app/app/page.tsx` — Dashboard (with FrogWidget & HealthLegend)
- `app/app/focus/page.tsx` — Morning Focus Dashboard
- `app/app/tasks/page.tsx` — Full task queue
- `app/app/results/page.tsx` — Task results gallery
### Wave 1 Components
- `app/components/FrogWidget.tsx` — Frog of the Day widget
- `app/components/FrogWidgetServer.tsx` — Server wrapper for FrogWidget
- `app/components/HealthBadge.tsx` — Project health indicators
- `app/app/focus/FocusDashboardClient.tsx` — Focus mode client component
### Wave 1 Migrations
- `supabase/migrations/20260202_frog_system.sql` — Frog tables & user settings
### Wave 2 Components
- `app/components/CommandPalette.tsx` — Keyboard command palette (Cmd+K)
- `app/components/QuickCaptureFAB.tsx` — Floating action button for quick task capture
- `app/components/WaitingDigest.tsx` — Waiting tasks morning digest component
- `app/components/MarkdownExport.tsx` — Export to markdown (copy/download)
- `app/components/GlobalProviders.tsx` — Global UI wrapper (CommandPalette + FAB)
### Decision Options Components (02-03)
- `app/types/decision-options.ts` — TypeScript types for DecisionOption, WaitingTaskDecision
- `app/lib/decision-options.ts` — Prompt generation, parsing, resolution utilities
- `app/components/DecisionOptionItem.tsx` — Individual option display with vibe-aware styling
- `app/components/DecisionOptionsCard.tsx` — Options list with "think harder", freeform, submit
- `supabase/migrations/20260203_decision_options.sql` — JSONB column + helper functions + view
### Mobile Rapid Mode Components (02-03)
- `app/app/rapid/page.tsx` — Mobile rapid mode route
- `app/app/rapid/layout.tsx` — PWA-enhanced mobile layout
- `app/components/mobile/RapidDashboard.tsx` — Main mobile view with tabs
- `app/components/mobile/MobileHeader.tsx` — Minimal header with back/refresh
- `app/components/mobile/ProgressFeed.tsx` — Live agent activity feed (with WebSocket)
- `app/components/mobile/DecisionQueue.tsx` — Waiting items with decision options
- `app/components/mobile/QuickDecisionCard.tsx` — Compact decision UI for mobile
### WebSocket & Real-Time Components (02-03)
- `app/lib/agent-activity-service.ts` — Singleton polling service for agent activity
- `app/hooks/useAgentActivityRealtime.ts` — React hooks for real-time agent data
- `app/components/GlobalAgentIndicator.tsx` — Header indicator for active agents
---
## Quick Start
```bash
cd app
# Run migrations (apply to Supabase)
# Copy contents of supabase/migrations/*.sql to Supabase SQL editor
# Seed new feature data (optional)
npx tsx scripts/seed-new-features.ts
# Sync data from STATUS.md files to Supabase
npx tsx scripts/sync-data.ts
# Generate STATUS.md from Supabase (single project)
npx tsx scripts/generate-md.ts project-slug
# Generate all STATUS.md files
npx tsx scripts/generate-md.ts
# Run dev server
npm run dev
# View at http://localhost:3000
```
---
## Bugs Fixed (01-31)
| ID | Bug | Fix |
|----|-----|-----|
| BUG1 | Task cards not clickable | Moved onClick to outer div, stopPropagation on ChatIcon |
| BUG2 | Chat drawer X close flaky | Fixed closeChat race condition in ChatContext |
| BUG3 | Chat drawer ESC not working | Same fix as BUG2 |
| BUG4 | Missing sparkle cursor | CSS class with inline SVG fallback |
| BUG5 | Sync date parsing error | Empty string → null conversion |
---
## Test Results (01-31)
- **Build:** ✅ Passing
- **Dev Server:** ✅ Running
- **TypeScript:** ✅ No errors
- **Data Sync:** ✅ 10/11 projects synced
- **Run 1 (Core):** ✅ Build + bug fixes verified
- **Run 2 (Wave 1+2):** 🔄 In progress — 169 tests across 7 extensions
---
## Tech Stack
| Layer | Choice |
|-------|--------|
| Framework | Next.js 16+ (App Router) |
| UI | React + Tailwind + shadcn/ui |
| Database | Supabase (Postgres + Realtime) |
| Hosting | Vercel (pending) |
| Auth | Supabase Auth (pending) |
| File Sync | Scripts (cron for prod) |
---
*Last updated: 2/4/2026, 10:00am*