πŸš€ IGNY8 β€” STAGE 2 FRONTEND REFACTOR PROMPT (FINAL + SAFE + BACKEND-LOCKED) Frontend Realignment & UX Refactor Based on Completed Backend (Stage 1) IMPORTANT β€” DO NOT SKIP THIS HEADER Backend is fully completed according to STAGE_1_COMPLETE.md and must NOT be modified. You MUST NOT: Modify backend models Modify backend serializers Modify backend enums Modify backend endpoints Add new backend fields Change existing backend choice values Add new DB fields (like word_count or image_count) You are ONLY updating the React frontend (pages, components, Zustand stores, API hooks, UI, routing, layouts). All frontend changes must strictly match the final backend schema described in STAGE_1_COMPLETE.md (treat it as the single source of truth). STAGE 2 β€” OBJECTIVE Realign the entire frontend UI/UX to match the finalized backend architecture: New simplified model fields New statuses New flows New cluster + taxonomy mappings New content_types and content_structures (from backend choices) Clean, consistent UI across all modules Content Manager becomes the final, authoritative content pipeline Sites module cleaned according to your 18-point correction Your output MUST include: All changed frontend files All removed frontend files All new components/pages Updated Zustand stores Updated hooks & service calls Updated documentation Updated changelog Implement EVERY ITEM below exactly β€” nothing added, nothing skipped. πŸ”· PART A β€” GLOBAL FRONTEND UPDATES A.1 Update all API hooks & service files Replace ALL references to deprecated backend fields: ❌ Remove: cluster_role sync_status context_type content_role dimension_meta any legacy entity_type any old WP sync status fields βœ” Replace with final backend fields: content_type content_structure taxonomy_term taxonomy_terms external_id external_url status = draft/published source = igny8/wordpress Use EXACT choice values returned by backend. Frontend labels may be prettier, but backend values MUST not be touched. A.2 Update Zustand Stores Task Store status: queued / completed Remove: cluster_role, sync_status, entity_type Content Store status: draft / published source: igny8 / wordpress Existing fields only β€” no new fields A.3 UI Consistency All modules use same button types (Primary, Secondary, Ghost, Icon) Fix mismatched paddings, icons, alignments Remove all old icons or styles referencing removed backend fields πŸ”· PART B β€” PLANNER MODULE B.1 Cluster List Make cluster name clickable Navigate to /clusters/:id Remove UI touches showing: cluster roles context types unused metadata B.2 Idea Cards Each idea must show: cluster content_type (backend choices) content_structure (backend choices) B.3 Task Creation Task creation form MUST include: βœ” cluster βœ” content_type βœ” content_structure βœ” primary_keyword βœ” taxonomy_term (only when content_type = taxonomy) Remove: ❌ Blog post ❌ sync_status ❌ cluster_role ❌ unused dropdowns πŸ”· PART C β€” WRITER MODULE C.1 Tasks Table Columns: Title Cluster Content Type Content Structure Status (queued/completed) Created Date Actions Remove: sync_status cluster_role entity_type any deprecated WP sync fields C.2 Task Detail After content is generated, redirect to Content Manager for editing Task status becomes completed No legacy fields displayed C.3 Filters Allow: content_type content_structure cluster status Remove: sync_status cluster_role unused filters πŸ”· PART D β€” SITES MODULE (18-POINT FIX) You MUST implement your EXACT 18-point spec. D.1 Sites Page Layout Grid view ONLY Remove table toggle Collapsible Add Site form (shown when no sites exist) Add Site button triggers collapsible form, not modal D.2 Remove These ❌ Pages button ❌ Sectors button ❌ Blueprints button ❌ Create Site (builder) ❌ Banner notifications ❌ β€œSites Configuration” text ❌ Any code behind these D.3 Site Card Top-right: βœ” Active/inactive switch Bottom buttons (ONLY): βœ” Dashboard βœ” Content βœ” Settings D.4 Settings Page Two-row grid of 4 cards: General SEO Meta Open Graph Schema Below: βœ” Sector/Industry selector (moved from card) πŸ”· PART E β€” CLUSTER DETAIL PAGE Create/Refactor /clusters/:id: Tabs/Sections: Articles Pages Products Taxonomy Pages Each item must list: Title content_type content_structure taxonomy_terms (names) status source Actions (edit/view in CM) No: ❌ cluster_role ❌ old counters ❌ legacy metadata πŸ”· PART F β€” CONTENT MANAGER This is the most critical component. F.1 Content Table Columns Title (clickable β†’ edit page) Content Type Content Structure Cluster Taxonomy Terms Status (draft/published) Source (IGNY8/WP) URL (if published) Word Count (frontend computed from content_html β€” DO NOT add backend fields) Images (only if existing API/image relations exist β€” DO NOT add backend fields) Actions F.2 Filters cluster content_type content_structure taxonomy (dropdown) status source F.3 Row Actions Edit Content Publish to WordPress View in WordPress (if external_url exists) Assign taxonomy Assign cluster View images (if supported by existing API) F.4 Bulk Actions Bulk publish Bulk assign cluster Bulk assign taxonomy F.5 Content Editor Page Editable: title content_html Selectable: cluster taxonomy_terms content_type (backend choices) content_structure (backend choices) Remove: ❌ sync_status ❌ cluster_role ❌ WP meta fields F.6 Publish to WP Button must: Call /content/{id}/publish/ On success: Set status = published Update external_id Update external_url πŸ”· PART G β€” GLOBAL UI CLEANUP Remove all UI references to: Blog post type sync_status cluster_role context_type content_role any labels from old WP sync Ensure: button consistency icon consistency spacing and padding correct grid layouts πŸ”· PART H β€” FRONTEND DOCUMENTATION UPDATE Update the frontend reference docs to include: Final UI structure Page responsibilities New pipeline (Planner β†’ Writer β†’ Content Manager β†’ WP Publish) All dropdown fields and mappings All component flows Remove all old/legacy references. πŸ”· PART I β€” CHANGELOG UPDATE Append entry: v1.0 β€” Stage 2 Frontend Refactor Planner, Writer, Sites, Clusters, Content Manager UI fully updated Deprecated UI elements removed Full alignment with Stage 1 backend Unified statuses, content types, and structures Correct WordPress publish and import integration Documentation updated πŸ”₯ FINAL EXECUTION INSTRUCTIONS You MUST: Implement ALL changes above Output ALL updated frontend files Remove ALL deprecated frontend code Update documentation Update changelog Provide a final summary listing: Updated pages Updated components Updated stores Updated hooks Removed files Any new components added