Description
New page (key '5') in tui/dashboard.py showing the full Foofaraw/QB editorial pipeline status and the week's publishing schedule.
DATA SOURCE: All stats come from direct httpx REST queries to The Pile's Supabase DB (same creds as pile-admin/pile-reader).
Stat panels:
- Open submissions — submissions WHERE submittable_status NOT IN ('accepted','completed','declined')
- Needs contract — acceptances WHERE status = 'Accepted'
- Contract sent, awaiting return — acceptances WHERE status = 'Contract Sent' AND contract_returned_at IS NULL
- Ready to pay — acceptances WHERE status = 'Contract Sent' AND contract_returned_at IS NOT NULL AND payout_batch_id IS NULL
Note: stat 4 is only as fresh as the last pile-contracts run (which stamps contract_returned_at), but the data lives in the DB — no subprocess needed to read it.
Weekly schedule: acceptances WHERE publish_date BETWEEN today AND today+7. Group by project_settings.template: 'standard' → Foofaraw, 'qb' → QB. Show date + author + title per row. Bold today/tomorrow.
Navigation: j/k + Enter. Enter on stat panel shows underlying item list. Enter on schedule item shows detail (author, word_count, status, notes, story_url).
Reference: ~/Developer/The-Pile/scripts/contracts-inbox.js (Supabase client + query patterns), ~/Developer/The-Pile/database/acceptances.sql, migrations/013_contracts_inbox.sql (contract_returned_at), migrations/009_payout_tracking.sql (payout_batch_id).
Acceptance Criteria
- #1 Page 5 shows 4 pipeline counts live from Supabase; week schedule lists Foofaraw+QB posts; auto-refreshes; Enter on stat row opens item list