Skip to content

feat: Dispatch UI — full-screen post overlay + cover image prompt generator #298

Description

@melagiri

Feature Summary

Two enhancements to the Dispatch UI that improve the post preview and drafting experience.

Scope tags: VISUAL, API_CHANGE


Enhancement 1 — Full-Screen Post Overlay

Replace the in-drawer post preview with a full-screen overlay that opens immediately after generation.

What changes:

  • New PostOverlay.tsx component: shadcn Dialog with full-screen override classes (max-w-none w-screen h-screen rounded-none p-0)
  • DispatchDrawer.tsx becomes config-only (no longer shows post preview inline)
  • After generation, overlay opens automatically with the result
  • Drawer stays open behind overlay so selection state is preserved
  • Escape key + X button close the overlay
  • Closing overlay discards result (no draft saving — intentional)
  • Drawer footer shows "View post" + "Regenerate" buttons when a result exists

Files modified:

  • dashboard/src/components/dispatch/PostOverlay.tsx (new)
  • dashboard/src/components/dispatch/DispatchDrawer.tsx (config-only refactor)

Enhancement 2 — On-Demand Cover Image Prompt Generator

A new button in the overlay that generates a text prompt suitable for image generation tools (Midjourney, DALL-E, Gemini Imagen).

What changes:

  • New endpoint: POST /api/dispatch/image-prompt
    • Input: { title, tags, tldr, format } — title+tldr+tags only (no body)
    • Output: { prompt: string, model: string, tokensUsed: { input, output } }
    • Temperature: 0.85, responseFormat: 'text'
    • Single attempt, no retry
    • parseImagePromptOutput strips meta-commentary, trims, validates non-empty
  • New CoverImagePromptSection.tsx component: "Get cover image prompt" button (Sparkles icon) → mutation → read-only Textarea + Copy button + Regenerate link
  • Lives inside PostOverlay below PostPreview

System prompt: Instructs LLM to act as a visual art director producing a single paragraph (50-75 words) — concrete visual scene, style, 2-3 color palette, mood/lighting, no text/logos, tool-agnostic.

Files modified/created:

  • server/src/llm/dispatch-prompts.ts — add buildImagePromptSystemPrompt, buildImagePromptContext, parseImagePromptOutput
  • server/src/routes/dispatch.ts — add POST /image-prompt handler
  • cli/src/types.ts — add DispatchImagePromptRequest, DispatchImagePromptResponse
  • dashboard/src/lib/api.ts — add generateDispatchImagePrompt
  • dashboard/src/components/dispatch/CoverImagePromptSection.tsx (new)
  • dashboard/src/components/dispatch/PostOverlay.tsx (new — embeds PostPreview + CoverImagePromptSection)

Implementation Sequence (TDD)

  1. Types in cli/src/types.ts
  2. Tests for 3 new dispatch-prompts.ts functions (red)
  3. Implement buildImagePromptSystemPrompt, buildImagePromptContext, parseImagePromptOutput (green)
  4. Tests for POST /image-prompt endpoint (red)
  5. Add POST /image-prompt handler to dispatch.ts (green), pnpm test in server/
  6. Add generateDispatchImagePrompt + types to dashboard/src/lib/api.ts
  7. Build CoverImagePromptSection.tsx
  8. Build PostOverlay.tsx (embeds PostPreview + CoverImagePromptSection)
  9. Modify DispatchDrawer.tsx (config-only, overlay sibling)
  10. pnpm build from root, run dashboard, verify full flow

Scope Boundary (explicitly out of scope)

  • Inline post editing
  • Draft saving
  • Publish integrations
  • Actual image rendering
  • Model-tier routing
  • Streaming image prompt
  • Prompt history

Acceptance Criteria

Full-screen overlay:

  • Post overlay opens immediately after generation, covers full viewport
  • Drawer remains open behind overlay (selection state preserved)
  • Escape key and X button close overlay
  • Closing overlay discards result (no stale state on reopen)
  • "View post" + "Regenerate" buttons appear in drawer footer when result exists

Cover image prompt:

  • POST /api/dispatch/image-prompt returns { prompt, model, tokensUsed } for valid input
  • parseImagePromptOutput strips meta-commentary, trims, rejects empty string
  • buildImagePromptContext uses title+tldr+tags only (no body)
  • "Get cover image prompt" button triggers mutation, shows loading state
  • Result renders in read-only Textarea with Copy + Regenerate controls
  • pnpm build from repo root: zero errors
  • pnpm test in server/: all tests pass

T-Shirt Size: M

Design locked pre-implementation by TA + LLM Expert consultation. No architectural decisions pending.

Branch: feature/dispatch-ui-full-screen-overlay-post-preview-on-de
Worktree: /Users/melagiri/Workspace/codeInsights/code-insights-dispatch-ui-full-screen-overlay-post-preview-on-de/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew functionality

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions