final polish phase 1
This commit is contained in:
177
to-do-s/PLAN-DASHBOARD-HOMEPAGE.md
Normal file
177
to-do-s/PLAN-DASHBOARD-HOMEPAGE.md
Normal file
@@ -0,0 +1,177 @@
|
||||
|
||||
## 5. Dashboard Redesign Plan
|
||||
|
||||
### Current Issues
|
||||
- Too much whitespace and large headings
|
||||
- Repeating same counts/metrics without different dimensions
|
||||
- Missing actionable insights
|
||||
- No AI operations analytics
|
||||
- Missing "needs attention" items
|
||||
|
||||
### New Dashboard Design: Multi-Dimension Compact Widgets
|
||||
|
||||
Based on Django admin reports analysis, the dashboard should show **different data dimensions** instead of repeating counts:
|
||||
|
||||
### Dashboard Layout (Compact, Information-Dense)
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────────────────────────┐
|
||||
│ ⚠ NEEDS ATTENTION (collapsible, only shows if items exist) │
|
||||
│ ┌────────────────────┐ ┌────────────────────┐ ┌────────────────────┐ │
|
||||
│ │ 3 pending review │ │ WP sync failed │ │ Setup incomplete │ │
|
||||
│ │ [Review →] │ │ [Retry] [Fix →] │ │ [Complete →] │ │
|
||||
│ └────────────────────┘ └────────────────────┘ └────────────────────┘ │
|
||||
├─────────────────────────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌─────────────────────────────────┐ ┌─────────────────────────────────────────┐ │
|
||||
│ │ WORKFLOW PIPELINE │ │ QUICK ACTIONS │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ Sites → KWs → Clusters → Ideas │ │ [+ Keywords] [⚡ Cluster] [📝 Content] │ │
|
||||
│ │ 2 156 23 67 │ │ [🖼 Images] [✓ Review] [🚀 Publish] │ │
|
||||
│ │ ↓ │ │ │ │
|
||||
│ │ Tasks → Drafts → Published │ │ WORKFLOW GUIDE │ │
|
||||
│ │ 45 28 45 │ │ 1. Add Keywords 5. Generate Content │ │
|
||||
│ │ │ │ 2. Auto Cluster 6. Generate Images │ │
|
||||
│ │ ████████████░░░ 72% Complete │ │ 3. Generate Ideas 7. Review & Approve │ │
|
||||
│ │ │ │ 4. Create Tasks 8. Publish to WP │ │
|
||||
│ └─────────────────────────────────┘ │ [Full Help →] │ │
|
||||
│ └─────────────────────────────────────────┘ │
|
||||
│ │
|
||||
├─────────────────────────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌─────────────────────────────────┐ ┌─────────────────────────────────────────┐ │
|
||||
│ │ AI OPERATIONS (7d) [▼ 30d] │ │ RECENT ACTIVITY │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ Operation Count Credits │ │ • Clustered 45 keywords → 8 clusters │ │
|
||||
│ │ ───────────────────────────────│ │ 2 hours ago │ │
|
||||
│ │ Clustering 8 80 │ │ • Generated 5 articles (4.2K words) │ │
|
||||
│ │ Ideas 12 24 │ │ 4 hours ago │ │
|
||||
│ │ Content 28 1,400 │ │ • Created 15 image prompts │ │
|
||||
│ │ Images 45 225 │ │ Yesterday │ │
|
||||
│ │ ───────────────────────────────│ │ • Published "Best Running Shoes" to WP │ │
|
||||
│ │ Total 93 1,729 │ │ Yesterday │ │
|
||||
│ │ │ │ • Added 23 keywords from seed DB │ │
|
||||
│ │ Success Rate: 98.5% │ │ 2 days ago │ │
|
||||
│ │ Avg Credits/Op: 18.6 │ │ │ │
|
||||
│ └─────────────────────────────────┘ │ [View All Activity →] │ │
|
||||
│ └─────────────────────────────────────────┘ │
|
||||
│ │
|
||||
├─────────────────────────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌─────────────────────────────────┐ ┌─────────────────────────────────────────┐ │
|
||||
│ │ CONTENT VELOCITY │ │ AUTOMATION STATUS │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ This Week This Month Total │ │ ● Active │ Schedule: Daily 9 AM │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ Articles 5 28 156 │ │ Last Run: Dec 27, 7:00 AM │ │
|
||||
│ │ Words 4.2K 24K 156K │ │ ├─ Clustered: 12 keywords │ │
|
||||
│ │ Images 12 67 340 │ │ ├─ Ideas: 8 generated │ │
|
||||
│ │ │ │ ├─ Content: 5 articles │ │
|
||||
│ │ 📈 +23% vs last week │ │ └─ Images: 15 created │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ [View Analytics →] │ │ Next Run: Dec 28, 9:00 AM │ │
|
||||
│ └─────────────────────────────────┘ │ [Configure →] [Run Now →] │ │
|
||||
│ └─────────────────────────────────────────┘ │
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### Widget Specifications
|
||||
|
||||
#### 1. Needs Attention Bar
|
||||
- Collapsible, only visible when items exist
|
||||
- Types: `pending_review`, `sync_failed`, `setup_incomplete`, `automation_failed`
|
||||
- Compact horizontal cards with action buttons
|
||||
|
||||
#### 2. Workflow Pipeline Widget
|
||||
- Visual flow: Sites → Keywords → Clusters → Ideas → Tasks → Drafts → Published
|
||||
- Shows counts at each stage
|
||||
- Single progress bar for overall completion
|
||||
- Clickable stage names link to respective pages
|
||||
|
||||
#### 3. Quick Actions + Workflow Guide Widget
|
||||
- 2x3 grid of action buttons (use existing icons)
|
||||
- Compact numbered workflow guide (1-8 steps)
|
||||
- "Full Help" link to help page
|
||||
|
||||
#### 4. AI Operations Widget (NEW - from Django Admin Reports)
|
||||
Shows data from `CreditUsageLog` model:
|
||||
```typescript
|
||||
interface AIOperationsData {
|
||||
period: '7d' | '30d' | '90d';
|
||||
operations: Array<{
|
||||
type: 'clustering' | 'ideas' | 'content' | 'images';
|
||||
count: number;
|
||||
credits: number;
|
||||
}>;
|
||||
totals: {
|
||||
count: number;
|
||||
credits: number;
|
||||
success_rate: number;
|
||||
avg_credits_per_op: number;
|
||||
};
|
||||
}
|
||||
```
|
||||
- Time period filter (7d/30d/90d dropdown)
|
||||
- Table with operation type, count, credits
|
||||
- Success rate percentage
|
||||
- Average credits per operation
|
||||
|
||||
#### 5. Recent Activity Widget
|
||||
Shows data from `AITaskLog` and `CreditUsageLog`:
|
||||
- Last 5 significant operations
|
||||
- Timestamp relative (2 hours ago, Yesterday)
|
||||
- Clickable to navigate to relevant content
|
||||
- "View All Activity" link
|
||||
|
||||
#### 6. Content Velocity Widget (NEW)
|
||||
Shows content production rates:
|
||||
```typescript
|
||||
interface ContentVelocityData {
|
||||
this_week: { articles: number; words: number; images: number };
|
||||
this_month: { articles: number; words: number; images: number };
|
||||
total: { articles: number; words: number; images: number };
|
||||
trend: number; // percentage vs previous period
|
||||
}
|
||||
```
|
||||
- Three time columns: This Week, This Month, Total
|
||||
- Rows: Articles, Words, Images
|
||||
- Trend indicator vs previous period
|
||||
|
||||
#### 7. Automation Status Widget
|
||||
Shows automation run status:
|
||||
- Current status indicator (Active/Paused/Failed)
|
||||
- Schedule display
|
||||
- Last run details with stage breakdown
|
||||
- Next scheduled run
|
||||
- Configure and Run Now buttons
|
||||
|
||||
### API Endpoint Required
|
||||
|
||||
```python
|
||||
# GET /api/v1/dashboard/summary/
|
||||
{
|
||||
"needs_attention": [...],
|
||||
"pipeline": {
|
||||
"sites": 2, "keywords": 156, "clusters": 23,
|
||||
"ideas": 67, "tasks": 45, "drafts": 28, "published": 45,
|
||||
"completion_percentage": 72
|
||||
},
|
||||
"ai_operations": {
|
||||
"period": "7d",
|
||||
"operations": [...],
|
||||
"totals": {...}
|
||||
},
|
||||
"recent_activity": [...],
|
||||
"content_velocity": {...},
|
||||
"automation": {...}
|
||||
}
|
||||
```
|
||||
|
||||
### Implementation Notes
|
||||
|
||||
- Use existing components from `components/ui/`
|
||||
- Use CSS tokens from `styles/tokens.css`
|
||||
- Grid layout: `grid grid-cols-1 lg:grid-cols-2 gap-4`
|
||||
- Compact widget padding: `p-4`
|
||||
- No large headings - use subtle section labels
|
||||
181
to-do-s/PLAN-SITE-SELECTOR-SECTOR.md
Normal file
181
to-do-s/PLAN-SITE-SELECTOR-SECTOR.md
Normal file
@@ -0,0 +1,181 @@
|
||||
# Plan: Site & Sector Selector Configuration
|
||||
|
||||
**Source:** COMPREHENSIVE-AUDIT-REPORT.md - Section 1
|
||||
**Priority:** High for Planner & Writer pages
|
||||
**Estimated Effort:** 4-6 hours
|
||||
|
||||
---
|
||||
|
||||
## Objective
|
||||
|
||||
Ensure correct placement of Site Selector and Sector Selector across all pages based on data scope requirements.
|
||||
|
||||
---
|
||||
|
||||
## Configuration Rules
|
||||
|
||||
| Condition | Site Selector | Sector Selector |
|
||||
|-----------|:-------------:|:---------------:|
|
||||
| Data scoped to specific site | ✅ | ❌ |
|
||||
| Data can be filtered by content category | ✅ | ✅ |
|
||||
| Page is not site-specific (account-level) | ❌ | ❌ |
|
||||
| Already in specific context (detail page) | ❌ | ❌ |
|
||||
|
||||
---
|
||||
|
||||
## Implementation Checklist
|
||||
|
||||
### DASHBOARD Module
|
||||
- [ ] **Home** - Site Selector: ✅ (with "All Sites" option) | Sector: ❌
|
||||
- Overview across sites - sector too granular for dashboard
|
||||
|
||||
### SETUP Module
|
||||
- [ ] **Add Keywords** - Site: ✅ | Sector: ✅
|
||||
- Keywords are site+sector specific
|
||||
- [ ] **Content Settings** - Site: ✅ | Sector: ❌
|
||||
- Settings are site-level, not sector-level
|
||||
- [ ] **Sites List** - Site: ❌ | Sector: ❌
|
||||
- Managing sites themselves
|
||||
- [ ] **Site Dashboard** - Site: ❌ (context) | Sector: ❌
|
||||
- Already in specific site context
|
||||
- [ ] **Site Settings tabs** - Site: ❌ (context) | Sector: ❌
|
||||
- Already in specific site context
|
||||
|
||||
### PLANNER Module
|
||||
- [ ] **Keywords** - Site: ✅ | Sector: ✅
|
||||
- Keywords organized by site+sector
|
||||
- [ ] **Clusters** - Site: ✅ | Sector: ✅
|
||||
- Clusters organized by site+sector
|
||||
- [ ] **Cluster Detail** - Site: ❌ (context) | Sector: ❌ (context)
|
||||
- Already in cluster context
|
||||
- [ ] **Ideas** - Site: ✅ | Sector: ✅
|
||||
- Ideas organized by site+sector
|
||||
|
||||
### WRITER Module
|
||||
- [ ] **Tasks/Queue** - Site: ✅ | Sector: ✅
|
||||
- Tasks organized by site+sector
|
||||
- [ ] **Content/Drafts** - Site: ✅ | Sector: ✅
|
||||
- Content organized by site+sector
|
||||
- [ ] **Content View** - Site: ❌ (context) | Sector: ❌ (context)
|
||||
- Viewing specific content
|
||||
- [ ] **Images** - Site: ✅ | Sector: ✅
|
||||
- Images tied to content by site+sector
|
||||
- [ ] **Review** - Site: ✅ | Sector: ✅
|
||||
- Review queue by site+sector
|
||||
- [ ] **Published** - Site: ✅ | Sector: ✅
|
||||
- Published content by site+sector
|
||||
|
||||
### AUTOMATION Module
|
||||
- [ ] **Automation** - Site: ✅ | Sector: ❌
|
||||
- Automation runs at site level
|
||||
|
||||
### LINKER Module (if enabled)
|
||||
- [ ] **Content List** - Site: ✅ | Sector: ✅
|
||||
- Linking is content-specific
|
||||
|
||||
### OPTIMIZER Module (if enabled)
|
||||
- [ ] **Content Selector** - Site: ✅ | Sector: ✅
|
||||
- Optimization is content-specific
|
||||
- [ ] **Analysis Preview** - Site: ❌ (context) | Sector: ❌ (context)
|
||||
- Already in analysis context
|
||||
|
||||
### THINKER Module (Admin)
|
||||
- [ ] **All Thinker pages** - Site: ❌ | Sector: ❌
|
||||
- System-wide prompts/profiles
|
||||
|
||||
### BILLING Module
|
||||
- [ ] **All Billing pages** - Site: ❌ | Sector: ❌
|
||||
- Account-level billing data
|
||||
|
||||
### ACCOUNT Module
|
||||
- [ ] **Account Settings** - Site: ❌ | Sector: ❌
|
||||
- [ ] **Profile** - Site: ❌ | Sector: ❌
|
||||
- [ ] **Team** - Site: ❌ | Sector: ❌
|
||||
- [ ] **Plans** - Site: ❌ | Sector: ❌
|
||||
- [ ] **Usage** - Site: ❌ | Sector: ❌
|
||||
|
||||
### HELP Module
|
||||
- [ ] **Help Page** - Site: ❌ | Sector: ❌
|
||||
|
||||
---
|
||||
|
||||
## Site Setup Checklist on Site Cards
|
||||
|
||||
**Source:** Section 6 of Audit Report
|
||||
|
||||
### Current Status
|
||||
- ✅ `SiteSetupChecklist.tsx` component EXISTS
|
||||
- ✅ Integrated in Site Dashboard (full mode)
|
||||
- ❌ **NOT integrated in SiteCard.tsx** (compact mode)
|
||||
|
||||
### Implementation Task
|
||||
|
||||
**File:** `frontend/src/components/sites/SiteCard.tsx`
|
||||
|
||||
Add compact checklist after status badges:
|
||||
|
||||
```tsx
|
||||
<SiteSetupChecklist
|
||||
siteId={site.id}
|
||||
siteName={site.name}
|
||||
hasIndustry={!!site.industry}
|
||||
hasSectors={site.sectors_count > 0}
|
||||
hasWordPressIntegration={!!site.wordpress_site_url}
|
||||
hasKeywords={site.keywords_count > 0}
|
||||
compact={true}
|
||||
/>
|
||||
```
|
||||
|
||||
**Expected Visual:**
|
||||
```
|
||||
┌─────────────────────────────────────────┐
|
||||
│ My Website [Active] │
|
||||
│ example.com │
|
||||
│ Industry: Tech │ 3 Sectors │
|
||||
│ ●●●○ 3/4 Setup Steps Complete │ ← compact checklist
|
||||
│ [Manage →] │
|
||||
└─────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Backend Requirements
|
||||
|
||||
Ensure `SiteSerializer` returns these fields for checklist:
|
||||
- `keywords_count` - number of keywords
|
||||
- `has_integration` - boolean for WordPress integration
|
||||
- `active_sectors_count` - number of active sectors
|
||||
- `industry_name` - industry name or null
|
||||
|
||||
**Status:** ✅ Already verified these fields are returned
|
||||
|
||||
---
|
||||
|
||||
## Files to Modify
|
||||
|
||||
### Frontend
|
||||
1. `frontend/src/components/sites/SiteCard.tsx` - Add compact SiteSetupChecklist
|
||||
2. Various page files to verify/add selector configuration
|
||||
|
||||
### Selector Components
|
||||
- `frontend/src/components/common/SiteSelector.tsx`
|
||||
- `frontend/src/components/common/SectorSelector.tsx`
|
||||
|
||||
---
|
||||
|
||||
## Testing Checklist
|
||||
|
||||
- [ ] Site selector shows on all required pages
|
||||
- [ ] Sector selector shows only where data is sector-specific
|
||||
- [ ] Detail pages (Cluster Detail, Content View) have no selectors
|
||||
- [ ] Account/Billing pages have no selectors
|
||||
- [ ] SiteCard shows compact setup checklist
|
||||
- [ ] Checklist updates when site configuration changes
|
||||
|
||||
---
|
||||
|
||||
## Notes
|
||||
|
||||
- The "All Sites" option on Dashboard should aggregate data across all user's sites
|
||||
- Context pages (detail views) inherit site/sector from parent navigation
|
||||
- Selector state should persist in URL params or store for deep linking
|
||||
Reference in New Issue
Block a user