Files
igny8/master-docs/30-frontend/writer/WRITER-MAIN-PAGE.md
IGNY8 VPS (Salman) 3cbed65601 revamps docs complete
2025-12-07 14:14:29 +00:00

2.7 KiB

Writer Main Page (Queue/Drafts/Images Navigation)

Purpose

Serve as the entry surface for writer workflows, routing users to task queue, drafts, images, review, and published content views. It relies on shared table templates and writer navigation tabs defined in the content/tasks/images pages.

Code Locations (exact paths)

  • Key pages under Writer:
    • Tasks (queue): frontend/src/pages/Writer/Tasks.tsx
    • Content drafts/list: frontend/src/pages/Writer/Content.tsx
    • Images: frontend/src/pages/Writer/Images.tsx
    • Content view: frontend/src/pages/Writer/ContentView.tsx
  • Navigation tabs defined inside Tasks/Content/Images pages (writerTabs).

High-Level Responsibilities

  • Present writer-specific navigation and headers.
  • Delegate to module pages that implement task creation, AI generation, content listing, and image management.

Detailed Behavior

  • Writer pages use shared navigation tabs (writerTabs: Queue, Drafts, Images, Review, Published) rendered via ModuleNavigationTabs.
  • Each page sets a header (PageHeader) with badge icon and binds to the tab component for consistent navigation.
  • State (filters, pagination, selections) is managed within each page; there is no global writer-state container beyond shared stores (useSectorStore, usePageSizeStore).

Data Structures / Models Involved (no code)

  • Task, Content, ContentImage DTOs from frontend/src/services/api (writer endpoints).

Execution Flow

  • User enters writer area via route (e.g., /writer/tasks or /writer/content).
  • Navigation tabs switch routes; each route mounts its page and fetches data (tasks/content/images).

Cross-Module Interactions

  • Sector/site scoping via useSectorStore and backend query params in API calls.
  • Optimization and image generation actions route into optimizer or image generation APIs.

State Transitions

  • Per-page loading/filters; navigation changes unmount current page and mount target page.

Error Handling

  • Each page uses toasts for API errors; no shared error surface beyond per-page banners.

Tenancy Rules

  • Backend filters by account/site/sector; pages pass sector context via filters or rely on server defaults.

Billing Rules (if applicable)

  • None on navigation; individual actions (AI generation) consume credits on backend.

Background Tasks / Schedulers (if applicable)

  • None at the navigation level.

Key Design Considerations

  • Tabs keep writer UX consistent; each page owns its data loading to avoid cross-coupling.

How Developers Should Work With This Module

  • When adding a new writer view (e.g., “Outlines”), add a tab entry and a route in App.tsx, and implement the page with the same header/tab pattern.