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)
- Types in
cli/src/types.ts
- Tests for 3 new
dispatch-prompts.ts functions (red)
- Implement
buildImagePromptSystemPrompt, buildImagePromptContext, parseImagePromptOutput (green)
- Tests for
POST /image-prompt endpoint (red)
- Add
POST /image-prompt handler to dispatch.ts (green), pnpm test in server/
- Add
generateDispatchImagePrompt + types to dashboard/src/lib/api.ts
- Build
CoverImagePromptSection.tsx
- Build
PostOverlay.tsx (embeds PostPreview + CoverImagePromptSection)
- Modify
DispatchDrawer.tsx (config-only, overlay sibling)
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:
Cover image prompt:
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/
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:
PostOverlay.tsxcomponent: shadcnDialogwith full-screen override classes (max-w-none w-screen h-screen rounded-none p-0)DispatchDrawer.tsxbecomes config-only (no longer shows post preview inline)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:
POST /api/dispatch/image-prompt{ title, tags, tldr, format }— title+tldr+tags only (no body){ prompt: string, model: string, tokensUsed: { input, output } }responseFormat: 'text'parseImagePromptOutputstrips meta-commentary, trims, validates non-emptyCoverImagePromptSection.tsxcomponent: "Get cover image prompt" button (Sparkles icon) → mutation → read-only Textarea + Copy button + Regenerate linkPostOverlaybelowPostPreviewSystem 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— addbuildImagePromptSystemPrompt,buildImagePromptContext,parseImagePromptOutputserver/src/routes/dispatch.ts— addPOST /image-prompthandlercli/src/types.ts— addDispatchImagePromptRequest,DispatchImagePromptResponsedashboard/src/lib/api.ts— addgenerateDispatchImagePromptdashboard/src/components/dispatch/CoverImagePromptSection.tsx(new)dashboard/src/components/dispatch/PostOverlay.tsx(new — embeds PostPreview + CoverImagePromptSection)Implementation Sequence (TDD)
cli/src/types.tsdispatch-prompts.tsfunctions (red)buildImagePromptSystemPrompt,buildImagePromptContext,parseImagePromptOutput(green)POST /image-promptendpoint (red)POST /image-prompthandler todispatch.ts(green),pnpm testinserver/generateDispatchImagePrompt+ types todashboard/src/lib/api.tsCoverImagePromptSection.tsxPostOverlay.tsx(embeds PostPreview + CoverImagePromptSection)DispatchDrawer.tsx(config-only, overlay sibling)pnpm buildfrom root, run dashboard, verify full flowScope Boundary (explicitly out of scope)
Acceptance Criteria
Full-screen overlay:
Cover image prompt:
POST /api/dispatch/image-promptreturns{ prompt, model, tokensUsed }for valid inputparseImagePromptOutputstrips meta-commentary, trims, rejects empty stringbuildImagePromptContextuses title+tldr+tags only (no body)pnpm buildfrom repo root: zero errorspnpm testinserver/: all tests passT-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-deWorktree:
/Users/melagiri/Workspace/codeInsights/code-insights-dispatch-ui-full-screen-overlay-post-preview-on-de/